From a9ae65e4d93e404a11e89aa77c54d88762fd563e Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 4 Feb 2019 15:35:05 -0500 Subject: [PATCH 001/243] Add day-of email, update batch script (#331) * Add day-of email, update batch script * update authentication * Update docs * add tests * Verify that test hacker has proper data * Fix test --- assets/email/Welcome.hbs | 464 +++++++++++++++++++++++++++++++ constants/routes.constant.js | 8 + constants/success.constant.js | 2 + controllers/hacker.controller.js | 8 + docs/api/api_data.js | 134 ++++----- docs/api/api_data.json | 137 ++++----- docs/api/api_project.js | 30 +- docs/api/api_project.json | 30 +- middlewares/hacker.middleware.js | 26 +- routes/api/hacker.js | 31 ++- scripts/batch_update.py | 118 ++++++-- services/email.service.js | 29 +- tests/hacker.test.js | 54 ++++ tests/util/hacker.test.util.js | 2 +- 14 files changed, 853 insertions(+), 220 deletions(-) create mode 100644 assets/email/Welcome.hbs diff --git a/assets/email/Welcome.hbs b/assets/email/Welcome.hbs new file mode 100644 index 00000000..ae69d24d --- /dev/null +++ b/assets/email/Welcome.hbs @@ -0,0 +1,464 @@ + + + + + + + McHacks 6: Important Information + + + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + +
+ Logo +
+ +
+ + + + + +
+

+ Welcome to McHacks 6! +

+

+ Hi {{firstName}}! +

+ McHacks 6 is finally here, and we're excited to spend an epic + weekend with you hacking away! 🎉 +

+ Before we get to that, let's go through some important information to + get you ready for the hackathon: +
+

Communication

+ Join our Facebook + group for announcements, to RSVP for workshops/activities, chat + with other hackers, and form teams! +

+ During the hackathon, we'll be using both the FB group and the official + McHacks + 6 Slack. Be sure to join the Slack so you're updated on + everything going on as they happen! +

+ We'll also have a live site with the schedule, announcements, and + everything else you need to know at mchacks.ca + closer to the event +

+

Hacking + Policy

+ All projects built at our hackathon can be made by teams of 1-4 people. + If you're looking to find like-minded participants to work with, you + can post in our Facebook + group or in #team-formation on Slack. +

+ In the interest of fairness, participants aren't allowed to work on + pre-existing projects or begin their projects before hacking at McHacks + begins. Any attempts of dishonesty or cheating will result in + disqualification. +

+ That being said, you're more than welcome to familiarize yourself with + all the tech and tools you intend to build with beforehand! You can + check our Devpost + which will be updated soon with our available prizes to inspire ideas + for your project! 🎁 +

+

That's + all for now, folks!

+ Follow us on Facebook, + Twitter, + and Instagram + for important updates and news about McHacks 6! If you have any + questions, feel free to reach out at contact@mchacks.ca. +

+

+
+ McHacks Team +
+ mchacks.ca +

+ +
+ +
+ + + +
+ +
+
+ + + \ No newline at end of file diff --git a/constants/routes.constant.js b/constants/routes.constant.js index d7b4f799..161e4c00 100644 --- a/constants/routes.constant.js +++ b/constants/routes.constant.js @@ -132,6 +132,14 @@ const hackerRoutes = { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.SELF, }, + "postAnySendDayOfEmail": { + requestType: Constants.REQUEST_TYPES.POST, + uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.ALL, + }, + "postSelfSendDayOfEmail": { + requestType: Constants.REQUEST_TYPES.POST, + uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.SELF, + }, }; const sponsorRoutes = { diff --git a/constants/success.constant.js b/constants/success.constant.js index acebf1d8..9204650c 100644 --- a/constants/success.constant.js +++ b/constants/success.constant.js @@ -22,6 +22,7 @@ const HACKER_READ = "Hacker retrieval successful."; const HACKER_CREATE = "Hacker creation successful."; const HACKER_UPDATE = "Hacker update successful."; const HACKER_SENT_WEEK_OF = "Hacker week-of email sent." +const HACKER_SENT_DAY_OF = "Hacker day-of email sent." const RESUME_UPLOAD = "Resume upload successful."; const RESUME_DOWNLOAD = "Resume download successful."; @@ -69,6 +70,7 @@ module.exports = { HACKER_UPDATE: HACKER_UPDATE, HACKER_SENT_WEEK_OF: HACKER_SENT_WEEK_OF, + HACKER_SENT_DAY_OF: HACKER_SENT_DAY_OF, RESUME_UPLOAD: RESUME_UPLOAD, RESUME_DOWNLOAD: RESUME_DOWNLOAD, diff --git a/controllers/hacker.controller.js b/controllers/hacker.controller.js index daf49bf1..fb2182c6 100644 --- a/controllers/hacker.controller.js +++ b/controllers/hacker.controller.js @@ -86,6 +86,13 @@ function sentWeekOfEmail(req, res) { }); } +function sentDayOfEmail(req, res) { + return res.status(200).json({ + message: Constants.Success.HACKER_SENT_DAY_OF, + data: {} + }); +} + module.exports = { updatedHacker: updatedHacker, createdHacker: createdHacker, @@ -94,4 +101,5 @@ module.exports = { showHacker: showHacker, gotStats: gotStats, sentWeekOfEmail: sentWeekOfEmail, + sentDayOfEmail: sentDayOfEmail }; \ No newline at end of file diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 932e9940..78aec409 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1255,78 +1255,6 @@ define({ "url": "https://api.mchacks.ca/api/hacker/" }] }, - { - "type": "get", - "url": "/hacker/:id", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] - }, { "type": "get", "url": "/hacker/email/:email", @@ -1401,7 +1329,7 @@ define({ }, { "type": "get", - "url": "/hacker/email/:email", + "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1412,8 +1340,8 @@ define({ "group": "param", "type": "String", "optional": false, - "field": "email", - "description": "

a hacker's unique email

" + "field": "id", + "description": "

a hacker's unique mongoID

" }] } }, @@ -1468,7 +1396,7 @@ define({ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" + "url": "https://api.mchacks.ca/api/hacker/:id" }] }, { @@ -1921,6 +1849,58 @@ define({ "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" }] }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "Administrator" + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + }] + }, { "type": "get", "url": "/sponsor/self", @@ -2407,7 +2387,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {...}\n }", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", "type": "object" }] }, diff --git a/docs/api/api_data.json b/docs/api/api_data.json index 9406fb6b..75ac6685 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1254,78 +1254,6 @@ "url": "https://api.mchacks.ca/api/hacker/" }] }, - { - "type": "get", - "url": "/hacker/:id", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] - }, { "type": "get", "url": "/hacker/email/:email", @@ -1400,7 +1328,7 @@ }, { "type": "get", - "url": "/hacker/email/:email", + "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1411,8 +1339,8 @@ "group": "param", "type": "String", "optional": false, - "field": "email", - "description": "

a hacker's unique email

" + "field": "id", + "description": "

a hacker's unique mongoID

" }] } }, @@ -1467,7 +1395,7 @@ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" + "url": "https://api.mchacks.ca/api/hacker/:id" }] }, { @@ -1920,6 +1848,58 @@ "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" }] }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "Administrator" + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + }] + }, { "type": "get", "url": "/sponsor/self", @@ -1947,7 +1927,8 @@ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }" + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" }] }, "error": { @@ -2405,7 +2386,7 @@ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {...}\n }", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", "type": "object" }] }, diff --git a/docs/api/api_project.js b/docs/api/api_project.js index 8730e140..a30d316c 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -1,16 +1,16 @@ -define({ - "name": "hackerAPI", - "version": "0.0.8", - "description": "Documentation for the API used for mchacks", - "defaultVersion": "0.0.8", - "title": "hackerAPI documentation", - "url": "https://api.mchacks.ca/api", - "sampleUrl": "https://api.mchacks.ca/api", - "apidoc": "0.3.0", - "generator": { - "name": "apidoc", - "time": "2019-01-23T23:37:14.991Z", - "url": "http://apidocjs.com", - "version": "0.17.7" - } +define({ + "name": "hackerAPI", + "version": "0.0.8", + "description": "Documentation for the API used for mchacks", + "defaultVersion": "0.0.8", + "title": "hackerAPI documentation", + "url": "https://api.mchacks.ca/api", + "sampleUrl": "https://api.mchacks.ca/api", + "apidoc": "0.3.0", + "generator": { + "name": "apidoc", + "time": "2019-02-02T19:22:47.311Z", + "url": "http://apidocjs.com", + "version": "0.17.7" + } }); \ No newline at end of file diff --git a/docs/api/api_project.json b/docs/api/api_project.json index 75fa20a2..149ba493 100644 --- a/docs/api/api_project.json +++ b/docs/api/api_project.json @@ -1,16 +1,16 @@ -{ - "name": "hackerAPI", - "version": "0.0.8", - "description": "Documentation for the API used for mchacks", - "defaultVersion": "0.0.8", - "title": "hackerAPI documentation", - "url": "https://api.mchacks.ca/api", - "sampleUrl": "https://api.mchacks.ca/api", - "apidoc": "0.3.0", - "generator": { - "name": "apidoc", - "time": "2019-01-23T23:37:14.991Z", - "url": "http://apidocjs.com", - "version": "0.17.7" - } +{ + "name": "hackerAPI", + "version": "0.0.8", + "description": "Documentation for the API used for mchacks", + "defaultVersion": "0.0.8", + "title": "hackerAPI documentation", + "url": "https://api.mchacks.ca/api", + "sampleUrl": "https://api.mchacks.ca/api", + "apidoc": "0.3.0", + "generator": { + "name": "apidoc", + "time": "2019-02-02T19:22:47.311Z", + "url": "http://apidocjs.com", + "version": "0.17.7" + } } \ No newline at end of file diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index c061fa03..d1ab0c77 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -315,7 +315,7 @@ async function sendAppliedStatusEmail(req, res, next) { * @param {*} res * @param {(err?:*)=>void} next */ -async function sendTicketEmail(req, res, next) { +async function sendWeekOfEmail(req, res, next) { const hacker = req.body.hacker; const address = Services.Env.isProduction() ? process.env.FRONTEND_ADDRESS_DEPLOY : process.env.FRONTEND_ADDRESS_DEV; const httpOrHttps = (address.includes("localhost")) ? "http" : "https"; @@ -329,7 +329,26 @@ async function sendTicketEmail(req, res, next) { error: {} }); } - Services.Email.sendTicketEmail(account.firstName, account.email, ticketSVG, next); + Services.Email.sendWeekOfEmail(account.firstName, account.email, ticketSVG, next); +} + +/** + * Sends an email telling the user that they have applied. This is used exclusively when we POST a hacker. + * @param {{body: {hacker: {accountId: string}}}} req + * @param {*} res + * @param {(err?:*)=>void} next + */ +async function sendDayOfEmail(req, res, next) { + const hacker = req.body.hacker; + const account = await Services.Account.findById(hacker.accountId); + if (!account) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE, + error: {} + }); + } + Services.Email.sendDayOfEmail(account.firstName, account.email, next); } /** @@ -544,7 +563,8 @@ module.exports = { ensureAccountLinkedToHacker: ensureAccountLinkedToHacker, uploadResume: Middleware.Util.asyncMiddleware(uploadResume), downloadResume: Middleware.Util.asyncMiddleware(downloadResume), - sendTicketEmail: Middleware.Util.asyncMiddleware(sendTicketEmail), + sendWeekOfEmail: Middleware.Util.asyncMiddleware(sendWeekOfEmail), + sendDayOfEmail: Middleware.Util.asyncMiddleware(sendDayOfEmail), sendStatusUpdateEmail: Middleware.Util.asyncMiddleware(sendStatusUpdateEmail), sendAppliedStatusEmail: Middleware.Util.asyncMiddleware(sendAppliedStatusEmail), updateHacker: Middleware.Util.asyncMiddleware(updateHacker), diff --git a/routes/api/hacker.js b/routes/api/hacker.js index e714e0eb..250a2c51 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -611,10 +611,39 @@ module.exports = { Middleware.parseBody.middleware, Middleware.Hacker.findById, Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CHECKED_IN]), - Middleware.Hacker.sendTicketEmail, + Middleware.Hacker.sendWeekOfEmail, Controllers.Hacker.sentWeekOfEmail ) + /** + * @api {post} /hacker/email/weekOf/:id + * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. + * @apiName postHackerSendWeekOfEmail + * @apiGroup Hacker + * @apiVersion 0.0.9 + * + * @apiParam (param) {string} [status] The hacker ID + * @apiSuccess {string} message Success message + * @apiSuccess {object} data empty + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Hacker week-of email sent.", + * "data": {} + * } + * @apiPermission Administrator + */ + hackerRouter.route("/email/dayOf/:id").post( + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + + Middleware.Validator.RouteParam.idValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.findById, + Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CHECKED_IN]), + Middleware.Hacker.sendDayOfEmail, + Controllers.Hacker.sentDayOfEmail + ); + apiRouter.use("/hacker", hackerRouter); } }; \ No newline at end of file diff --git a/scripts/batch_update.py b/scripts/batch_update.py index c6586cce..19893420 100644 --- a/scripts/batch_update.py +++ b/scripts/batch_update.py @@ -1,3 +1,5 @@ +#!/bin/bash/python3 + import requests import json import getpass @@ -29,46 +31,106 @@ if r.status_code != 200: print("Incorrect password, please try again.") else: - print('Logged in as ', username) + print('Logged in as {0}'.format(username)) logged_in = True # Get information about batch actions ACCEPT_ID_FILE = input("Path to file with hackerIDs:") -VALID_ACTIONS = ['Applied', 'Accepted', 'Waitlisted', - 'Confirmed', 'Cancelled', 'Checked-in'] - -INITIAL_STATUS = input( - "Inital status required " + str(VALID_ACTIONS) + ":") - -NEW_STATUS = input( - "Status to update to " + str(VALID_ACTIONS) + ":") - - hackerIds = [] with open(ACCEPT_ID_FILE, 'r') as f: rows = f.readlines() for r in rows: hackerIds.append(r.strip()) - # remove duplicates hackerIds = list(set(hackerIds)) -for index, ID in enumerate(hackerIds): - # so that we aren't 0-based index - index = index + 1 - r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) - if r1.status_code != 200: - print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) - else: - hackerInfo = json.loads(r1.content) - if hackerInfo['data']['status'] == INITIAL_STATUS: - r2 = s.patch('{0}/api/hacker/status/{1}'.format(API_URL, ID), - {"status": NEW_STATUS}) - if r2.status_code != 200: - print( - '({0}/{1}) ERROR cannot update status for {2}'.format(index, len(hackerIds), ID)) +VALID_STATUSES = ['Applied', 'Accepted', 'Waitlisted', + 'Confirmed', 'Cancelled', 'Checked-in'] + +INITIAL_STATUS = input( + "Inital status required " + str(VALID_STATUSES) + ":") + +BATCH_ACTIONS = ['status', 'dayOf', 'weekOf'] + +BATCH_ACTION = input( + "Batch Action desired " + str(BATCH_ACTIONS) + ":") + + +def updateStatus(): + + NEW_STATUS = input( + "Status to update to " + str(VALID_STATUSES) + ":") + + for index, ID in enumerate(hackerIds): + # so that we aren't 0-based index + index = index + 1 + r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) + if r1.status_code != 200: + print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) + else: + hackerInfo = json.loads(r1.content) + if hackerInfo['data']['status'] == INITIAL_STATUS: + r2 = s.patch('{0}/api/hacker/status/{1}'.format(API_URL, ID), + {"status": NEW_STATUS}) + if r2.status_code != 200: + print( + '({0}/{1}) ERROR cannot update status for {2}'.format(index, len(hackerIds), ID)) + else: + print( + '({0}/{1}) {2} {3}'.format(index, len(hackerIds), NEW_STATUS, ID)) + + +def sendDayOfEmail(): + for index, ID in enumerate(hackerIds): + # so that we aren't 0-based index + index = index + 1 + r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) + if r1.status_code != 200: + print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) + else: + hackerInfo = json.loads(r1.content) + if hackerInfo['data']['status'] == INITIAL_STATUS: + r2 = s.post( + '{0}/api/hacker/email/dayOf/{1}'.format(API_URL, ID)) + if r2.status_code != 200: + print( + '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(hackerIds), ID)) + else: + print( + '({0}/{1}) Sent email to {2}'.format(index, len(hackerIds), ID)) else: - print( - '({0}/{1}) {2} {3}'.format(index, len(hackerIds), NEW_STATUS, ID)) + print('({0}/{1}) {2} does not have status {3} (status: {4})'.format(index, + len(hackerIds), ID, INITIAL_STATUS, hackerInfo['data']['status'])) + + +def sendWeekOfEmail(): + for index, ID in enumerate(hackerIds): + # so that we aren't 0-based index + index = index + 1 + r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) + if r1.status_code != 200: + print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) + else: + hackerInfo = json.loads(r1.content) + if hackerInfo['data']['status'] == INITIAL_STATUS: + r2 = s.post( + '{0}/api/hacker/email/weekOf/{1}'.format(API_URL, ID)) + if r2.status_code != 200: + print( + '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(hackerIds), ID)) + else: + print( + '({0}/{1}) Sent email to {2}'.format(index, len(hackerIds), ID)) + else: + print('({0}/{1}) {2} does not have status {3} (status: {4})'.format(index, + len(hackerIds), ID, INITIAL_STATUS, hackerInfo['data']['status'])) + + +if BATCH_ACTION == 'weekOf': + sendWeekOfEmail() +elif BATCH_ACTION == 'dayOf': + sendDayOfEmail() +elif BATCH_ACTION == 'status': + updateStatus() diff --git a/services/email.service.js b/services/email.service.js index ccde0da8..bd6492df 100644 --- a/services/email.service.js +++ b/services/email.service.js @@ -58,7 +58,7 @@ class EmailService { * @param {string} ticket the ticket image (must be base-64 string) * @param {(err?)=>void} callback */ - sendTicketEmail(firstName, recipient, ticket, callback) { + sendWeekOfEmail(firstName, recipient, ticket, callback) { const handlebarsPath = path.join(__dirname, `../assets/email/Ticket.hbs`); const html = this.renderEmail(handlebarsPath, { firstName: firstName, @@ -78,7 +78,32 @@ class EmailService { callback(response[0]); } }, callback); - + } + /** + * Send email with ticket. + * @param {string} firstName the recipient's first name + * @param {string} recipient the recipient's email address + * @param {(err?)=>void} callback + */ + sendDayOfEmail(firstName, recipient, callback) { + const handlebarsPath = path.join(__dirname, `../assets/email/Welcome.hbs`); + const html = this.renderEmail(handlebarsPath, { + firstName: firstName, + }); + const mailData = { + to: recipient, + from: process.env.NO_REPLY_EMAIL, + subject: Constants.EMAIL_SUBJECTS[Constants.WEEK_OF], + html: html + }; + this.send(mailData).then( + (response) => { + if (response[0].statusCode >= 200 && response[0].statusCode < 300) { + callback(); + } else { + callback(response[0]); + } + }, callback); } sendStatusUpdate(firstName, recipient, status, callback) { diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 76948a78..2953af27 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -36,7 +36,9 @@ const noTeamHackerAccount0 = util.account.hackerAccounts.stored.noTeam[0]; const noTeamHacker0 = util.hacker.NoTeamHacker0; const teamHackerAccount0 = util.account.hackerAccounts.stored.team[0]; +const teamHackerAccount1 = util.account.hackerAccounts.stored.team[1]; const TeamHacker0 = util.hacker.TeamHacker0; +const TeamHacker1 = util.hacker.TeamHacker1; const duplicateAccountLinkHacker0 = util.hacker.duplicateAccountLinkHacker0; const invalidHacker1 = util.hacker.invalidHacker1; @@ -962,4 +964,56 @@ describe("POST send week-of email", function () { }); }); }); +}); + +describe("POST send day-of email", function () { + it("It should FAIL to send the day-of email due to invalid Authentication", function (done) { + //this takes a lot of time for some reason + chai.request(server.app) + .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) + .end(function (err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + it("It should FAIL to send the day-of email due to invalid Authorization", function (done) { + //this takes a lot of time for some reason + util.auth.login(agent, teamHackerAccount1, (error) => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); + it("It should SUCCEED to send the day-of email", function (done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, (error) => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) + .end(function (err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_SENT_DAY_OF); + res.body.should.have.property("data"); + done(); + }); + }); + }); }); \ No newline at end of file diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index 598a8e69..a23e62bf 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -41,7 +41,7 @@ const TeamHacker0 = { const TeamHacker1 = { "_id": Constants.MongoId.hackerDId, "accountId": Util.Account.hackerAccounts.stored.team[1]._id, - "status": "Waitlisted", + "status": "Checked-in", "school": "University of Blah1", "degree": "Masters", "gender": "Female", From 6d9067e3d97c13e9d577c5a8753de1aee4a4272d Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 4 Feb 2019 18:22:20 -0500 Subject: [PATCH 002/243] Update batch scripts, clean up scripts (#334) --- scripts/batch_scripts.py | 279 +++++++++++++++++++++++++++++++++++++++ scripts/batch_update.py | 136 ------------------- 2 files changed, 279 insertions(+), 136 deletions(-) create mode 100644 scripts/batch_scripts.py delete mode 100644 scripts/batch_update.py diff --git a/scripts/batch_scripts.py b/scripts/batch_scripts.py new file mode 100644 index 00000000..d7b0fc6b --- /dev/null +++ b/scripts/batch_scripts.py @@ -0,0 +1,279 @@ +#!/bin/bash/python3 +import base64 +from bson import ObjectId +import getpass +import json +import os +import requests +import subprocess +from typing import Any, Callable, List + +# Constants +VALID_STATUSES = { + '1': 'Applied', + '2': 'Accepted', + '3': 'Waitlisted', + '4': 'Confirmed', + '5': 'Cancelled', + '6': 'Checked-in' +} +BATCH_ACTIONS = { + '1': 'updateStatus', + '2': 'dayOf', + '3': 'weekOf', + '4': 'downloadResume' +} + + +API_URL = 'https://api.mchacks.ca' + + +s = requests.Session() + + +def requestUntilSuccess( + string: str, + invalid_msg: str = 'Invalid input', + validInput: Callable[[Any], bool] = lambda x: True, + transformInput: Callable[[str], Any] = lambda x: x +) -> str: + """ + Requests user input until validInput predicate is satisfied. + Returns the output of transformInput. + """ + user_input = None + while not validInput(user_input): + print('=====================================') + user_input = input(string) + if not validInput(user_input): + print(invalid_msg) + return transformInput(user_input) + + +def login(session=requests.Session()): + """ + Logs in a user to the inputted session, and returns the session. + """ + global API_URL + print("Enter target API") + user_input = input('Target API (Default {0}): '.format(API_URL)) + if user_input != '': + API_URL = user_input + # Get credentials + print("Enter credentials for", API_URL) + username = input("Email: ") + logged_in = False + + while not logged_in: + password = getpass.getpass("Password: ") + credentials = { + 'email': username, + 'password': password + } + r = session.post('{0}/api/auth/login'.format(API_URL), credentials) + if r.status_code != 200: + print("Incorrect password, please try again.") + else: + print('Logged in as {0}'.format(username)) + logged_in = True + return session + + +def loadIDs() -> List[str]: + """ + Load the list of IDs provided by user inputted file path. + """ + # Get information about batch actions + id_file = requestUntilSuccess( + 'Path to file to MongoIDs: ', + 'Invalid file', + lambda x: x is not None and os.path.isfile(x) and os.access(x, os.R_OK) + ) + + ids = [] + with open(id_file, 'r') as f: + rows = f.readlines() + for index, r in enumerate(rows): + index = index + 1 + r = r.strip() + if ObjectId.is_valid(r): + ids.append(r) + else: + print( + '({0}/{1}) Error: {2} is not a valid ObjectID'.format(index, len(rows), r)) + # remove duplicates + ids = list(set(ids)) + return ids + + +def getDownloadDirectory() -> str: + directory = requestUntilSuccess( + 'Directory to download files to: ', + 'Invalid directory', + lambda x: x is not None and os.path.isdir(x) and os.access(x, os.W_OK) + ) + directory.rstrip('/') + return directory + + +def status(prefixStr) -> str: + status_list = ['{0}: {1}\n'.format(k, v) + for k, v in VALID_STATUSES.items()] + initial_status = requestUntilSuccess( + 'Input {0} status:\n{1}'.format(prefixStr, ''.join(status_list)), + 'Invalid {0} status'.format(prefixStr), + lambda x: x in VALID_STATUSES.keys(), + lambda x: VALID_STATUSES[x] + ) + return initial_status + + +def batchAction() -> str: + status_list = ['{0}: {1}\n'.format(k, v) for k, v in BATCH_ACTIONS.items()] + batch_action = requestUntilSuccess( + 'Batch Action desired:\n{0}'.format(''.join(status_list)), + 'Invalid batch action', + lambda x: x in BATCH_ACTIONS.keys(), + lambda x: BATCH_ACTIONS[x] + ) + return batch_action + + +def getHacker(ID): + r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) + if r1.status_code != 200: + return None + else: + hackerInfo = json.loads(r1.content)['data'] + return hackerInfo + + +def hasValidStatus(status, hackerInfo): + if hackerInfo is not None and hackerInfo['status'] == status: + return True + else: + return False + + +def updateStatus(): + INITIAL_STATUS = status('initial') + NEW_STATUS = status('new') + HACKER_IDs = loadIDs() + for index, ID in enumerate(HACKER_IDs): + # so that we aren't 0-based index + index = index + 1 + hacker = getHacker(ID) + validStatus = hasValidStatus(INITIAL_STATUS, hacker) + if validStatus: + r = s.patch('{0}/api/hacker/status/{1}'.format(API_URL, ID), + {"status": NEW_STATUS}) + if r.status_code != 200: + print( + '({0}/{1}) ERROR cannot update status for {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) {2} {3}'.format(index, len(HACKER_IDs), NEW_STATUS, ID)) + elif hacker is not None: + print( + '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + + +def sendDayOfEmail(): + INITIAL_STATUS = status('initial') + HACKER_IDs = loadIDs() + for index, ID in enumerate(HACKER_IDs): + # so that we aren't 0-based index + index = index + 1 + hacker = getHacker(ID) + validStatus = hasValidStatus(INITIAL_STATUS, hacker) + if validStatus: + r = s.post( + '{0}/api/hacker/email/dayOf/{1}'.format(API_URL, ID)) + if r.status_code != 200: + print( + '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) Sent email to {2}'.format(index, len(HACKER_IDs), ID)) + elif hacker is not None: + print( + '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + + +def sendWeekOfEmail(): + INITIAL_STATUS = status('initial') + HACKER_IDs = loadIDs() + for index, ID in enumerate(HACKER_IDs): + # so that we aren't 0-based index + index = index + 1 + hacker = getHacker(ID) + validStatus = hasValidStatus(INITIAL_STATUS, hacker) + if validStatus: + r = s.post( + '{0}/api/hacker/email/weekOf/{1}'.format(API_URL, ID)) + if r.status_code != 200: + print( + '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) Sent email to {2}'.format(index, len(HACKER_IDs), ID)) + elif hacker is not None: + print( + '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + + +def downloadResume(): + INITIAL_STATUS = status('initial') + HACKER_IDs = loadIDs() + DOWNLOAD_DIR = getDownloadDirectory() + + for index, ID in enumerate(HACKER_IDs): + # so that we aren't 0-based index + index = index + 1 + hacker = getHacker(ID) + validStatus = hasValidStatus(INITIAL_STATUS, hacker) + if validStatus: + r = s.get( + '{0}/api/hacker/resume/{1}'.format(API_URL, ID)) + if r.status_code != 200: + print( + '({0}/{1}) ERROR {2} does not have a resume (Status code {3})'.format(index, len(HACKER_IDs), ID, r.status_code)) + else: + resume = json.loads(r.content)['data']['resume'][0]['data'] + download_path = "{0}/{1}.pdf".format(DOWNLOAD_DIR, ID) + with open(download_path, "wb") as fh: + byte_data = bytearray(resume) + fh.write(byte_data) + print( + '({0}/{1}) Downloaded resume from {2} to {3}'.format(index, len(HACKER_IDs), ID, download_path)) + elif hacker is not None: + print( + '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + else: + print( + '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + + +if __name__ == "__main__": + # execute only if run as a script + login(s) + while True: + BATCH_ACTION = batchAction() + if BATCH_ACTION == 'weekOf': + sendWeekOfEmail() + elif BATCH_ACTION == 'dayOf': + sendDayOfEmail() + elif BATCH_ACTION == 'updateStatus': + updateStatus() + elif BATCH_ACTION == 'downloadResume': + downloadResume() + print('Finished {0}'.format(BATCH_ACTION)) diff --git a/scripts/batch_update.py b/scripts/batch_update.py deleted file mode 100644 index 19893420..00000000 --- a/scripts/batch_update.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash/python3 - -import requests -import json -import getpass - -print("Enter target API") -DEFAULT_API = 'https://api.mchacks.ca' - -API_URL = input('Target API (Default '+DEFAULT_API+'):') - -if API_URL == '': - API_URL = DEFAULT_API - -# Get credentials -print("Enter credentials for", API_URL) -username = input("Email: ") - -s = requests.Session() - -logged_in = False - -while not logged_in: - password = getpass.getpass("Password: ") - CREDENTIALS = { - 'email': username, - 'password': password - } - r = s.post('{0}/api/auth/login'.format(API_URL), CREDENTIALS) - - if r.status_code != 200: - print("Incorrect password, please try again.") - else: - print('Logged in as {0}'.format(username)) - logged_in = True - -# Get information about batch actions - -ACCEPT_ID_FILE = input("Path to file with hackerIDs:") - -hackerIds = [] -with open(ACCEPT_ID_FILE, 'r') as f: - rows = f.readlines() - for r in rows: - hackerIds.append(r.strip()) -# remove duplicates -hackerIds = list(set(hackerIds)) - -VALID_STATUSES = ['Applied', 'Accepted', 'Waitlisted', - 'Confirmed', 'Cancelled', 'Checked-in'] - -INITIAL_STATUS = input( - "Inital status required " + str(VALID_STATUSES) + ":") - -BATCH_ACTIONS = ['status', 'dayOf', 'weekOf'] - -BATCH_ACTION = input( - "Batch Action desired " + str(BATCH_ACTIONS) + ":") - - -def updateStatus(): - - NEW_STATUS = input( - "Status to update to " + str(VALID_STATUSES) + ":") - - for index, ID in enumerate(hackerIds): - # so that we aren't 0-based index - index = index + 1 - r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) - if r1.status_code != 200: - print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) - else: - hackerInfo = json.loads(r1.content) - if hackerInfo['data']['status'] == INITIAL_STATUS: - r2 = s.patch('{0}/api/hacker/status/{1}'.format(API_URL, ID), - {"status": NEW_STATUS}) - if r2.status_code != 200: - print( - '({0}/{1}) ERROR cannot update status for {2}'.format(index, len(hackerIds), ID)) - else: - print( - '({0}/{1}) {2} {3}'.format(index, len(hackerIds), NEW_STATUS, ID)) - - -def sendDayOfEmail(): - for index, ID in enumerate(hackerIds): - # so that we aren't 0-based index - index = index + 1 - r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) - if r1.status_code != 200: - print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) - else: - hackerInfo = json.loads(r1.content) - if hackerInfo['data']['status'] == INITIAL_STATUS: - r2 = s.post( - '{0}/api/hacker/email/dayOf/{1}'.format(API_URL, ID)) - if r2.status_code != 200: - print( - '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(hackerIds), ID)) - else: - print( - '({0}/{1}) Sent email to {2}'.format(index, len(hackerIds), ID)) - else: - print('({0}/{1}) {2} does not have status {3} (status: {4})'.format(index, - len(hackerIds), ID, INITIAL_STATUS, hackerInfo['data']['status'])) - - -def sendWeekOfEmail(): - for index, ID in enumerate(hackerIds): - # so that we aren't 0-based index - index = index + 1 - r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) - if r1.status_code != 200: - print('({0}/{1}) ERROR cannot get {2}'.format(index, len(hackerIds), ID)) - else: - hackerInfo = json.loads(r1.content) - if hackerInfo['data']['status'] == INITIAL_STATUS: - r2 = s.post( - '{0}/api/hacker/email/weekOf/{1}'.format(API_URL, ID)) - if r2.status_code != 200: - print( - '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(hackerIds), ID)) - else: - print( - '({0}/{1}) Sent email to {2}'.format(index, len(hackerIds), ID)) - else: - print('({0}/{1}) {2} does not have status {3} (status: {4})'.format(index, - len(hackerIds), ID, INITIAL_STATUS, hackerInfo['data']['status'])) - - -if BATCH_ACTION == 'weekOf': - sendWeekOfEmail() -elif BATCH_ACTION == 'dayOf': - sendDayOfEmail() -elif BATCH_ACTION == 'status': - updateStatus() From c82ed9f73b39f410752d948e60ed7c0f163c9cff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 5 Feb 2019 03:29:11 +0000 Subject: [PATCH 003/243] Bump jshint from 2.9.7 to 2.10.0 Bumps [jshint](https://github.com/jshint/jshint) from 2.9.7 to 2.10.0. - [Release notes](https://github.com/jshint/jshint/releases) - [Changelog](https://github.com/jshint/jshint/blob/master/CHANGELOG.md) - [Commits](https://github.com/jshint/jshint/compare/2.9.7...2.10.0) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66d8ece1..96bee8f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5070,9 +5070,9 @@ "optional": true }, "jshint": { - "version": "2.9.7", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.7.tgz", - "integrity": "sha512-Q8XN38hGsVQhdlM+4gd1Xl7OB1VieSuCJf+fEJjpo59JH99bVJhXRXAh26qQ15wfdd1VPMuDWNeSWoNl53T4YA==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.0.tgz", + "integrity": "sha512-M6P/Y9vlgZmdzran8aw060P+Dkjgy3bwIMiHPTzJ01k/X376No55s/rJaeQCIzivhO+sJhV6zud/ZwA7u4N2cg==", "dev": true, "requires": { "cli": "~1.0.0", diff --git a/package.json b/package.json index 4332f177..3678bce1 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "apidoc": "^0.17.7", "chai-http": "^4.2.1", "chai": "^4.2.0", - "jshint": "^2.9.7", + "jshint": "^2.10.0", "jslint": "^0.12.1", "mocha": "^5.2.0", "nodemon": "^1.17.3" From e5688b1df5cb1b0d1c18314c26bd8dc1ee39be8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 5 Feb 2019 18:29:23 +0000 Subject: [PATCH 004/243] Bump jshint from 2.10.0 to 2.10.1 Bumps [jshint](https://github.com/jshint/jshint) from 2.10.0 to 2.10.1. - [Release notes](https://github.com/jshint/jshint/releases) - [Changelog](https://github.com/jshint/jshint/blob/master/CHANGELOG.md) - [Commits](https://github.com/jshint/jshint/compare/2.10.0...2.10.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 96bee8f1..e3a10f1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5070,9 +5070,9 @@ "optional": true }, "jshint": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.0.tgz", - "integrity": "sha512-M6P/Y9vlgZmdzran8aw060P+Dkjgy3bwIMiHPTzJ01k/X376No55s/rJaeQCIzivhO+sJhV6zud/ZwA7u4N2cg==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.1.tgz", + "integrity": "sha512-9GpPfKeffYBl7oBDX2lHPG16j0AM7D2bn3aLy9DaWTr6CWa0i/7UGhX8WLZ7V14QQnnr4hXbjauTLYg06F+HYw==", "dev": true, "requires": { "cli": "~1.0.0", diff --git a/package.json b/package.json index 3678bce1..33a33ddf 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "apidoc": "^0.17.7", "chai-http": "^4.2.1", "chai": "^4.2.0", - "jshint": "^2.10.0", + "jshint": "^2.10.1", "jslint": "^0.12.1", "mocha": "^5.2.0", "nodemon": "^1.17.3" From 53fd90c539c55333f287a80228a6a5cc790a3ae0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 00:40:18 +0000 Subject: [PATCH 005/243] Bump mongoose from 5.4.9 to 5.4.10 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.9 to 5.4.10. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.9...5.4.10) Signed-off-by: dependabot[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3a10f1c..349a1aec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5729,11 +5729,11 @@ "integrity": "sha512-9DITV2YEMcw7XojdfvGl3gDD8J9QjZTJ7ZOUuSAkP+F3T6rDbzMJuPktxptsdHYEvZcmXrCD3LMOhdSAEq6zKA==" }, "mongodb": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.10.tgz", - "integrity": "sha512-Uml42GeFxhTGQVml1XQ4cD0o/rp7J2ROy0fdYUcVitoE7vFqEhKH4TYVqRDpQr/bXtCJVxJdNQC1ntRxNREkPQ==", + "version": "3.1.13", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz", + "integrity": "sha512-sz2dhvBZQWf3LRNDhbd30KHVzdjZx9IKC0L+kSZ/gzYquCF5zPOgGqRz6sSCqYZtKP2ekB4nfLxhGtzGHnIKxA==", "requires": { - "mongodb-core": "3.1.9", + "mongodb-core": "3.1.11", "safe-buffer": "^5.1.2" }, "dependencies": { @@ -5745,9 +5745,9 @@ } }, "mongodb-core": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.9.tgz", - "integrity": "sha512-MJpciDABXMchrZphh3vMcqu8hkNf/Mi+Gk6btOimVg1XMxLXh87j6FAvRm+KmwD1A9fpu3qRQYcbQe4egj23og==", + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.11.tgz", + "integrity": "sha512-rD2US2s5qk/ckbiiGFHeu+yKYDXdJ1G87F6CG3YdaZpzdOm5zpoAZd/EKbPmFO6cQZ+XVXBXBJ660sSI0gc6qg==", "requires": { "bson": "^1.1.0", "require_optional": "^1.0.1", @@ -5763,15 +5763,15 @@ } }, "mongoose": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.9.tgz", - "integrity": "sha512-4dSQpDUe/9b7A7dRrsyJfWmoGEpeMaZ/WZ/KIJFqTHbJm3NUWaWF++hhirAgjtoHNq2ZILIII0LHEhgzP2NuRw==", + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.10.tgz", + "integrity": "sha512-yJl+A7p8QF++tyBl6fRGFON5GV57MTXLKNiaiqgX5vZs1qJpcZpPiUGU5odBiqTHFYPybuRp8dW9Qtv4K6SxBQ==", "requires": { "async": "2.6.1", "bson": "~1.1.0", "kareem": "2.3.0", - "mongodb": "3.1.10", - "mongodb-core": "3.1.9", + "mongodb": "3.1.13", + "mongodb-core": "3.1.11", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.5.1", "mquery": "3.2.0", diff --git a/package.json b/package.json index 33a33ddf..35747e1c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.0.12", "jsonwebtoken": "^8.1.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.9", + "mongoose": "^5.4.10", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 479c238d767208e40a9a07e55e83884175b33879 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 01:53:56 +0000 Subject: [PATCH 006/243] Bump @google-cloud/storage from 2.4.1 to 2.4.2 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v2.4.1...v2.4.2) Signed-off-by: dependabot[bot] --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 349a1aec..463cd1f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -160,11 +160,11 @@ "integrity": "sha512-QzB0/IMvB0eFxFK7Eqh+bfC8NLv3E9ScjWQrPOk6GgfNroxcVITdTlT8NRsRrcp5+QQJVPLkRqKG0PUdaWXmHw==" }, "@google-cloud/storage": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.4.1.tgz", - "integrity": "sha512-g9GQ/CWkB2Y1wyMnlWvj7dGbChIxfuran0O6kUtvqTKTLBpZpsvWo86xQV723JMXi/BenLkE1vy353bnRsa3Fw==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.4.2.tgz", + "integrity": "sha512-G4rlt5h2oypPYU2ZtmF3N0FpE47aRvsxp8NmZEdlScd5LgjDAu5Ha01hMOA/ZHBVsUlOGFfa+TxU5Ei/56+0Gg==", "requires": { - "@google-cloud/common": "^0.30.2", + "@google-cloud/common": "^0.31.0", "@google-cloud/paginator": "^0.1.0", "@google-cloud/promisify": "^0.3.0", "arrify": "^1.0.0", @@ -187,9 +187,9 @@ }, "dependencies": { "@google-cloud/common": { - "version": "0.30.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.30.2.tgz", - "integrity": "sha512-JLIaSpMhhUetiwS30iC2SwNP51mayuSbyhRVdagqFC6rDVcqMHHsN8QJwUhCjOoHyfQ04n9SinfMCQzJTR9Liw==", + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.31.0.tgz", + "integrity": "sha512-mO7WFavzqmr24btNb2zimUh+M3fGnIKGbkR1VT6ZG3yDV+S7BiZPmPiFHKRJVrxwi5sA9U6X6fpNpHgj7j2a2w==", "requires": { "@google-cloud/projectify": "^0.3.2", "@google-cloud/promisify": "^0.3.0", @@ -1980,9 +1980,9 @@ }, "dependencies": { "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" } } }, @@ -3632,9 +3632,9 @@ } }, "gaxios": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.2.6.tgz", - "integrity": "sha512-A7IVK12d5SavNAGTtL5aBDJ6auqWDCbyMazX+QQIklMdashrIZs4QIm1a6TpenJYy0OskCks2sMqglGt6ZThEQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.4.0.tgz", + "integrity": "sha512-qW0q08OcvFwaSmwUiELnif+q5NvAAoQfUN6iq8lx/HnmgMcJ9U+jiB+c+5C1muSBGsQ3D3PiLFpJ9jjO8BRCDg==", "requires": { "extend": "^3.0.2", "https-proxy-agent": "^2.2.1", @@ -3671,9 +3671,9 @@ }, "dependencies": { "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", + "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", diff --git a/package.json b/package.json index 35747e1c..fc6abf43 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.9.0", - "@google-cloud/storage": "^2.4.1", + "@google-cloud/storage": "^2.4.2", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.0", "cookie-parser": "~1.4.3", From 95fe9686341ebcef6147662b37ef8e978277a416 Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Wed, 6 Feb 2019 15:20:15 -0500 Subject: [PATCH 007/243] Feature/batch actions (#335) * Update batch scripts, clean up scripts * Add log verbosities * Add account invites * Add getHackers action, wrap script in try / catch * Add readline --- scripts/batch_scripts.py | 251 +++++++++++++++++++++++++++++++-------- 1 file changed, 199 insertions(+), 52 deletions(-) diff --git a/scripts/batch_scripts.py b/scripts/batch_scripts.py index d7b0fc6b..cedeef75 100644 --- a/scripts/batch_scripts.py +++ b/scripts/batch_scripts.py @@ -1,12 +1,15 @@ #!/bin/bash/python3 import base64 from bson import ObjectId +import csv import getpass import json import os +import readline import requests import subprocess from typing import Any, Callable, List +import sys # Constants VALID_STATUSES = { @@ -21,8 +24,18 @@ '1': 'updateStatus', '2': 'dayOf', '3': 'weekOf', - '4': 'downloadResume' + '4': 'downloadResume', + '5': 'inviteUsers', + '6': 'getHackers' } +LOG_VERBOSITIES = { + '0': 'None', + '1': 'Error', + '2': 'Warning', + '3': 'Info' +} + +CHOSEN_VERBOSITY = 3 API_URL = 'https://api.mchacks.ca' @@ -31,10 +44,26 @@ s = requests.Session() +def _print(msg, msgType=3, index=None, total=None): + """ + Wrapper around print function such that we only print to the granularity that the user wants. + Also, allow for formatting of sequential print statements ex: (10/114) + """ + global CHOSEN_VERBOSITY + if msgType <= CHOSEN_VERBOSITY: + out_file = sys.stdout if msgType > 1 else sys.stderr + if index is None or total is None: + print('{0}: {1}'.format( + LOG_VERBOSITIES[str(msgType)], msg), file=out_file) + else: + print('({0}/{1}) {2}: {3}'.format(index, total, + LOG_VERBOSITIES[str(msgType)], msg), file=out_file) + + def requestUntilSuccess( string: str, invalid_msg: str = 'Invalid input', - validInput: Callable[[Any], bool] = lambda x: True, + validInput: Callable[[Any], bool] = lambda x: x is not None, transformInput: Callable[[str], Any] = lambda x: x ) -> str: """ @@ -55,13 +84,13 @@ def login(session=requests.Session()): Logs in a user to the inputted session, and returns the session. """ global API_URL - print("Enter target API") - user_input = input('Target API (Default {0}): '.format(API_URL)) + user_input = requestUntilSuccess( + 'Enter Target API (Default {0}): '.format(API_URL)) if user_input != '': API_URL = user_input # Get credentials - print("Enter credentials for", API_URL) - username = input("Email: ") + username = requestUntilSuccess( + 'Enter credentials for {0}: '.format(API_URL)) logged_in = False while not logged_in: @@ -79,6 +108,50 @@ def login(session=requests.Session()): return session +def chooseLogVerbosity(): + global CHOSEN_VERBOSITY + verbosity_list = ['{0}: {1}\n'.format(k, v) + for k, v in LOG_VERBOSITIES.items()] + chosen_verbosity = requestUntilSuccess( + 'Input log verbosity (default {0}):\n{1}'.format( + CHOSEN_VERBOSITY, ''.join(verbosity_list)), + 'Invalid verbosity', + lambda x: x == '' or x in LOG_VERBOSITIES.keys(), + lambda x: CHOSEN_VERBOSITY if x == '' else int(x) + ) + CHOSEN_VERBOSITY = chosen_verbosity + + +def loadInvites() -> List[str]: + """ + Load the list of invites provided by user inputted file path. + """ + # Get information about batch actions + invite_file = requestUntilSuccess( + 'Path to Invite CSV: ', + 'Invalid file', + lambda x: x is not None and os.path.isfile(x) and os.access(x, os.R_OK) + ) + + invites = [] + with open(invite_file, 'r') as csvfile: + reader = csv.DictReader(csvfile) + index = 1 + for row in reader: + index = index + 1 + email = row['email'] + accountType = row['accountType'] + if email is not None and accountType is not None: + invites.append({ + 'email': email, + 'accountType': accountType + }) + else: + _print('{2} is not a valid invite format'.format( + row), 1, index, len(reader)) + return invites + + def loadIDs() -> List[str]: """ Load the list of IDs provided by user inputted file path. @@ -99,8 +172,8 @@ def loadIDs() -> List[str]: if ObjectId.is_valid(r): ids.append(r) else: - print( - '({0}/{1}) Error: {2} is not a valid ObjectID'.format(index, len(rows), r)) + _print('{2} is not a valid ObjectID'.format( + r), 1, index, len(rows)) # remove duplicates ids = list(set(ids)) return ids @@ -140,11 +213,11 @@ def batchAction() -> str: def getHacker(ID): - r1 = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) - if r1.status_code != 200: + r = s.get('{0}/api/hacker/{1}'.format(API_URL, ID)) + if r.status_code != 200: return None else: - hackerInfo = json.loads(r1.content)['data'] + hackerInfo = json.loads(r.content)['data'] return hackerInfo @@ -155,6 +228,20 @@ def hasValidStatus(status, hackerInfo): return False +def search(model: str = 'hacker', query=[], expand: bool = True): + q = json.dumps(query) + expand = 'true' if expand else 'false' + r = s.get( + '{0}/api/search?model={1}&q={2}&expand={3}'.format(API_URL, model, q, expand)) + if r.status_code != 200: + _print('Could not perform search (Status code {0})'.format( + r.status_code), 1) + return [] + else: + results = json.loads(r.content)['data'] + return results + + def updateStatus(): INITIAL_STATUS = status('initial') NEW_STATUS = status('new') @@ -168,17 +255,17 @@ def updateStatus(): r = s.patch('{0}/api/hacker/status/{1}'.format(API_URL, ID), {"status": NEW_STATUS}) if r.status_code != 200: - print( - '({0}/{1}) ERROR cannot update status for {2}'.format(index, len(HACKER_IDs), ID)) + _print('cannot update status for {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: - print( - '({0}/{1}) {2} {3}'.format(index, len(HACKER_IDs), NEW_STATUS, ID)) + _print('{0} {1}'.format( + NEW_STATUS, ID), 3, index, len(HACKER_IDs)) elif hacker is not None: - print( - '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + _print('invalid status for {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: - print( - '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + _print('could not find {0}'.format( + ID), 1, index, len(HACKER_IDs)) def sendDayOfEmail(): @@ -193,17 +280,17 @@ def sendDayOfEmail(): r = s.post( '{0}/api/hacker/email/dayOf/{1}'.format(API_URL, ID)) if r.status_code != 200: - print( - '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(HACKER_IDs), ID)) + _print('cannot send email to {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: - print( - '({0}/{1}) Sent email to {2}'.format(index, len(HACKER_IDs), ID)) + _print('Sent email to {0}'.format( + ID), 3, index, len(HACKER_IDs)) elif hacker is not None: - print( - '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + _print('Sent invalid status for {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: - print( - '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + _print('Could not find {0}'.format( + ID), 1, index, len(HACKER_IDs)) def sendWeekOfEmail(): @@ -218,17 +305,17 @@ def sendWeekOfEmail(): r = s.post( '{0}/api/hacker/email/weekOf/{1}'.format(API_URL, ID)) if r.status_code != 200: - print( - '({0}/{1}) ERROR cannot send email to {2}'.format(index, len(HACKER_IDs), ID)) + _print('Cannot send email to {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: - print( - '({0}/{1}) Sent email to {2}'.format(index, len(HACKER_IDs), ID)) + _print('Sent email to {0}'.format( + ID), 3, index, len(HACKER_IDs)) elif hacker is not None: - print( - '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + _print('Invalid status for {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: - print( - '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + _print('Could not find {0}'.format( + ID), 1, index, len(HACKER_IDs)) def downloadResume(): @@ -245,35 +332,95 @@ def downloadResume(): r = s.get( '{0}/api/hacker/resume/{1}'.format(API_URL, ID)) if r.status_code != 200: - print( - '({0}/{1}) ERROR {2} does not have a resume (Status code {3})'.format(index, len(HACKER_IDs), ID, r.status_code)) + _print('Could not find resume for {0}'.format( + ID), 1, index, len(HACKER_IDs)) else: resume = json.loads(r.content)['data']['resume'][0]['data'] download_path = "{0}/{1}.pdf".format(DOWNLOAD_DIR, ID) with open(download_path, "wb") as fh: byte_data = bytearray(resume) fh.write(byte_data) - print( - '({0}/{1}) Downloaded resume from {2} to {3}'.format(index, len(HACKER_IDs), ID, download_path)) + _print('Downloaded resume for {0} to {1}'.format( + ID, download_path), 3, index, len(HACKER_IDs)) elif hacker is not None: - print( - '({0}/{1}) ERROR invalid status for {2}'.format(index, len(HACKER_IDs), ID)) + _print('invalid status for {0}'.format( + ID), 3, index, len(HACKER_IDs)) + else: + _print('Could not find hacker {0}'.format( + ID), 1, index, len(HACKER_IDs)) + + +def inviteUsers(): + INVITES = loadInvites() + for index, invite in enumerate(INVITES): + index = index + 1 + r = s.post( + '{0}/api/account/invite/'.format(API_URL), invite) + if r.status_code != 200: + _print('Could not invite {0}, {1}'.format( + invite['email'], invite['accountType']), 1, index, len(INVITES)) else: - print( - '({0}/{1}) ERROR could not find {2}'.format(index, len(HACKER_IDs), ID)) + _print('Invited {0}, {1}'.format( + invite['email'], invite['accountType']), 3, index, len(INVITES)) + + +def getHackers(): + CUR_STATUS = status('current') + DOWNLOAD_DIR = getDownloadDirectory() + results = search( + 'hacker', + [{'param': 'status', 'operation': 'equals', 'value': CUR_STATUS}] + ) + with open('{0}/hackerIDs_{1}.csv'.format(DOWNLOAD_DIR, CUR_STATUS), 'w') as out_file: + fieldnames = [ + 'id', + 'First Name', + 'Last Name', + 'Email', + 'School', + 'Degree', + 'Graduation Year', + 'Job Interest', + 'Github', + 'LinkedIn' + ] + csv_writer = csv.DictWriter(out_file, fieldnames=fieldnames) + csv_writer.writeheader() + for result in results: + csv_writer.writerow({ + 'id': result['id'], + 'First Name': result['accountId']['firstName'], + 'Last Name': result['accountId']['lastName'], + 'Email': result['accountId']['email'], + 'School': result['school'], + 'Degree': result['degree'], + 'Graduation Year': result['graduationYear'], + 'Job Interest': result['application']['jobInterest'], + 'Github': result['application']['portfolioURL']['github'], + 'LinkedIn': result['application']['portfolioURL']['linkedIn'], + }) if __name__ == "__main__": # execute only if run as a script + chooseLogVerbosity() login(s) while True: BATCH_ACTION = batchAction() - if BATCH_ACTION == 'weekOf': - sendWeekOfEmail() - elif BATCH_ACTION == 'dayOf': - sendDayOfEmail() - elif BATCH_ACTION == 'updateStatus': - updateStatus() - elif BATCH_ACTION == 'downloadResume': - downloadResume() - print('Finished {0}'.format(BATCH_ACTION)) + try: + if BATCH_ACTION == 'weekOf': + sendWeekOfEmail() + elif BATCH_ACTION == 'dayOf': + sendDayOfEmail() + elif BATCH_ACTION == 'updateStatus': + updateStatus() + elif BATCH_ACTION == 'downloadResume': + downloadResume() + elif BATCH_ACTION == 'inviteUsers': + inviteUsers() + elif BATCH_ACTION == 'getHackers': + getHackers() + print('Finished {0}'.format(BATCH_ACTION)) + except Exception as e: + _print('Failed to perform action {0}: {1}'.format( + BATCH_ACTION, e), 1) From a798a1859e1ea089ac3e8f9500f0d88f9b084945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 20:16:29 +0000 Subject: [PATCH 008/243] Bump bcrypt from 3.0.0 to 3.0.4 Bumps [bcrypt](https://github.com/kelektiv/node.bcrypt.js) from 3.0.0 to 3.0.4. - [Release notes](https://github.com/kelektiv/node.bcrypt.js/releases) - [Changelog](https://github.com/kelektiv/node.bcrypt.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/kelektiv/node.bcrypt.js/compare/v3.0.0...v3.0.4) Signed-off-by: dependabot[bot] --- package-lock.json | 43 ++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 463cd1f0..801bc300 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1008,12 +1008,12 @@ "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" }, "bcrypt": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.0.tgz", - "integrity": "sha512-gjicxsD4e5U3nH0EqiEb5y+fKpsZ7F52wcnmNfu45nxnolWVAYh7NgbdfilY+5x1v6cLspxmzz4hf+ju2pFxhA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.4.tgz", + "integrity": "sha512-XqmCym97kT6l+jFEKeFvGuNE9aVEFDGsLMv+tIBTXkJI1sHS0g8s7VQEPJagSMPwWiB5Vpr2kVzVKc/YfwWthA==", "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.10.2" + "nan": "2.12.1", + "node-pre-gyp": "0.12.0" }, "dependencies": { "abbrev": { @@ -1049,7 +1049,7 @@ } }, "chownr": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true }, "code-point-at": { @@ -1129,7 +1129,7 @@ "bundled": true }, "iconv-lite": { - "version": "0.4.23", + "version": "0.4.24", "bundled": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -1181,7 +1181,7 @@ "bundled": true }, "minipass": { - "version": "2.3.3", + "version": "2.3.4", "bundled": true, "requires": { "safe-buffer": "^5.1.2", @@ -1199,7 +1199,7 @@ } }, "minizlib": { - "version": "1.1.0", + "version": "1.1.1", "bundled": true, "requires": { "minipass": "^2.2.1" @@ -1216,8 +1216,13 @@ "version": "2.0.0", "bundled": true }, + "nan": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" + }, "needle": { - "version": "2.2.1", + "version": "2.2.4", "bundled": true, "requires": { "debug": "^2.1.2", @@ -1226,12 +1231,12 @@ } }, "node-pre-gyp": { - "version": "0.10.2", + "version": "0.12.0", "bundled": true, "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", - "needle": "^2.2.0", + "needle": "^2.2.1", "nopt": "^4.0.1", "npm-packlist": "^1.1.6", "npmlog": "^4.0.2", @@ -1250,11 +1255,11 @@ } }, "npm-bundled": { - "version": "1.0.3", + "version": "1.0.5", "bundled": true }, "npm-packlist": { - "version": "1.1.10", + "version": "1.1.12", "bundled": true, "requires": { "ignore-walk": "^3.0.1", @@ -1359,7 +1364,7 @@ "bundled": true }, "semver": { - "version": "5.5.0", + "version": "5.6.0", "bundled": true }, "set-blocking": { @@ -1398,13 +1403,13 @@ "bundled": true }, "tar": { - "version": "4.4.4", + "version": "4.4.8", "bundled": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.3", - "minizlib": "^1.1.0", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", "yallist": "^3.0.2" diff --git a/package.json b/package.json index fc6abf43..e84000d1 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@google-cloud/logging-winston": "^0.9.0", "@google-cloud/storage": "^2.4.2", "@sendgrid/mail": "^6.3.1", - "bcrypt": "^3.0.0", + "bcrypt": "^3.0.4", "cookie-parser": "~1.4.3", "cookie-session": "^2.0.0-beta.3", "cors": "^2.8.5", From fef85ec060d589de4f18d81f8d586dc123d9ffd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Feb 2019 20:17:07 -0500 Subject: [PATCH 009/243] Bump @google-cloud/logging-winston from 0.9.1 to 0.10.2 (#235) Bumps [@google-cloud/logging-winston](https://github.com/googleapis/nodejs-logging-winston) from 0.9.1 to 0.10.2. - [Release notes](https://github.com/googleapis/nodejs-logging-winston/releases) - [Changelog](https://github.com/googleapis/nodejs-logging-winston/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-logging-winston/compare/v0.9.1...v0.10.2) Signed-off-by: dependabot[bot] --- package-lock.json | 1516 ++++++++++++++------------------------------- package.json | 2 +- 2 files changed, 460 insertions(+), 1058 deletions(-) diff --git a/package-lock.json b/package-lock.json index 801bc300..69b33b19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,126 +5,129 @@ "requires": true, "dependencies": { "@google-cloud/common": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.17.0.tgz", - "integrity": "sha512-HRZLSU762E6HaKoGfJGa8W95yRjb9rY7LePhjaHK9ILAnFacMuUGVamDbTHu1csZomm1g3tZTtXfX/aAhtie/Q==", + "version": "0.30.2", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.30.2.tgz", + "integrity": "sha512-JLIaSpMhhUetiwS30iC2SwNP51mayuSbyhRVdagqFC6rDVcqMHHsN8QJwUhCjOoHyfQ04n9SinfMCQzJTR9Liw==", "requires": { - "array-uniq": "^1.0.3", + "@google-cloud/projectify": "^0.3.2", + "@google-cloud/promisify": "^0.3.0", + "@types/duplexify": "^3.5.0", + "@types/request": "^2.47.0", "arrify": "^1.0.1", - "concat-stream": "^1.6.0", - "create-error-class": "^3.0.2", - "duplexify": "^3.5.0", + "duplexify": "^3.6.0", "ent": "^2.2.0", "extend": "^3.0.1", - "google-auto-auth": "^0.10.0", - "is": "^3.2.0", - "log-driver": "1.2.7", - "methmeth": "^1.1.0", - "modelo": "^4.2.0", - "request": "^2.79.0", - "retry-request": "^3.0.0", - "split-array-stream": "^1.0.0", - "stream-events": "^1.0.1", - "string-format-obj": "^1.1.0", - "through2": "^2.0.3" + "google-auth-library": "^3.0.0", + "pify": "^4.0.0", + "retry-request": "^4.0.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + } } }, "@google-cloud/common-grpc": { - "version": "0.6.1", - "resolved": "http://registry.npmjs.org/@google-cloud/common-grpc/-/common-grpc-0.6.1.tgz", - "integrity": "sha512-pspOZVfmrCTP0svTNwFE8nYJsQp5rTUaeUpJwpgslDk5tDWFbYT3dZkANbiURcTSq0mo6hZmd+M5rPIzWMVUmA==", + "version": "0.10.0", + "resolved": "http://registry.npmjs.org/@google-cloud/common-grpc/-/common-grpc-0.10.0.tgz", + "integrity": "sha512-Q7IxoKrWPaDoVMuyRKGOT7Q2Q0V0TIhTOlsHUlnvv50ip2W8l3JKC1jeiJpgRWCsh9Pd3ABng/Zn2ECn0btFTw==", "requires": { - "@google-cloud/common": "^0.17.0", - "dot-prop": "^4.2.0", - "duplexify": "^3.5.1", - "extend": "^3.0.1", - "grpc": "^1.10.0", - "is": "^3.2.0", - "modelo": "^4.2.0", - "retry-request": "^3.3.1", - "through2": "^2.0.3" + "@google-cloud/common": "^0.30.0", + "@google-cloud/projectify": "^0.3.0", + "@google-cloud/promisify": "^0.3.0", + "@grpc/proto-loader": "^0.4.0", + "duplexify": "^3.6.0", + "extend": "^3.0.2", + "grpc": "^1.15.1", + "is": "^3.2.1", + "retry-request": "^4.0.0", + "through2": "^3.0.0" + }, + "dependencies": { + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "through2": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", + "integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==", + "requires": { + "readable-stream": "2 || 3", + "xtend": "~4.0.1" + } + } } }, "@google-cloud/logging": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/@google-cloud/logging/-/logging-1.2.0.tgz", - "integrity": "sha512-6kQvSX/JkSbqAjmt8FkJg1bA3T09zG4CUSvQneEAoejGXISx2un/lpAsrW73dAJyHuwzBeO77HJJzqG0RfXGmw==", + "version": "4.3.0", + "resolved": "http://registry.npmjs.org/@google-cloud/logging/-/logging-4.3.0.tgz", + "integrity": "sha512-SRTo+2dP9ycGVoYHMGKtRkv7CFj75u6vK+GqKYO1rUjfs6zSB6qD74vKQmpEEmmrcWSrZRk3Fekbs9/4AKU4ww==", "requires": { - "@google-cloud/common": "^0.16.1", - "@google-cloud/common-grpc": "^0.6.0", - "arrify": "^1.0.0", - "eventid": "^0.1.0", - "extend": "^3.0.1", - "gcp-metadata": "^0.6.1", - "google-auto-auth": "^0.9.0", - "google-gax": "^0.16.0", - "google-proto-files": "^0.15.0", - "is": "^3.0.1", - "lodash.merge": "^4.6.0", - "protobufjs": "^6.8.0", - "pumpify": "^1.3.5", - "snakecase-keys": "^1.1.0", - "stream-events": "^1.0.1", - "string-format-obj": "^1.0.0", - "through2": "^2.0.3" + "@google-cloud/common-grpc": "^0.10.0", + "@google-cloud/paginator": "^0.1.0", + "@google-cloud/projectify": "^0.3.0", + "@google-cloud/promisify": "^0.3.0", + "@opencensus/propagation-stackdriver": "0.0.8", + "arrify": "^1.0.1", + "eventid": "^0.1.2", + "extend": "^3.0.2", + "gcp-metadata": "^0.9.0", + "google-auth-library": "^3.0.0", + "google-gax": "^0.25.0", + "is": "^3.2.1", + "lodash.merge": "^4.6.1", + "on-finished": "^2.3.0", + "pify": "^4.0.1", + "protobufjs": "^6.8.8", + "pumpify": "^1.5.1", + "snakecase-keys": "^2.0.0", + "stream-events": "^1.0.4", + "through2": "^3.0.0" }, "dependencies": { - "@google-cloud/common": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.16.2.tgz", - "integrity": "sha512-GrkaFoj0/oO36pNs4yLmaYhTujuA3i21FdQik99Fd/APix1uhf01VlpJY4lAteTDFLRNkRx6ydEh7OVvmeUHng==", + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + }, + "through2": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", + "integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==", "requires": { - "array-uniq": "^1.0.3", - "arrify": "^1.0.1", - "concat-stream": "^1.6.0", - "create-error-class": "^3.0.2", - "duplexify": "^3.5.0", - "ent": "^2.2.0", - "extend": "^3.0.1", - "google-auto-auth": "^0.9.0", - "is": "^3.2.0", - "log-driver": "1.2.7", - "methmeth": "^1.1.0", - "modelo": "^4.2.0", - "request": "^2.79.0", - "retry-request": "^3.0.0", - "split-array-stream": "^1.0.0", - "stream-events": "^1.0.1", - "string-format-obj": "^1.1.0", - "through2": "^2.0.3" - } - }, - "google-auto-auth": { - "version": "0.9.7", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.9.7.tgz", - "integrity": "sha512-Nro7aIFrL2NP0G7PoGrJqXGMZj8AjdBOcbZXRRm/8T3w08NUHIiNN3dxpuUYzDsZizslH+c8e+7HXL8vh3JXTQ==", - "requires": { - "async": "^2.3.0", - "gcp-metadata": "^0.6.1", - "google-auth-library": "^1.3.1", - "request": "^2.79.0" + "readable-stream": "2 || 3", + "xtend": "~4.0.1" } } } }, "@google-cloud/logging-winston": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@google-cloud/logging-winston/-/logging-winston-0.9.1.tgz", - "integrity": "sha512-+Sc4jrSp+MntOGuzTlJ8+6m+nVEu9B1LuD/hBhgA2DiWqrcC/1L2KCI0FX03Slanpv3+JEPBcc1SW04bTgzGeA==", - "requires": { - "@google-cloud/common": "^0.17.0", - "@google-cloud/logging": "^1.1.7", - "@sindresorhus/is": "^0.5.0", - "@types/proxyquire": "^1.3.28", - "cpy-cli": "^1.0.1", - "glob": "^7.1.2", - "is": "^3.2.0", + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@google-cloud/logging-winston/-/logging-winston-0.10.2.tgz", + "integrity": "sha512-dvd4Qnh9c3KNeur9ZZwYMm2zNfHMF5STXgoLnmtVS484mZgl1yDhPVPqKZlodrirKrIxRsZOZwm9BCghSIpDeA==", + "requires": { + "@google-cloud/logging": "^4.0.1", + "@sindresorhus/is": "^0.10.0", "lodash.mapvalues": "^4.6.0", - "ncp": "^2.0.0", - "once": "^1.4.0", - "pify": "^3.0.0", - "rimraf": "^2.6.2", - "tmp": "0.0.33" + "logform": "^1.9.1", + "semver": "^5.5.1", + "winston-transport": "^4.2.0" + }, + "dependencies": { + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + } } }, "@google-cloud/paginator": { @@ -317,19 +320,31 @@ } } }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "@grpc/grpc-js": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.5.tgz", + "integrity": "sha512-LAzNgWYr5FHIkn1XPVTOO5qt6an6sBz0dPSKGOjoBwm6eUgHCVGvyxc72DGXgRHwT8hBfT1VwBmhwGHwfdtjeA==", "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" + "semver": "^5.5.0" } }, - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" + "@grpc/proto-loader": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz", + "integrity": "sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw==", + "requires": { + "lodash.camelcase": "^4.3.0", + "protobufjs": "^6.8.6" + } + }, + "@opencensus/propagation-stackdriver": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.8.tgz", + "integrity": "sha512-wYI6YwB6qf6gcQARalxoKKXBW3WDuYiYXFF7lq/2PSnUv14NXRAogGv3qKTtDNhrrpVe0eD+RDbWi8onqRfABQ==", + "requires": { + "hex2dec": "^1.0.1", + "uuid": "^3.2.1" + } }, "@protobufjs/aspromise": { "version": "1.1.2", @@ -434,9 +449,12 @@ } }, "@sindresorhus/is": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.5.0.tgz", - "integrity": "sha512-6cNJTqnikB7E8BV8kYgoYCAwMBh3QSCUte3fq56ldWASPxrGteIDJR5kJ+BJ+AaTRTzI073VUFMHlWrhACn+Jg==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.10.0.tgz", + "integrity": "sha512-bmfpY7xAyYhgE531LyMH40uVWgBymnUbL6scPM3pogT/v9CDDnS8N5LRlwLiBGrvjYhBSylIz9P5mIqAMcoKIg==", + "requires": { + "symbol-observable": "^1.2.0" + } }, "@types/body-parser": { "version": "1.17.0", @@ -582,11 +600,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.10.tgz", "integrity": "sha512-p3W/hFzQs76RlYRIZsZc5a9bht6m0TspmWYYbKhRswmLnwj9fsE40EbuGifeu/XWR/c0UJQ1DDbvTxIsm/OOAA==" }, - "@types/proxyquire": { - "version": "1.3.28", - "resolved": "https://registry.npmjs.org/@types/proxyquire/-/proxyquire-1.3.28.tgz", - "integrity": "sha512-SQaNzWQ2YZSr7FqAyPPiA3FYpux2Lqh3HWMZQk47x3xbMCqgC/w0dY3dw9rGqlweDDkrySQBcaScXWeR+Yb11Q==" - }, "@types/range-parser": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", @@ -644,16 +657,6 @@ "negotiator": "0.6.1" } }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==" - }, - "acorn-es7-plugin": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz", - "integrity": "sha1-8u4fMiipDurRJF+asZIusucdM2s=" - }, "agent-base": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", @@ -824,50 +827,31 @@ "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true }, "arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true }, "arrify": { "version": "1.0.1", @@ -902,7 +886,8 @@ "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true }, "async": { "version": "2.6.1", @@ -926,7 +911,8 @@ "atob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=" + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "dev": true }, "aws-sign2": { "version": "0.7.0", @@ -938,24 +924,17 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" }, - "axios": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", - "requires": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, "requires": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", @@ -970,6 +949,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -978,6 +958,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -986,6 +967,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -994,6 +976,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -1580,6 +1563,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1589,6 +1573,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, "requires": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -1606,6 +1591,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -1639,11 +1625,6 @@ "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, "busboy": { "version": "0.2.14", "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", @@ -1682,6 +1663,13 @@ "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", "requires": { "long": "~3" + }, + "dependencies": { + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + } } }, "bytes": { @@ -1693,6 +1681,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, "requires": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", @@ -1705,37 +1694,11 @@ "unset-value": "^1.0.0" } }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, - "call-signature": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", - "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=" - }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - } - } - }, "can-promise": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/can-promise/-/can-promise-0.0.1.tgz", @@ -1747,7 +1710,8 @@ "capture-stack-trace": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", + "dev": true }, "caseless": { "version": "0.12.0", @@ -1836,6 +1800,7 @@ "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, "requires": { "arr-union": "^3.1.0", "define-property": "^0.2.5", @@ -1847,6 +1812,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -1893,6 +1859,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, "requires": { "map-visit": "^1.0.0", "object-visit": "^1.0.0" @@ -1974,7 +1941,8 @@ "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true }, "compressible": { "version": "2.0.15", @@ -1994,7 +1962,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", @@ -2098,12 +2067,8 @@ "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -2119,85 +2084,11 @@ "vary": "^1" } }, - "cp-file": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-3.2.0.tgz", - "integrity": "sha1-b4NhYlRiTwrViqSqjQdvAmvn4Yg=", - "requires": { - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nested-error-stacks": "^1.0.1", - "object-assign": "^4.0.1", - "pify": "^2.3.0", - "pinkie-promise": "^2.0.0", - "readable-stream": "^2.1.4" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "cpy": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/cpy/-/cpy-4.0.1.tgz", - "integrity": "sha1-tnJn66LzlgugalphrJQDNCKDNCQ=", - "requires": { - "cp-file": "^3.1.0", - "globby": "^4.0.0", - "meow": "^3.6.0", - "nested-error-stacks": "^1.0.0", - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "globby": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-4.1.0.tgz", - "integrity": "sha1-CA9UVJ7BuCpsYOYx/ILhIR2+lfg=", - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^6.0.1", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "cpy-cli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-1.0.1.tgz", - "integrity": "sha1-Z/taSi3sKMqKv/N13kuecfanVhw=", - "requires": { - "cpy": "^4.0.0", - "meow": "^3.6.0" - } - }, "create-error-class": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", + "dev": true, "requires": { "capture-stack-trace": "^1.0.0" } @@ -2241,14 +2132,6 @@ "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } - }, "cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -2296,7 +2179,8 @@ "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true }, "deep-eql": { "version": "3.0.1", @@ -2318,18 +2202,11 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.1.1.tgz", "integrity": "sha512-urQxA1smbLZ2cBbXbaYObM1dJ82aJ2H57A1C/Kklfh/ZN1bgH4G/n5KWhdNfOK11W98gqZfyYj7W4frJJRwA2w==" }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, "requires": { "is-descriptor": "^1.0.2", "isobject": "^3.0.1" @@ -2339,6 +2216,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -2347,6 +2225,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -2355,6 +2234,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -2427,25 +2307,11 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "diff-match-patch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", - "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==" - }, "dijkstrajs": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz", "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs=" }, - "dir-glob": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", - "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", - "requires": { - "arrify": "^1.0.1", - "path-type": "^3.0.0" - } - }, "dom-serializer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", @@ -2531,11 +2397,6 @@ "stream-shift": "^1.0.0" } }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", @@ -2550,24 +2411,6 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "empower": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/empower/-/empower-1.3.1.tgz", - "integrity": "sha512-uB6/ViBaawOO/uujFADTK3SqdYlxYNn+N4usK9MRKZ4Hbn/1QSy8k2PezxCA2/+JGbF8vd/eOfghZ90oOSDZCA==", - "requires": { - "core-js": "^2.0.0", - "empower-core": "^1.2.0" - } - }, - "empower-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", - "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", - "requires": { - "call-signature": "0.0.2", - "core-js": "^2.0.0" - } - }, "enabled": { "version": "1.0.2", "resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", @@ -2607,14 +2450,6 @@ "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==", "dev": true }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es6-promise": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", @@ -2638,19 +2473,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, - "espurify": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", - "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", - "requires": { - "core-js": "^2.0.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" - }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -2705,6 +2527,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, "requires": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -2719,6 +2542,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -2727,6 +2551,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -2735,6 +2560,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -2815,6 +2641,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, "requires": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" @@ -2824,6 +2651,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "requires": { "is-plain-object": "^2.0.4" } @@ -2834,6 +2662,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, "requires": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -2849,6 +2678,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -2857,6 +2687,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -2865,6 +2696,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -2873,6 +2705,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -2881,6 +2714,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -2904,19 +2738,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" }, - "fast-glob": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.4.tgz", - "integrity": "sha512-FjK2nCGI/McyzgNtTESqaWP3trPvHyRyoyY70hxjc3oKPNmDe8taohLZpoVKoUjW85tbU5txaYUZCNtVzygl1g==", - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - } - }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -2925,8 +2746,7 @@ "fast-safe-stringify": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", - "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==", - "dev": true + "integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==" }, "fast-text-encoding": { "version": "1.0.0", @@ -2936,13 +2756,13 @@ "fecha": { "version": "2.3.3", "resolved": "http://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", - "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==", - "dev": true + "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, "requires": { "extend-shallow": "^2.0.1", "is-number": "^3.0.0", @@ -2954,6 +2774,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -2984,37 +2805,11 @@ } } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "follow-redirects": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", - "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", - "requires": { - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } - } - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true }, "forever-agent": { "version": "0.6.1", @@ -3046,6 +2841,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, "requires": { "map-cache": "^0.2.2" } @@ -3086,7 +2882,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "1.2.4", @@ -3654,13 +3451,12 @@ } }, "gcp-metadata": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.6.3.tgz", - "integrity": "sha512-MSmczZctbz91AxCvqp9GHBoZOSbJKAICV7Ow/AIWSJZRrRchUd5NL1b2P4OfP+4m490BEUPhhARfpHdqCxuCvg==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.9.3.tgz", + "integrity": "sha512-caV4S84xAjENtpezLCT/GILEAF5h/bC4cNqZFmt/tjTn8t+JBtTkQrgBrJu3857YdsnlM8rxX/PMcKGtE8hUlw==", "requires": { - "axios": "^0.18.0", - "extend": "^3.0.1", - "retry-axios": "0.3.2" + "gaxios": "^1.0.2", + "json-bigint": "^0.3.0" } }, "gcs-resumable-upload": { @@ -3870,11 +3666,6 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -3884,7 +3675,8 @@ "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true }, "getpass": { "version": "0.1.7", @@ -3898,6 +3690,7 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3911,6 +3704,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, "requires": { "is-glob": "^3.1.0", "path-dirname": "^1.0.0" @@ -3920,17 +3714,13 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, "requires": { "is-extglob": "^2.1.0" } } } }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" - }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -3940,71 +3730,63 @@ "ini": "^1.3.4" } }, - "globby": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", - "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", - "requires": { - "array-union": "^1.0.1", - "dir-glob": "^2.0.0", - "fast-glob": "^2.0.2", - "glob": "^7.1.2", - "ignore": "^3.3.5", - "pify": "^3.0.0", - "slash": "^1.0.0" - } - }, "google-auth-library": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-1.6.1.tgz", - "integrity": "sha512-jYiWC8NA9n9OtQM7ANn0Tk464do9yhKEtaJ72pKcaBiEwn4LwcGYIYOfwtfsSm3aur/ed3tlSxbmg24IAT6gAg==", - "requires": { - "axios": "^0.18.0", - "gcp-metadata": "^0.6.3", - "gtoken": "^2.3.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.0.1.tgz", + "integrity": "sha512-ZGTBMiQga/pwEw26ZKCn+q9PTPXvE4v5sL2V9HV3f2Gt0lrS+2H7XgbVCx850jrvlEL59JIheFiDqEn9CIa0nA==", + "requires": { + "base64-js": "^1.3.0", + "fast-text-encoding": "^1.0.0", + "gaxios": "^1.2.1", + "gcp-metadata": "^0.9.3", + "gtoken": "^2.3.2", + "https-proxy-agent": "^2.2.1", "jws": "^3.1.5", - "lodash.isstring": "^4.0.1", - "lru-cache": "^4.1.3", - "retry-axios": "^0.3.2" + "lru-cache": "^5.0.0", + "semver": "^5.5.0" }, "dependencies": { "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^3.0.2" } + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, - "google-auto-auth": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/google-auto-auth/-/google-auto-auth-0.10.1.tgz", - "integrity": "sha512-iIqSbY7Ypd32mnHGbYctp80vZzXoDlvI9gEfvtl3kmyy5HzOcrZCIGCBdSlIzRsg7nHpQiHE3Zl6Ycur6TSodQ==", - "requires": { - "async": "^2.3.0", - "gcp-metadata": "^0.6.1", - "google-auth-library": "^1.3.1", - "request": "^2.79.0" - } - }, "google-gax": { - "version": "0.16.1", - "resolved": "http://registry.npmjs.org/google-gax/-/google-gax-0.16.1.tgz", - "integrity": "sha512-eP7UUkKvaHmmvCrr+rxzkIOeEKOnXmoib7/AkENDAuqlC9T2+lWlzwpthDRnitQcV8SblDMzsk73YPMPCDwPyQ==", + "version": "0.25.0", + "resolved": "http://registry.npmjs.org/google-gax/-/google-gax-0.25.0.tgz", + "integrity": "sha512-ZBDPgNuck0G7W2bIEc0hL0N8QgUJzAuVZ6bt7GcP61fWx6snAcKPTX9z5/MmcwKBZlUnzruONcyOQiVZZKZXnQ==", "requires": { - "duplexify": "^3.5.4", - "extend": "^3.0.0", - "globby": "^8.0.0", - "google-auto-auth": "^0.10.0", - "google-proto-files": "^0.15.0", - "grpc": "^1.10.0", - "is-stream-ended": "^0.1.0", - "lodash": "^4.17.2", - "protobufjs": "^6.8.0", - "through2": "^2.0.3" + "@grpc/grpc-js": "^0.3.0", + "@grpc/proto-loader": "^0.4.0", + "duplexify": "^3.6.0", + "google-auth-library": "^3.0.0", + "google-proto-files": "^0.18.0", + "grpc": "^1.16.0", + "grpc-gcp": "^0.1.1", + "is-stream-ended": "^0.1.4", + "lodash.at": "^4.6.0", + "lodash.has": "^4.5.2", + "protobufjs": "^6.8.8", + "retry-request": "^4.0.0", + "semver": "^5.5.1", + "walkdir": "0.0.12" + }, + "dependencies": { + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + } } }, "google-p12-pem": { @@ -4017,28 +3799,12 @@ } }, "google-proto-files": { - "version": "0.15.1", - "resolved": "http://registry.npmjs.org/google-proto-files/-/google-proto-files-0.15.1.tgz", - "integrity": "sha512-ebtmWgi/ooR5Nl63qRVZZ6VLM6JOb5zTNxTT/ZAU8yfMOdcauoOZNNMOVg0pCmTjqWXeuuVbgPP0CwO5UHHzBQ==", + "version": "0.18.0", + "resolved": "http://registry.npmjs.org/google-proto-files/-/google-proto-files-0.18.0.tgz", + "integrity": "sha512-blJ5rA3TWEiZIw7Qm0GHNERDdZeezDj46wE4O5uGnOWpZI/STQjeI6rPbqiwjmxzG+b592Hrp2+GKYfbmKR+Lg==", "requires": { - "globby": "^7.1.1", - "power-assert": "^1.4.4", - "protobufjs": "^6.8.0" - }, - "dependencies": { - "globby": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", - "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", - "requires": { - "array-union": "^1.0.1", - "dir-glob": "^2.0.0", - "glob": "^7.1.2", - "ignore": "^3.3.5", - "pify": "^3.0.0", - "slash": "^1.0.0" - } - } + "protobufjs": "^6.8.0", + "walkdir": "0.0.12" } }, "got": { @@ -4072,11 +3838,12 @@ "dev": true }, "grpc": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.16.1.tgz", - "integrity": "sha512-7uHN1Nd3UqfvwgQ6f5U3+EZb/0iuHJ9mbPH+ydaTkszJsUi3nwdz6DuSh0eJwYVXXn6Gojv2khiQAadMongGKg==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.18.0.tgz", + "integrity": "sha512-M0K67Zhv2ZzCjrTbQvjWgYFPB929L+qAVnbNgXepbfO5kJxUYc30dP8m8vb+o8QdahLHAeYfIqRoIzZRcCB98Q==", "requires": { - "lodash": "^4.17.5", + "lodash.camelcase": "^4.3.0", + "lodash.clone": "^4.5.0", "nan": "^2.0.0", "node-pre-gyp": "^0.12.0", "protobufjs": "^5.0.3" @@ -4179,7 +3946,7 @@ } }, "glob": { - "version": "7.1.3", + "version": "7.1.2", "bundled": true, "requires": { "fs.realpath": "^1.0.0", @@ -4195,7 +3962,7 @@ "bundled": true }, "iconv-lite": { - "version": "0.4.24", + "version": "0.4.23", "bundled": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -4493,27 +4260,41 @@ "bundled": true }, "yallist": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true } } }, + "grpc-gcp": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/grpc-gcp/-/grpc-gcp-0.1.1.tgz", + "integrity": "sha512-MAt0Ae9QuL2Lbbt2d+kDta5AxqRD1JVXtBcJuQKp9GeFL5TxPw/hxIyDNyivPjKEXjbG3cBGwSE3CXq6a3KHEQ==", + "requires": { + "grpc": "^1.16.0", + "protobufjs": "^6.8.8" + } + }, "gtoken": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.0.tgz", - "integrity": "sha512-Jc9/8mV630cZE9FC5tIlJCZNdUjwunvlwOtCz6IDlaiB4Sz68ki29a1+q97sWTnTYroiuF9B135rod9zrQdHLw==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz", + "integrity": "sha512-F8EObUGyC8Qd3WXTloNULZBwfUsOABoHElihB1F6zGhT/cy38iPL09wGLRY712I+hQnOyA+sYlgPFX2cOKz0qg==", "requires": { - "axios": "^0.18.0", + "gaxios": "^1.0.4", "google-p12-pem": "^1.0.0", - "jws": "^3.1.4", + "jws": "^3.1.5", "mime": "^2.2.0", - "pify": "^3.0.0" + "pify": "^4.0.0" }, "dependencies": { "mime": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", - "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", + "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==" + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" } } }, @@ -4563,6 +4344,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, "requires": { "get-value": "^2.0.6", "has-values": "^1.0.0", @@ -4573,6 +4355,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, "requires": { "is-number": "^3.0.0", "kind-of": "^4.0.0" @@ -4582,6 +4365,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4633,16 +4417,16 @@ "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, + "hex2dec": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/hex2dec/-/hex2dec-1.1.2.tgz", + "integrity": "sha512-Yu+q/XWr2fFQ11tHxPq4p4EiNkb2y+lAacJNhAdRXVfRIcDH6gi7htWFnnlIzvqHMHoWeIsfXlNAjZInpAOJDA==" + }, "hoek": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" - }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", @@ -4732,11 +4516,6 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" - }, "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -4754,23 +4533,11 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "^2.0.0" - } - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4812,6 +4579,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -4820,17 +4588,13 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } } } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", @@ -4843,15 +4607,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "requires": { - "builtin-modules": "^1.0.0" - } + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "is-ci": { "version": "1.1.0", @@ -4866,6 +4623,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -4874,6 +4632,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4884,6 +4643,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", "is-data-descriptor": "^0.1.4", @@ -4893,27 +4653,22 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -4927,6 +4682,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -4960,6 +4716,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -4968,6 +4725,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4983,6 +4741,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, "requires": { "is-number": "^4.0.0" }, @@ -4990,7 +4749,8 @@ "is-number": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true } } }, @@ -5007,6 +4767,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, "requires": { "isobject": "^3.0.1" } @@ -5038,15 +4799,11 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true }, "isarray": { "version": "1.0.0", @@ -5061,7 +4818,8 @@ "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "isstream": { "version": "0.1.2", @@ -5280,7 +5038,8 @@ "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true }, "klaw-sync": { "version": "2.1.0", @@ -5326,25 +5085,6 @@ "uc.micro": "^1.0.1" } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -5366,6 +5106,26 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, + "lodash.at": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.at/-/lodash.at-4.6.0.tgz", + "integrity": "sha1-k83OZk8KGZTqM9181A4jr9EbD/g=" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, + "lodash.clone": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", + "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" + }, + "lodash.has": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", + "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=" + }, "lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -5411,16 +5171,10 @@ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" - }, "logform": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/logform/-/logform-1.10.0.tgz", "integrity": "sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==", - "dev": true, "requires": { "colors": "^1.2.1", "fast-safe-stringify": "^2.0.4", @@ -5432,30 +5186,19 @@ "colors": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", - "dev": true + "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "lowercase-keys": { "version": "1.0.1", @@ -5492,12 +5235,13 @@ "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true }, "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-3.0.0.tgz", + "integrity": "sha512-Ot+2wruG8WqTbJngDxz0Ifm03y2pO4iL+brq/l+yEkGjUza03BnMQqX2XT//Jls8MOOl2VTHviAoLX+/nq/HXw==" }, "map-stream": { "version": "0.1.0", @@ -5509,6 +5253,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, "requires": { "object-visit": "^1.0.0" } @@ -5566,50 +5311,11 @@ "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", "optional": true }, - "meow": { - "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - } - } - }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, - "merge2": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", - "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==" - }, - "methmeth": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/methmeth/-/methmeth-1.1.0.tgz", - "integrity": "sha1-6AomYY5S9cQiKGG7dIUQvRDikIk=" - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -5619,6 +5325,7 @@ "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -5662,6 +5369,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5675,6 +5383,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, "requires": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" @@ -5684,6 +5393,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "requires": { "is-plain-object": "^2.0.4" } @@ -5728,11 +5438,6 @@ } } }, - "modelo": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/modelo/-/modelo-4.2.3.tgz", - "integrity": "sha512-9DITV2YEMcw7XojdfvGl3gDD8J9QjZTJ7ZOUuSAkP+F3T6rDbzMJuPktxptsdHYEvZcmXrCD3LMOhdSAEq6zKA==" - }, "mongodb": { "version": "3.1.13", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz", @@ -5866,6 +5571,7 @@ "version": "1.2.9", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -5881,24 +5587,11 @@ "to-regex": "^3.0.1" } }, - "ncp": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=" - }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, - "nested-error-stacks": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", - "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=", - "requires": { - "inherits": "~2.0.1" - } - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -5952,17 +5645,6 @@ "abbrev": "1" } }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -5999,6 +5681,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, "requires": { "copy-descriptor": "^0.1.0", "define-property": "^0.2.5", @@ -6009,6 +5692,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -6017,21 +5701,18 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } } } }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" - }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, "requires": { "isobject": "^3.0.0" } @@ -6040,6 +5721,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, "requires": { "isobject": "^3.0.1" } @@ -6102,7 +5784,8 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true }, "osenv": { "version": "0.1.5", @@ -6162,14 +5845,6 @@ "semver": "^5.1.0" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -6178,7 +5853,8 @@ "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true }, "passport": { "version": "0.4.0", @@ -6205,20 +5881,14 @@ "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-is-inside": { "version": "1.0.2", @@ -6236,14 +5906,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "^3.0.0" - } - }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", @@ -6274,19 +5936,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, "pngjs": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.3.3.tgz", @@ -6295,116 +5944,8 @@ "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" - }, - "power-assert": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.1.tgz", - "integrity": "sha512-VWkkZV6Y+W8qLX/PtJu2Ur2jDPIs0a5vbP0TpKeybNcIXmT4vcKoVkyTp5lnQvTpY/DxacAZ4RZisHRHLJcAZQ==", - "requires": { - "define-properties": "^1.1.2", - "empower": "^1.3.1", - "power-assert-formatter": "^1.4.1", - "universal-deep-strict-equal": "^1.2.1", - "xtend": "^4.0.0" - } - }, - "power-assert-context-formatter": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz", - "integrity": "sha512-HLNEW8Bin+BFCpk/zbyKwkEu9W8/zThIStxGo7weYcFkKgMuGCHUJhvJeBGXDZf0Qm2xis4pbnnciGZiX0EpSg==", - "requires": { - "core-js": "^2.0.0", - "power-assert-context-traversal": "^1.2.0" - } - }, - "power-assert-context-reducer-ast": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz", - "integrity": "sha512-EgOxmZ/Lb7tw4EwSKX7ZnfC0P/qRZFEG28dx/690qvhmOJ6hgThYFm5TUWANDLK5NiNKlPBi5WekVGd2+5wPrw==", - "requires": { - "acorn": "^5.0.0", - "acorn-es7-plugin": "^1.0.12", - "core-js": "^2.0.0", - "espurify": "^1.6.0", - "estraverse": "^4.2.0" - } - }, - "power-assert-context-traversal": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz", - "integrity": "sha512-NFoHU6g2umNajiP2l4qb0BRWD773Aw9uWdWYH9EQsVwIZnog5bd2YYLFCVvaxWpwNzWeEfZIon2xtyc63026pQ==", - "requires": { - "core-js": "^2.0.0", - "estraverse": "^4.1.0" - } - }, - "power-assert-formatter": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz", - "integrity": "sha1-XcEl7VCj37HdomwZNH879Y7CiEo=", - "requires": { - "core-js": "^2.0.0", - "power-assert-context-formatter": "^1.0.7", - "power-assert-context-reducer-ast": "^1.0.7", - "power-assert-renderer-assertion": "^1.0.7", - "power-assert-renderer-comparison": "^1.0.7", - "power-assert-renderer-diagram": "^1.0.7", - "power-assert-renderer-file": "^1.0.7" - } - }, - "power-assert-renderer-assertion": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz", - "integrity": "sha512-3F7Q1ZLmV2ZCQv7aV7NJLNK9G7QsostrhOU7U0RhEQS/0vhEqrRg2jEJl1jtUL4ZyL2dXUlaaqrmPv5r9kRvIg==", - "requires": { - "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.2.0" - } - }, - "power-assert-renderer-base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz", - "integrity": "sha1-lqZQxv0F7hvB9mtUrWFELIs/Y+s=" - }, - "power-assert-renderer-comparison": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz", - "integrity": "sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==", - "requires": { - "core-js": "^2.0.0", - "diff-match-patch": "^1.0.0", - "power-assert-renderer-base": "^1.1.1", - "stringifier": "^1.3.0", - "type-name": "^2.0.1" - } - }, - "power-assert-renderer-diagram": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz", - "integrity": "sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==", - "requires": { - "core-js": "^2.0.0", - "power-assert-renderer-base": "^1.1.1", - "power-assert-util-string-width": "^1.2.0", - "stringifier": "^1.3.0" - } - }, - "power-assert-renderer-file": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz", - "integrity": "sha512-/oaVrRbeOtGoyyd7e4IdLP/jIIUFJdqJtsYzP9/88R39CMnfF/S/rUc8ZQalENfUfQ/wQHu+XZYRMaCEZmEesg==", - "requires": { - "power-assert-renderer-base": "^1.1.1" - } - }, - "power-assert-util-string-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz", - "integrity": "sha512-lX90G0igAW0iyORTILZ/QjZWsa1MZ6VVY3L0K86e2eKun3S4LKPH4xZIl8fdeMYLfOjkaszbNSzf1uugLeAm2A==", - "requires": { - "eastasianwidth": "^0.2.0" - } + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true }, "prepend-http": { "version": "1.0.4", @@ -6438,14 +5979,9 @@ }, "dependencies": { "@types/node": { - "version": "10.12.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.9.tgz", - "integrity": "sha512-eajkMXG812/w3w4a1OcBlaTwsFPO5F7fJ/amy+tieQxEMWBlbV1JGSjkFM+zkHNf81Cad+dfIRA+IBkvmvdAeA==" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "10.12.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.21.tgz", + "integrity": "sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==" } } }, @@ -6470,7 +6006,8 @@ "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true }, "psl": { "version": "1.1.31", @@ -6728,42 +6265,6 @@ } } }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - }, - "dependencies": { - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -6790,19 +6291,11 @@ "set-immediate-shim": "^1.0.1" } }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, "requires": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" @@ -6841,20 +6334,14 @@ "repeat-element": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, "request": { "version": "2.85.0", @@ -6912,35 +6399,23 @@ "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, - "retry-axios": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/retry-axios/-/retry-axios-0.3.2.tgz", - "integrity": "sha512-jp4YlI0qyDFfXiXGhkCOliBN1G7fRH03Nqy8YdShzGqbY5/9S2x/IR6C88ls2DFkbWuL3ASkP7QD3pVrNpPgwQ==" + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true }, "retry-request": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-3.3.2.tgz", - "integrity": "sha512-WIiGp37XXDC6e7ku3LFoi7LCL/Gs9luGeeqvbPRb+Zl6OQMw4RCRfSaW+aLfE6lhz1R941UavE6Svl3Dm5xGIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", + "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", "requires": { - "request": "^2.81.0", "through2": "^2.0.0" } }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "requires": { - "glob": "^7.0.5" - } - }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -6950,6 +6425,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, "requires": { "ret": "~0.1.10" } @@ -7033,6 +6509,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, "requires": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", @@ -7044,6 +6521,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -7096,23 +6574,18 @@ } } }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, "sliced": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" }, "snakecase-keys": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-1.2.0.tgz", - "integrity": "sha512-G5Faa3wQevGXcD5e4JKfmgofO+Fu4Jg4/nLyeZqWmBqVV0/3ORgervt3EjBi6PEFKhztPQWegZspteWnycx5dg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-2.1.0.tgz", + "integrity": "sha512-oQSiCIgNCwixBf8Kxgv0SPo67zQSutIEymAk/dkgcdZEOMPvGMGPua/WwYGPG4LLHArGGews3CB3zEEfqlMk2g==", "requires": { - "map-obj": "~2.0.0", - "to-snake-case": "~0.1.2" + "map-obj": "~3.0.0", + "to-snake-case": "~1.0.0" } }, "snakeize": { @@ -7124,6 +6597,7 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, "requires": { "base": "^0.11.1", "debug": "^2.2.0", @@ -7139,6 +6613,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -7147,6 +6622,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -7155,6 +6631,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -7165,6 +6642,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, "requires": { "define-property": "^1.0.0", "isobject": "^3.0.0", @@ -7175,6 +6653,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -7183,6 +6662,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -7191,6 +6671,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -7199,6 +6680,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -7211,6 +6693,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, "requires": { "kind-of": "^3.2.0" }, @@ -7219,6 +6702,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -7236,12 +6720,14 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true }, "source-map-resolve": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "dev": true, "requires": { "atob": "^2.0.0", "decode-uri-component": "^0.2.0", @@ -7253,7 +6739,8 @@ "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true }, "sparse-bitfield": { "version": "3.0.3", @@ -7264,34 +6751,6 @@ "memory-pager": "^1.0.2" } }, - "spdx-correct": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", - "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", - "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==" - }, "split": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", @@ -7301,19 +6760,11 @@ "through": "2" } }, - "split-array-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-1.0.3.tgz", - "integrity": "sha1-0rdajl4Ngk1S/eyLgiWDncLjXfo=", - "requires": { - "async": "^2.4.0", - "is-stream-ended": "^0.1.0" - } - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, "requires": { "extend-shallow": "^3.0.0" } @@ -7348,6 +6799,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, "requires": { "define-property": "^0.2.5", "object-copy": "^0.1.0" @@ -7357,6 +6809,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -7395,11 +6848,6 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, - "string-format-obj": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string-format-obj/-/string-format-obj-1.1.1.tgz", - "integrity": "sha512-Mm+sROy+pHJmx0P/0Bs1uxIX6UhGJGj6xDGQZ5zh9v/SZRmLGevp+p0VJxV7lirrkAmQ2mvva/gHKpnF/pTb+Q==" - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -7418,16 +6866,6 @@ "safe-buffer": "~5.1.0" } }, - "stringifier": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/stringifier/-/stringifier-1.4.0.tgz", - "integrity": "sha512-cNsMOqqrcbLcHTXEVmkw9y0fwDwkdgtZwlfyolzpQDoAE1xdNGhQhxBUfiDvvZIKl1hnUEgMv66nHwtMz3OjPw==", - "requires": { - "core-js": "^2.0.0", - "traverse": "^0.6.6", - "type-name": "^2.0.1" - } - }, "stringstream": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", @@ -7441,27 +6879,11 @@ "ansi-regex": "^2.0.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "^4.0.1" - } - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -7516,6 +6938,11 @@ "has-flag": "^3.0.0" } }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, "teeny-request": { "version": "3.11.3", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", @@ -7569,23 +6996,16 @@ "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", "dev": true }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "to-no-case": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-0.1.1.tgz", - "integrity": "sha1-zzPHDg8oFo2V5BWavxUOjFQu+f4=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", + "integrity": "sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo=" }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -7594,6 +7014,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -7604,6 +7025,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, "requires": { "define-property": "^2.0.2", "extend-shallow": "^3.0.2", @@ -7615,25 +7037,26 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, "requires": { "is-number": "^3.0.0", "repeat-string": "^1.6.1" } }, "to-snake-case": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/to-snake-case/-/to-snake-case-0.1.2.tgz", - "integrity": "sha1-0Ee22/BI2uG9wmCzwpb1TKNO7Xw=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-snake-case/-/to-snake-case-1.0.0.tgz", + "integrity": "sha1-znRpE4l5RgGah+Yu366upMYIq4w=", "requires": { - "to-space-case": "0.1.2" + "to-space-case": "^1.0.0" } }, "to-space-case": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-0.1.2.tgz", - "integrity": "sha1-mma+Pr5T8nefaH8CYu/9H8W20V4=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz", + "integrity": "sha1-sFLar7Gysp3HcM6gFj5ewOvJ/Bc=", "requires": { - "to-no-case": "0.1.1" + "to-no-case": "^1.0.0" } }, "touch": { @@ -7653,21 +7076,10 @@ "punycode": "^1.4.1" } }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, "triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", - "dev": true + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, "tunnel-agent": { "version": "0.6.0", @@ -7698,11 +7110,6 @@ "mime-types": "~2.1.18" } }, - "type-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/type-name/-/type-name-2.0.2.tgz", - "integrity": "sha1-7+fUEj2KxSr/9/QMfk3sUmYAj7Q=" - }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -7762,6 +7169,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", @@ -7773,6 +7181,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -7781,6 +7190,7 @@ "version": "0.4.3", "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, "requires": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", @@ -7798,16 +7208,6 @@ "crypto-random-string": "^1.0.0" } }, - "universal-deep-strict-equal": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz", - "integrity": "sha1-DaSsL3PP95JMgfpN4BjKViyisKc=", - "requires": { - "array-filter": "^1.0.0", - "indexof": "0.0.1", - "object-keys": "^1.0.0" - } - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -7823,6 +7223,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, "requires": { "has-value": "^0.3.1", "isobject": "^3.0.0" @@ -7832,6 +7233,7 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, "requires": { "get-value": "^2.0.3", "has-values": "^0.1.4", @@ -7842,6 +7244,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, "requires": { "isarray": "1.0.0" } @@ -7851,7 +7254,8 @@ "has-values": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true } } }, @@ -7925,7 +7329,8 @@ "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true }, "url-parse-lax": { "version": "1.0.0", @@ -7940,6 +7345,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "dev": true, "requires": { "kind-of": "^6.0.2" } @@ -7959,15 +7365,6 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "validator": { "version": "10.10.0", "resolved": "https://registry.npmjs.org/validator/-/validator-10.10.0.tgz", @@ -7988,6 +7385,11 @@ "extsprintf": "^1.2.0" } }, + "walkdir": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.12.tgz", + "integrity": "sha512-HFhaD4mMWPzFSqhpyDG48KDdrjfn409YQuVW7ckZYhW4sE87mYtWifdB/+73RA7+p4s4K18n5Jfx1kHthE1gBw==" + }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", @@ -8077,7 +7479,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", - "dev": true, "requires": { "readable-stream": "^2.3.6", "triple-beam": "^1.2.0" @@ -8130,7 +7531,8 @@ "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true }, "yargs": { "version": "3.32.0", diff --git a/package.json b/package.json index e84000d1..48a4b3d7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "docs": "apidoc -i ./routes -o ./docs/api/" }, "dependencies": { - "@google-cloud/logging-winston": "^0.9.0", + "@google-cloud/logging-winston": "^0.10.2", "@google-cloud/storage": "^2.4.2", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.4", From bd5f9715578f15884f6829a34dee913acdc8b339 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 7 Feb 2019 10:33:14 +0000 Subject: [PATCH 010/243] Bump handlebars from 4.0.12 to 4.1.0 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.12 to 4.1.0. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.1.0/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.0.12...v4.1.0) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69b33b19..2a76ed80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4299,9 +4299,9 @@ } }, "handlebars": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", - "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", + "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", "requires": { "async": "^2.5.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 48a4b3d7..57303466 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.16.0", "express-validator": "^5.3.1", "express-winston": "^2.6.0", - "handlebars": "^4.0.12", + "handlebars": "^4.1.0", "jsonwebtoken": "^8.1.0", "memory-cache": "^0.2.0", "mongoose": "^5.4.10", From 3e87de94aed062cc306813c2780c61438d58114c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 7 Feb 2019 19:11:01 +0000 Subject: [PATCH 011/243] [Security] Bump extend from 3.0.1 to 3.0.2 Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.1 to 3.0.2. **This update includes security fixes.** - [Release notes](https://github.com/justmoon/node-extend/releases) - [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md) - [Commits](https://github.com/justmoon/node-extend/compare/v3.0.1...v3.0.2) Signed-off-by: dependabot[bot] --- package-lock.json | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a76ed80..c60b9f08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,11 +46,6 @@ "through2": "^3.0.0" }, "dependencies": { - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, "through2": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", @@ -89,11 +84,6 @@ "through2": "^3.0.0" }, "dependencies": { - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -2633,9 +2623,9 @@ } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extend-shallow": { "version": "3.0.2", @@ -3441,13 +3431,6 @@ "extend": "^3.0.2", "https-proxy-agent": "^2.2.1", "node-fetch": "^2.2.0" - }, - "dependencies": { - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - } } }, "gcp-metadata": { @@ -3500,11 +3483,6 @@ "xdg-basedir": "^3.0.0" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", From 98f1433e4fc36f6147e79833a8b028482784e992 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 7 Feb 2019 19:19:51 +0000 Subject: [PATCH 012/243] [Security] Bump lodash from 4.17.10 to 4.17.11 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.11. **This update includes security fixes.** - [Release notes](https://github.com/lodash/lodash/releases) - [Changelog](https://github.com/lodash/lodash/blob/master/CHANGELOG) - [Commits](https://github.com/lodash/lodash/compare/4.17.10...4.17.11) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c60b9f08..4e58acff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5080,9 +5080,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "lodash.at": { "version": "4.6.0", From d2510d13aca69f8589d7f531cfea9992e5b48689 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 8 Feb 2019 22:25:15 +0000 Subject: [PATCH 013/243] Bump nodemon from 1.17.3 to 1.18.10 Bumps [nodemon](https://github.com/remy/nodemon) from 1.17.3 to 1.18.10. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v1.17.3...v1.18.10) Signed-off-by: dependabot[bot] --- package-lock.json | 362 +++++++++++++++++----------------------------- package.json | 2 +- 2 files changed, 136 insertions(+), 228 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e58acff..421fdc2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -726,6 +726,17 @@ "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, "apidoc": { @@ -899,9 +910,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, "aws-sign2": { @@ -1430,9 +1441,9 @@ "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" }, "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz", + "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==", "dev": true }, "bluebird": { @@ -1512,9 +1523,9 @@ "dev": true }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -1698,9 +1709,9 @@ } }, "capture-stack-trace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", "dev": true }, "caseless": { @@ -1761,29 +1772,29 @@ "dev": true }, "chokidar": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", - "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.0.tgz", + "integrity": "sha512-5t6G2SH8eO6lCvYOoUpaRnF5Qfd//gd7qJAkwRUw9qlGVkiQ13uwQngqbWWaurOsaAm9+kUGbITADxt6H0XFNQ==", "dev": true, "requires": { "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.1.2", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", - "inherits": "^2.0.1", + "inherits": "^2.0.3", "is-binary-path": "^1.0.0", "is-glob": "^4.0.0", - "normalize-path": "^2.1.1", + "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.0" + "readdirp": "^2.2.1", + "upath": "^1.1.0" } }, "ci-info": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", - "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", "dev": true }, "class-utils": { @@ -2182,9 +2193,9 @@ } }, "deep-extend": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", - "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "deepmerge": { @@ -2364,12 +2375,6 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", "integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==" }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -2468,21 +2473,6 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, - "event-stream": { - "version": "3.3.4", - "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, "eventid": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/eventid/-/eventid-0.1.2.tgz", @@ -2841,12 +2831,6 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -2876,9 +2860,9 @@ "dev": true }, "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", + "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", "dev": true, "optional": true, "requires": { @@ -2905,7 +2889,7 @@ "optional": true }, "are-we-there-yet": { - "version": "1.1.4", + "version": "1.1.5", "bundled": true, "dev": true, "optional": true, @@ -2931,7 +2915,7 @@ } }, "chownr": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true @@ -2970,7 +2954,7 @@ } }, "deep-extend": { - "version": "0.5.1", + "version": "0.6.0", "bundled": true, "dev": true, "optional": true @@ -3019,7 +3003,7 @@ } }, "glob": { - "version": "7.1.2", + "version": "7.1.3", "bundled": true, "dev": true, "optional": true, @@ -3039,12 +3023,12 @@ "optional": true }, "iconv-lite": { - "version": "0.4.21", + "version": "0.4.24", "bundled": true, "dev": true, "optional": true, "requires": { - "safer-buffer": "^2.1.0" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { @@ -3109,17 +3093,17 @@ "optional": true }, "minipass": { - "version": "2.2.4", + "version": "2.3.5", "bundled": true, "dev": true, "optional": true, "requires": { - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.0" } }, "minizlib": { - "version": "1.1.0", + "version": "1.2.1", "bundled": true, "dev": true, "optional": true, @@ -3143,7 +3127,7 @@ "optional": true }, "needle": { - "version": "2.2.0", + "version": "2.2.4", "bundled": true, "dev": true, "optional": true, @@ -3154,18 +3138,18 @@ } }, "node-pre-gyp": { - "version": "0.10.0", + "version": "0.10.3", "bundled": true, "dev": true, "optional": true, "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", - "needle": "^2.2.0", + "needle": "^2.2.1", "nopt": "^4.0.1", "npm-packlist": "^1.1.6", "npmlog": "^4.0.2", - "rc": "^1.1.7", + "rc": "^1.2.7", "rimraf": "^2.6.1", "semver": "^5.3.0", "tar": "^4" @@ -3182,13 +3166,13 @@ } }, "npm-bundled": { - "version": "1.0.3", + "version": "1.0.5", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.1.10", + "version": "1.2.0", "bundled": true, "dev": true, "optional": true, @@ -3265,12 +3249,12 @@ "optional": true }, "rc": { - "version": "1.2.7", + "version": "1.2.8", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "^0.5.1", + "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -3300,16 +3284,16 @@ } }, "rimraf": { - "version": "2.6.2", + "version": "2.6.3", "bundled": true, "dev": true, "optional": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "safe-buffer": { - "version": "5.1.1", + "version": "5.1.2", "bundled": true, "dev": true, "optional": true @@ -3327,7 +3311,7 @@ "optional": true }, "semver": { - "version": "5.5.0", + "version": "5.6.0", "bundled": true, "dev": true, "optional": true @@ -3380,17 +3364,17 @@ "optional": true }, "tar": { - "version": "4.4.1", + "version": "4.4.8", "bundled": true, "dev": true, "optional": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.2" } }, @@ -3401,12 +3385,12 @@ "optional": true }, "wide-align": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "optional": true, "requires": { - "string-width": "^1.0.2" + "string-width": "^1.0.2 || 2" } }, "wrappy": { @@ -3416,7 +3400,7 @@ "optional": true }, "yallist": { - "version": "3.0.2", + "version": "3.0.3", "bundled": true, "dev": true, "optional": true @@ -4589,12 +4573,12 @@ "dev": true }, "is-ci": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", - "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", "dev": true, "requires": { - "ci-info": "^1.0.0" + "ci-info": "^1.5.0" } }, "is-data-descriptor": { @@ -4715,23 +4699,6 @@ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" }, - "is-odd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", @@ -5185,9 +5152,9 @@ "dev": true }, "lru-cache": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", - "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -5221,12 +5188,6 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-3.0.0.tgz", "integrity": "sha512-Ot+2wruG8WqTbJngDxz0Ifm03y2pO4iL+brq/l+yEkGjUza03BnMQqX2XT//Jls8MOOl2VTHviAoLX+/nq/HXw==" }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -5546,9 +5507,9 @@ "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" }, "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -5556,7 +5517,6 @@ "define-property": "^2.0.2", "extend-shallow": "^3.0.2", "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", "is-windows": "^1.0.2", "kind-of": "^6.0.2", "object.pick": "^1.3.0", @@ -5586,31 +5546,37 @@ "integrity": "sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ==" }, "nodemon": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.17.3.tgz", - "integrity": "sha512-8AtS+wA5u6qoE12LONjqOzUzxAI5ObzSw6U5LgqpaO/0y6wwId4l5dN0ZulYyYdpLZD1MbkBp7GjG1hqaoRqYg==", + "version": "1.18.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.10.tgz", + "integrity": "sha512-we51yBb1TfEvZamFchRgcfLbVYgg0xlGbyXmOtbBzDwxwgewYS/YbZ5tnlnsH51+AoSTTsT3A2E/FloUbtH8cQ==", "dev": true, "requires": { - "chokidar": "^2.0.2", + "chokidar": "^2.1.0", "debug": "^3.1.0", "ignore-by-default": "^1.0.1", "minimatch": "^3.0.4", - "pstree.remy": "^1.1.0", + "pstree.remy": "^1.1.6", "semver": "^5.5.0", "supports-color": "^5.2.0", "touch": "^3.1.0", "undefsafe": "^2.0.2", - "update-notifier": "^2.3.0" + "update-notifier": "^2.5.0" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, @@ -5624,13 +5590,10 @@ } }, "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true }, "npm-run-path": { "version": "2.0.2", @@ -5895,15 +5858,6 @@ "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "~2.3" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -5972,15 +5926,6 @@ "ipaddr.js": "1.6.0" } }, - "ps-tree": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", - "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", - "dev": true, - "requires": { - "event-stream": "~3.3.0" - } - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -5993,13 +5938,10 @@ "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" }, "pstree.remy": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.0.tgz", - "integrity": "sha512-q5I5vLRMVtdWa8n/3UEzZX7Lfghzrg9eG2IKk2ENLSofKRCXVqMvMUHxCKgXNaqH/8ebhBxrqftHWnyTFweJ5Q==", - "dev": true, - "requires": { - "ps-tree": "^1.1.0" - } + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz", + "integrity": "sha512-NdF35+QsqD7EgNEI5mkI/X+UwaxVEbQaz9f4IooEmMUv6ZPmlTQYGjBPJGgrlzNdjSvIy4MWMg6Q6vCgBO2K+w==", + "dev": true }, "pump": { "version": "2.0.1", @@ -6224,12 +6166,12 @@ } }, "rc": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", - "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { - "deep-extend": "^0.5.1", + "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -6258,15 +6200,14 @@ } }, "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" } }, "regex-not": { @@ -6310,9 +6251,9 @@ "dev": true }, "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", "dev": true }, "repeat-string": { @@ -6477,12 +6418,6 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -6702,12 +6637,12 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "atob": "^2.0.0", + "atob": "^2.1.1", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -6729,15 +6664,6 @@ "memory-pager": "^1.0.2" } }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2" - } - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -6799,15 +6725,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "~0.1.1" - } - }, "stream-events": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.4.tgz", @@ -6953,12 +6870,6 @@ "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", "dev": true }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, "through2": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", @@ -7244,9 +7155,9 @@ "dev": true }, "upath": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.0.5.tgz", - "integrity": "sha512-qbKn90aDQ0YEwvXoLqj0oiuUYroLX2lVHZ+b+xwjozFasAOC4GneDq5+OaIG5Zj+jFmbz/uO+f7a9qxjktJQww==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", "dev": true }, "update-notifier": { @@ -7277,9 +7188,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -7320,13 +7231,10 @@ } }, "use": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true }, "util-deprecate": { "version": "1.0.2", @@ -7382,9 +7290,9 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "widest-line": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", - "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", "dev": true, "requires": { "string-width": "^2.1.1" diff --git a/package.json b/package.json index 57303466..2637d46e 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "jshint": "^2.10.1", "jslint": "^0.12.1", "mocha": "^5.2.0", - "nodemon": "^1.17.3" + "nodemon": "^1.18.10" } } From 2de6cb316d1bf8aa10e3418a8073a889db24f962 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 9 Feb 2019 15:23:48 +0000 Subject: [PATCH 014/243] Bump mongoose from 5.4.10 to 5.4.11 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.10 to 5.4.11. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.10...5.4.11) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 421fdc2b..ad72c071 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5412,9 +5412,9 @@ } }, "mongoose": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.10.tgz", - "integrity": "sha512-yJl+A7p8QF++tyBl6fRGFON5GV57MTXLKNiaiqgX5vZs1qJpcZpPiUGU5odBiqTHFYPybuRp8dW9Qtv4K6SxBQ==", + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.11.tgz", + "integrity": "sha512-Ah/JaZj4vhYP2CEjIy1ictJguzGJczHMtUQmLrBUpnQ4WhhQl5jOo6JHzKiRJ/PdLV25y22kt8WOdsc0DIojww==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 2637d46e..7346824f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.1.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.10", + "mongoose": "^5.4.11", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 77c862a28e26b0580f62d19e8a4e133f69d810dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 12 Feb 2019 17:27:35 +0000 Subject: [PATCH 015/243] Bump @types/mongoose from 5.3.12 to 5.3.13 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.3.12 to 5.3.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ad72c071..7d2ee19b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -567,9 +567,9 @@ } }, "@types/mongoose": { - "version": "5.3.12", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.12.tgz", - "integrity": "sha512-dmZv3H9lXWhLY8XrxJNu+pVUecquReR3AtPxVsnPTcTH/T/YTgxE0zeTavNcqaBUD5XXKtlTy+2VhZxDkn/0Jw==", + "version": "5.3.13", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.13.tgz", + "integrity": "sha512-clkn/fhxckA/Ey4Gcgjpf1/8qME8PPg3Eo1Spv2su3VPEEjHdEEYomiP0K4wxKa6/0zr9RGc+cnCBAoXf4tt8Q==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 7346824f..809f57e6 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.12", + "@types/mongoose": "^5.3.13", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai-http": "^4.2.1", From 21ce17eb0c4c933d7e3cb5ddb48c018089f64947 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 12 Feb 2019 20:49:00 +0000 Subject: [PATCH 016/243] Bump @types/mongoose from 5.3.13 to 5.3.14 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.3.13 to 5.3.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d2ee19b..68e9539a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -567,9 +567,9 @@ } }, "@types/mongoose": { - "version": "5.3.13", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.13.tgz", - "integrity": "sha512-clkn/fhxckA/Ey4Gcgjpf1/8qME8PPg3Eo1Spv2su3VPEEjHdEEYomiP0K4wxKa6/0zr9RGc+cnCBAoXf4tt8Q==", + "version": "5.3.14", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.14.tgz", + "integrity": "sha512-PTqWHTKmgf3rU9BqI3gR0aPzYDq+utjL5h+Imu6bCCOn+OUDb5bN0c0MfAt3YzZhCzA7fVd9FMxbTDwbBBzyGg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 809f57e6..03c3ce67 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.13", + "@types/mongoose": "^5.3.14", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai-http": "^4.2.1", From ba9336fb31ae48357d4ae50d894ac6b4804764db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 12 Feb 2019 22:36:00 +0000 Subject: [PATCH 017/243] Bump @types/mongoose from 5.3.14 to 5.3.15 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.3.14 to 5.3.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 68e9539a..caff6c6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -567,9 +567,9 @@ } }, "@types/mongoose": { - "version": "5.3.14", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.14.tgz", - "integrity": "sha512-PTqWHTKmgf3rU9BqI3gR0aPzYDq+utjL5h+Imu6bCCOn+OUDb5bN0c0MfAt3YzZhCzA7fVd9FMxbTDwbBBzyGg==", + "version": "5.3.15", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.15.tgz", + "integrity": "sha512-Pj64zQumjylyhNz4sTYVl4ua2dU/ei/6iwXR3DlTXPO+DcmWDk972sUiI0+jpX3e6bXjO06fpq5ADVzGz4PVmw==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 03c3ce67..04c2017c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.14", + "@types/mongoose": "^5.3.15", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai-http": "^4.2.1", From dad99610b7e2751b702c55b18a0379dea9b46655 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 13 Feb 2019 00:48:05 +0000 Subject: [PATCH 018/243] Bump cookie-parser from 1.4.3 to 1.4.4 Bumps [cookie-parser](https://github.com/expressjs/cookie-parser) from 1.4.3 to 1.4.4. - [Release notes](https://github.com/expressjs/cookie-parser/releases) - [Changelog](https://github.com/expressjs/cookie-parser/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/cookie-parser/compare/1.4.3...1.4.4) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index caff6c6d..8a0bbaa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2016,9 +2016,9 @@ "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" }, "cookie-parser": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", - "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.4.tgz", + "integrity": "sha512-lo13tqF3JEtFO7FyA49CqbhaFkskRJ0u/UAiINgrIXeRCY41c88/zxtrECl8AKH3B0hj9q10+h3Kt8I7KlW4tw==", "requires": { "cookie": "0.3.1", "cookie-signature": "1.0.6" diff --git a/package.json b/package.json index 04c2017c..e0796cc2 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@google-cloud/storage": "^2.4.2", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.4", - "cookie-parser": "~1.4.3", + "cookie-parser": "~1.4.4", "cookie-session": "^2.0.0-beta.3", "cors": "^2.8.5", "cryptiles": "^4.1.3", From 2e97f613843b0b9b90c212a655d28afdd3c4d8df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 14 Feb 2019 00:14:12 +0000 Subject: [PATCH 019/243] Bump @types/mongoose from 5.3.15 to 5.3.16 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.3.15 to 5.3.16. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a0bbaa5..089af7eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -567,9 +567,9 @@ } }, "@types/mongoose": { - "version": "5.3.15", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.15.tgz", - "integrity": "sha512-Pj64zQumjylyhNz4sTYVl4ua2dU/ei/6iwXR3DlTXPO+DcmWDk972sUiI0+jpX3e6bXjO06fpq5ADVzGz4PVmw==", + "version": "5.3.16", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.16.tgz", + "integrity": "sha512-L/1BFYDbJ8EjQ1ApCIRAJH5j4t2Dre9mCyKsi16029iy3Rfyvb1ooPTNJOmGQ5sfDcFM1XoyAjCI2mLYv5PvKg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index e0796cc2..463ef4a6 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.15", + "@types/mongoose": "^5.3.16", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai-http": "^4.2.1", From dab3bec98b5aa7f64887f0af4d5df7029b4c17fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 14 Feb 2019 00:39:06 +0000 Subject: [PATCH 020/243] Bump mongoose from 5.4.11 to 5.4.12 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.11 to 5.4.12. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.11...5.4.12) Signed-off-by: dependabot[bot] --- package-lock.json | 13 +++++++++---- package.json | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 089af7eb..7c7c4a1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5412,9 +5412,9 @@ } }, "mongoose": { - "version": "5.4.11", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.11.tgz", - "integrity": "sha512-Ah/JaZj4vhYP2CEjIy1ictJguzGJczHMtUQmLrBUpnQ4WhhQl5jOo6JHzKiRJ/PdLV25y22kt8WOdsc0DIojww==", + "version": "5.4.12", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.12.tgz", + "integrity": "sha512-+Xlw2JhARps/yAtMaWluJnHAidk+v38YhJNu1nX4RYleQIyXYnzFlANoD01vZyZL8X6PjOwkWDjnMFbfyy9Shg==", "requires": { "async": "2.6.1", "bson": "~1.1.0", @@ -5424,12 +5424,17 @@ "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.5.1", "mquery": "3.2.0", - "ms": "2.0.0", + "ms": "2.1.1", "regexp-clone": "0.0.1", "safe-buffer": "5.1.2", "sliced": "1.0.1" }, "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", diff --git a/package.json b/package.json index 463ef4a6..5e07b6ff 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.1.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.11", + "mongoose": "^5.4.12", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 43c71560418fd4e89298a5ee2fa43fd85c4e37dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 14 Feb 2019 21:51:32 +0000 Subject: [PATCH 021/243] Bump @types/mongoose from 5.3.16 to 5.3.17 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.3.16 to 5.3.17. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7c7c4a1a..991b2ad1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -567,9 +567,9 @@ } }, "@types/mongoose": { - "version": "5.3.16", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.16.tgz", - "integrity": "sha512-L/1BFYDbJ8EjQ1ApCIRAJH5j4t2Dre9mCyKsi16029iy3Rfyvb1ooPTNJOmGQ5sfDcFM1XoyAjCI2mLYv5PvKg==", + "version": "5.3.17", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.17.tgz", + "integrity": "sha512-LkddA9pB/c2H3en2wFkHLOTUJJ8i/gzCs3R9fh1VkL0vJnZo3av/lJleVoKe6h6puB0S7Uy+NSLDkR5QTNbSfg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 5e07b6ff..5f7ab5a8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.16", + "@types/mongoose": "^5.3.17", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai-http": "^4.2.1", From 95af57554fec436828067cee26e6107cce21c52c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 15 Feb 2019 19:22:05 +0000 Subject: [PATCH 022/243] Bump mongoose from 5.4.12 to 5.4.13 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.12 to 5.4.13. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.12...5.4.13) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 991b2ad1..a407ddd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5412,9 +5412,9 @@ } }, "mongoose": { - "version": "5.4.12", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.12.tgz", - "integrity": "sha512-+Xlw2JhARps/yAtMaWluJnHAidk+v38YhJNu1nX4RYleQIyXYnzFlANoD01vZyZL8X6PjOwkWDjnMFbfyy9Shg==", + "version": "5.4.13", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.13.tgz", + "integrity": "sha512-4dgmFbtNECbW3ZMS6ha2pebinUzZo789scdccdyyajbmaunBPqZJqp6eO6pThIqDsgSOkRi4IrzkZm8kmhtZMA==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 5f7ab5a8..4a0990d1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.1.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.12", + "mongoose": "^5.4.13", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 62eec504db3760989edb8d25eae96cea2b393f9c Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Sat, 16 Feb 2019 18:07:22 -0500 Subject: [PATCH 023/243] =?UTF-8?q?Ugprade=20jshint=20for=20async=20/=20aw?= =?UTF-8?q?ait=20support=20=F0=9F=8E=89=20(#356)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .jshintrc | 158 +++++++++++++++++++++++----------------------- package-lock.json | 41 ++++-------- package.json | 2 +- 3 files changed, 91 insertions(+), 110 deletions(-) diff --git a/.jshintrc b/.jshintrc index 88677899..cfbc9e06 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,90 +2,90 @@ // JSHint Default Configuration File (as on JSHint website) // See http://jshint.com/docs/ for more details - "maxerr" : 50, // {int} Maximum error before stopping + "maxerr": 50, // {int} Maximum error before stopping // Enforcing - "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) - "camelcase" : true, // true: Identifiers must be in camelCase - "curly" : true, // true: Require {} for every new block or scope - "eqeqeq" : true, // true: Require triple equals (===) for comparison - "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() - "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. - "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "latedef" : false, // true: Require variables/functions to be defined before being used - "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "noempty" : true, // true: Prohibit use of empty blocks - "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. - "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) - "plusplus" : false, // true: Prohibit use of `++` and `--` - "quotmark" : true, // Quotation mark consistency: - // false : do nothing (default) - // true : ensure whatever is used is consistent - // "single" : require single quotes - // "double" : require double quotes - "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) - "unused" : true, // Unused variables: - // true : all variables, last function parameter - // "vars" : all variables only - // "strict" : all variables, all function parameters - "strict" : true, // true: Requires all functions run in ES5 Strict Mode - "maxparams" : false, // {int} Max number of formal params allowed per function - "maxdepth" : false, // {int} Max depth of nested blocks (within functions) - "maxstatements" : false, // {int} Max number statements per function - "maxcomplexity" : false, // {int} Max cyclomatic complexity per function - "maxlen" : false, // {int} Max number of characters per line - "varstmt" : false, // true: Disallow any var statements. Only `let` and `const` are allowed. + "bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.) + "camelcase": true, // true: Identifiers must be in camelCase + "curly": true, // true: Require {} for every new block or scope + "eqeqeq": true, // true: Require triple equals (===) for comparison + "forin": true, // true: Require filtering for..in loops with obj.hasOwnProperty() + "freeze": true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. + "immed": false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` + "latedef": false, // true: Require variables/functions to be defined before being used + "newcap": false, // true: Require capitalization of all constructor functions e.g. `new F()` + "noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee` + "noempty": true, // true: Prohibit use of empty blocks + "nonbsp": true, // true: Prohibit "non-breaking whitespace" characters. + "nonew": false, // true: Prohibit use of constructors for side-effects (without assignment) + "plusplus": false, // true: Prohibit use of `++` and `--` + "quotmark": true, // Quotation mark consistency: + // false : do nothing (default) + // true : ensure whatever is used is consistent + // "single" : require single quotes + // "double" : require double quotes + "undef": true, // true: Require all non-global variables to be declared (prevents global leaks) + "unused": true, // Unused variables: + // true : all variables, last function parameter + // "vars" : all variables only + // "strict" : all variables, all function parameters + "strict": true, // true: Requires all functions run in ES5 Strict Mode + "maxparams": false, // {int} Max number of formal params allowed per function + "maxdepth": false, // {int} Max depth of nested blocks (within functions) + "maxstatements": false, // {int} Max number statements per function + "maxcomplexity": false, // {int} Max cyclomatic complexity per function + "maxlen": false, // {int} Max number of characters per line + "varstmt": false, // true: Disallow any var statements. Only `let` and `const` are allowed. // Relaxing - "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) - "boss" : false, // true: Tolerate assignments where comparisons would be expected - "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // true: Tolerate use of `== null` - "esversion" : 6, // {int} Specify the ECMAScript version to which the code must adhere. - "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) - // (ex: `for each`, multiple try/catch, function expression…) - "evil" : false, // true: Tolerate use of `eval` and `new Function()` - "expr" : false, // true: Tolerate `ExpressionStatement` as Programs - "funcscope" : false, // true: Tolerate defining variables inside control statements - "globalstrict" : true, // true: Allow global "use strict" (also enables 'strict') - "iterator" : false, // true: Tolerate using the `__iterator__` property - "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block - "laxbreak" : false, // true: Tolerate possibly unsafe line breakings - "laxcomma" : false, // true: Tolerate comma-first style coding - "loopfunc" : false, // true: Tolerate functions being defined in loops - "multistr" : false, // true: Tolerate multi-line strings - "noyield" : false, // true: Tolerate generator functions with no yield statement in them. - "notypeof" : false, // true: Tolerate invalid typeof operator values - "proto" : false, // true: Tolerate using the `__proto__` property - "scripturl" : false, // true: Tolerate script-targeted URLs - "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` - "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` - "validthis" : true, // true: Tolerate using this in a non-constructor function + "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) + "boss": false, // true: Tolerate assignments where comparisons would be expected + "debug": false, // true: Allow debugger statements e.g. browser breakpoints. + "eqnull": false, // true: Tolerate use of `== null` + "esversion": 9, // {int} Specify the ECMAScript version to which the code must adhere. + "moz": false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) + // (ex: `for each`, multiple try/catch, function expression…) + "evil": false, // true: Tolerate use of `eval` and `new Function()` + "expr": false, // true: Tolerate `ExpressionStatement` as Programs + "funcscope": false, // true: Tolerate defining variables inside control statements + "globalstrict": true, // true: Allow global "use strict" (also enables 'strict') + "iterator": false, // true: Tolerate using the `__iterator__` property + "lastsemic": false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block + "laxbreak": false, // true: Tolerate possibly unsafe line breakings + "laxcomma": false, // true: Tolerate comma-first style coding + "loopfunc": false, // true: Tolerate functions being defined in loops + "multistr": false, // true: Tolerate multi-line strings + "noyield": false, // true: Tolerate generator functions with no yield statement in them. + "notypeof": false, // true: Tolerate invalid typeof operator values + "proto": false, // true: Tolerate using the `__proto__` property + "scripturl": false, // true: Tolerate script-targeted URLs + "shadow": false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` + "sub": false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation + "supernew": false, // true: Tolerate `new function () { ... };` and `new Object;` + "validthis": true, // true: Tolerate using this in a non-constructor function // Environments - "browser" : true, // Web Browser (window, document, etc) - "browserify" : false, // Browserify (node.js code in the browser) - "couch" : false, // CouchDB - "devel" : true, // Development/debugging (alert, confirm, etc) - "dojo" : false, // Dojo Toolkit - "jasmine" : false, // Jasmine - "jquery" : false, // jQuery - "mocha" : true, // Mocha - "mootools" : false, // MooTools - "node" : true, // Node.js - "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) - "phantom" : false, // PhantomJS - "prototypejs" : false, // Prototype and Scriptaculous - "qunit" : false, // QUnit - "rhino" : false, // Rhino - "shelljs" : false, // ShellJS - "typed" : false, // Globals for typed array constructions - "worker" : false, // Web Workers - "wsh" : false, // Windows Scripting Host - "yui" : false, // Yahoo User Interface + "browser": true, // Web Browser (window, document, etc) + "browserify": false, // Browserify (node.js code in the browser) + "couch": false, // CouchDB + "devel": true, // Development/debugging (alert, confirm, etc) + "dojo": false, // Dojo Toolkit + "jasmine": false, // Jasmine + "jquery": false, // jQuery + "mocha": true, // Mocha + "mootools": false, // MooTools + "node": true, // Node.js + "nonstandard": false, // Widely adopted globals (escape, unescape, etc) + "phantom": false, // PhantomJS + "prototypejs": false, // Prototype and Scriptaculous + "qunit": false, // QUnit + "rhino": false, // Rhino + "shelljs": false, // ShellJS + "typed": false, // Globals for typed array constructions + "worker": false, // Web Workers + "wsh": false, // Windows Scripting Host + "yui": false, // Yahoo User Interface // Custom Globals - "globals" : {} // additional predefined global variables -} + "globals": {} // additional predefined global variables +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a407ddd2..a3e4449e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2879,8 +2879,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -2901,14 +2900,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2923,20 +2920,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3053,8 +3047,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -3066,7 +3059,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3081,7 +3073,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3089,14 +3080,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3115,7 +3104,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3196,8 +3184,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -3209,7 +3196,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3295,8 +3281,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -3332,7 +3317,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3352,7 +3336,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3396,14 +3379,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, diff --git a/package.json b/package.json index 4a0990d1..2d4d2f44 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "@types/mongoose": "^5.3.17", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", - "chai-http": "^4.2.1", "chai": "^4.2.0", + "chai-http": "^4.2.1", "jshint": "^2.10.1", "jslint": "^0.12.1", "mocha": "^5.2.0", From 6a9c3049a8ed8a5f062f24117f2bd7fd3d2a86e8 Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 18 Feb 2019 16:48:20 -0500 Subject: [PATCH 024/243] Feature/333 settings (#344) * WIP * Add settings GET and PATCH * Update docs * Update docs * Update docs to include inputs * Add tests * Integrate tests * Bugfix * Change entry point of launch.json config * Clean up tests * Fix tests * Add parsebody.middleware * bugfix with message * Fix depreciation warning * Fix function naming --- .vscode/launch.json | 16 + app.js | 3 + constants/error.constant.js | 2 + constants/role.constant.js | 3 +- constants/routes.constant.js | 13 + constants/success.constant.js | 7 + controllers/settings.controller.js | 36 + docs/api/api_data.js | 122 +- docs/api/api_data.json | 2107 +++++++++++------- docs/api/api_project.js | 2 +- docs/api/api_project.json | 2 +- middlewares/settings.middleware.js | 81 + middlewares/validators/settings.validator.js | 10 + models/settings.model.js | 27 + routes/api/settings.js | 85 + services/database.service.js | 3 +- services/settings.service.js | 35 + tests/settings.test.js | 100 + tests/setup.spec.js | 3 + tests/util/settings.test.util.js | 52 + 20 files changed, 1898 insertions(+), 811 deletions(-) create mode 100644 controllers/settings.controller.js create mode 100644 middlewares/settings.middleware.js create mode 100644 middlewares/validators/settings.validator.js create mode 100644 models/settings.model.js create mode 100644 routes/api/settings.js create mode 100644 services/settings.service.js create mode 100644 tests/settings.test.js create mode 100644 tests/util/settings.test.util.js diff --git a/.vscode/launch.json b/.vscode/launch.json index 10ed6eb2..b8ba1518 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -148,6 +148,22 @@ ], "internalConsoleOptions": "openOnSessionStart" }, + { + "type": "node", + "request": "launch", + "name": "Mocha Tests - Settings", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "-u", + "tdd", + "--timeout", + "999999", + "--colors", + "${workspaceFolder}/tests/setup.spec.js", + "${workspaceFolder}/tests/settings.test.js" + ], + "internalConsoleOptions": "openOnSessionStart" + }, { "type": "node", "request": "launch", diff --git a/app.js b/app.js index b169fa01..875b13fc 100755 --- a/app.js +++ b/app.js @@ -27,6 +27,7 @@ const hackerRouter = require("./routes/api/hacker"); const teamRouter = require("./routes/api/team"); const sponsorRouter = require("./routes/api/sponsor"); const searchRouter = require("./routes/api/search"); +const settingsRouter = require("./routes/api/settings"); const volunteerRouter = require("./routes/api/volunteer"); const roleRouter = require("./routes/api/role"); @@ -84,6 +85,8 @@ volunteerRouter.activate(apiRouter); Services.log.info("Volunteer router activated"); searchRouter.activate(apiRouter); Services.log.info("Search router activated"); +settingsRouter.activate(apiRouter); +Services.log.info("Settings router activated"); roleRouter.activate(apiRouter); Services.log.info("Role router activated"); diff --git a/constants/error.constant.js b/constants/error.constant.js index 4f497044..dff30408 100644 --- a/constants/error.constant.js +++ b/constants/error.constant.js @@ -6,6 +6,7 @@ const TEAM_404_MESSAGE = "Team not found"; const RESUME_404_MESSAGE = "Resume not found"; const SPONSOR_404_MESSAGE = "Sponsor not found"; const VOLUNTEER_404_MESSAGE = "Volunteer not found"; +const SETTINGS_404_MESSAGE = "Settings not found"; const ACCOUNT_TYPE_409_MESSAGE = "Wrong account type"; const SPONSOR_ID_409_MESSAGE = "Conflict with sponsor accountId link"; @@ -79,4 +80,5 @@ module.exports = { TEAM_READ_500_MESSAGE: TEAM_READ_500_MESSAGE, VOLUNTEER_404_MESSAGE: VOLUNTEER_404_MESSAGE, SPONSOR_UPDATE_500_MESSAGE: SPONSOR_UPDATE_500_MESSAGE, + SETTINGS_404_MESSAGE: SETTINGS_404_MESSAGE }; \ No newline at end of file diff --git a/constants/role.constant.js b/constants/role.constant.js index 39ef3713..04026c0a 100644 --- a/constants/role.constant.js +++ b/constants/role.constant.js @@ -15,7 +15,8 @@ const accountRole = { Constants.Routes.authRoutes.getSelfRoleBindindings, Constants.Routes.accountRoutes.getSelf, Constants.Routes.accountRoutes.getSelfById, - Constants.Routes.accountRoutes.patchSelfById + Constants.Routes.accountRoutes.patchSelfById, + Constants.Routes.settingsRoutes.getSettings, ] }; diff --git a/constants/routes.constant.js b/constants/routes.constant.js index 161e4c00..d5bd5a91 100644 --- a/constants/routes.constant.js +++ b/constants/routes.constant.js @@ -241,6 +241,17 @@ const staffRoutes = { } +const settingsRoutes = { + "getSettings": { + requestType: Constants.REQUEST_TYPES.GET, + uri: "/api/settings" + }, + "patchSettings": { + requestType: Constants.REQUEST_TYPES.PATCH, + uri: "/api/settings" + }, +} + const allRoutes = { "Auth": authRoutes, "Account": accountRoutes, @@ -250,6 +261,7 @@ const allRoutes = { "Volunteer": volunteerRoutes, "Role": roleRoutes, "Search": searchRoutes, + "Settings": settingsRoutes, "Staff": staffRoutes, }; @@ -288,6 +300,7 @@ module.exports = { volunteerRoutes: volunteerRoutes, roleRoutes: roleRoutes, searchRoutes: searchRoutes, + settingsRoutes: settingsRoutes, staffRoutes: staffRoutes, allRoutes: allRoutes, listAllRoutes: listAllRoutes, diff --git a/constants/success.constant.js b/constants/success.constant.js index 9204650c..6820d13f 100644 --- a/constants/success.constant.js +++ b/constants/success.constant.js @@ -32,6 +32,10 @@ const ROLE_CREATE = "Role creation successful."; const SEARCH_QUERY = "Query search successful. Returning results."; const SEARCH_NO_RESULTS = "Query search successful. No results found."; +const SETTINGS_PATCH = "Settings update successful."; +const SETTINGS_GET = "Settings get successful."; + + const SPONSOR_GET_BY_ID = "Sponsor found by id."; const SPONSOR_READ = "Sponsor retrieval successful."; const SPONSOR_CREATE = "Sponsor creation successful."; @@ -80,6 +84,9 @@ module.exports = { SEARCH_QUERY: SEARCH_QUERY, SEARCH_NO_RESULTS: SEARCH_NO_RESULTS, + SETTINGS_GET: SETTINGS_GET, + SETTINGS_PATCH: SETTINGS_PATCH, + SPONSOR_GET_BY_ID: SPONSOR_GET_BY_ID, SPONSOR_CREATE: SPONSOR_CREATE, SPONSOR_READ: SPONSOR_READ, diff --git a/controllers/settings.controller.js b/controllers/settings.controller.js new file mode 100644 index 00000000..550e3c4c --- /dev/null +++ b/controllers/settings.controller.js @@ -0,0 +1,36 @@ +"use strict"; + +const Success = require("../constants/success.constant"); + +/** + * @function gotSettings + * @param {{body: {settingsDetails: Object}}} req + * @param {*} res + * @return {JSON} Success status and settings object + * @description Returns the JSON of settings object located in req.body.settingsDetails + */ +function gotSettings(req, res) { + return res.status(200).json({ + message: Success.SETTINGS_GET, + data: req.body.settingsDetails.toJSON(), + }); +} + +/** + * @function patchedSettings + * @param {{body: {settingsDetails: Object}}} req + * @param {*} res + * @return {JSON} Success status and settings object + * @description Returns the JSON of settings object located in req.body.settingsDetails + */ +function patchedSettings(req, res) { + return res.status(200).json({ + message: Success.SETTINGS_PATCH, + data: req.body.settingsDetails, + }); +} + +module.exports = { + gotSettings: gotSettings, + patchedSettings: patchedSettings +}; \ No newline at end of file diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 78aec409..4cc31425 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1257,7 +1257,7 @@ define({ }, { "type": "get", - "url": "/hacker/email/:email", + "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1268,8 +1268,8 @@ define({ "group": "param", "type": "String", "optional": false, - "field": "email", - "description": "

a hacker's unique email

" + "field": "id", + "description": "

a hacker's unique mongoID

" }] } }, @@ -1324,12 +1324,12 @@ define({ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" + "url": "https://api.mchacks.ca/api/hacker/:id" }] }, { "type": "get", - "url": "/hacker/:id", + "url": "/hacker/email/:email", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1340,8 +1340,8 @@ define({ "group": "param", "type": "String", "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" + "field": "email", + "description": "

a hacker's unique email

" }] } }, @@ -1396,7 +1396,7 @@ define({ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" + "url": "https://api.mchacks.ca/api/hacker/email/:email" }] }, { @@ -2248,6 +2248,112 @@ define({ "url": "https://api.mchacks.ca/api/search/" }] }, + { + "type": "get", + "url": "/settings/", + "title": "Get the settings for the current hackathon", + "name": "getSettings", + "group": "Settings", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "public" + }], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/settings/" + }] + }, + { + "type": "patch", + "url": "/settings/", + "title": "Patch the settings for the current hackathon", + "name": "patchSettings", + "group": "Settings", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "Date", + "optional": true, + "field": "openTime", + "description": "

The opening time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "closeTime", + "description": "

The closing time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "confirmTime", + "description": "

The deadline for confirmation for the hackathon.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "Administrators" + }], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/settings/" + }] + }, { "type": "post", "url": "/sponsor/", diff --git a/docs/api/api_data.json b/docs/api/api_data.json index 75ac6685..6aad836e 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1,4 +1,5 @@ -[{ +[ + { "type": "post", "url": "/account/", "title": "create a new account", @@ -7,7 +8,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -71,23 +73,28 @@ "description": "

the user's phone number, represented as a string.

" } ], - "header": [{ - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - }] + "header": [ + { + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -103,15 +110,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -127,17 +137,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/" + } + ] }, { "type": "get", @@ -148,18 +162,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -175,15 +192,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -199,17 +219,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] }, { "type": "get", @@ -220,17 +244,21 @@ "version": "0.0.8", "description": "

Get all of the invites that currently exist in the database.

", "success": { - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] }, { "type": "post", @@ -242,7 +270,8 @@ "description": "

sends link with token to be used with the account/create route

", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -261,7 +290,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -277,15 +307,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -301,17 +334,21 @@ } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] }, { "type": "get", @@ -322,7 +359,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -338,15 +376,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -362,17 +403,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/self" + } + ] }, { "type": "patch", @@ -383,7 +428,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -441,15 +487,18 @@ } ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"shirtSize\": \"M\" }", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -465,15 +514,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -489,17 +541,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] }, { "type": "patch", @@ -510,7 +566,8 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ + "Parameter": [ + { "group": "Parameter", "type": "String", "optional": false, @@ -526,15 +583,18 @@ } ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -550,20 +610,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": Must be logged in" - }], + "permission": [ + { + "name": ": Must be logged in" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/change" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/change" + } + ] }, { "type": "post", @@ -574,18 +640,21 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -601,15 +670,18 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -625,17 +697,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/:token" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] }, { "type": "post", @@ -646,23 +722,28 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + } + ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -678,20 +759,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/forgot" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/forgot" + } + ] }, { "type": "get", @@ -702,18 +789,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -729,15 +819,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -753,17 +846,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] }, { "type": "get", @@ -775,7 +872,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -791,17 +889,21 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/roles" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/roles" + } + ] }, { "type": "post", @@ -812,7 +914,8 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ + "Parameter": [ + { "group": "Parameter", "type": "string", "optional": false, @@ -831,7 +934,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -847,15 +951,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -871,20 +978,26 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/login" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/login" + } + ] }, { "type": "get", @@ -895,7 +1008,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -911,20 +1025,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/logout" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/logout" + } + ] }, { "type": "get", @@ -935,7 +1055,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -951,15 +1072,18 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -975,7 +1099,8 @@ } ] }, - "examples": [{ + "examples": [ + { "title": "Error-Response:", "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", "type": "json" @@ -989,9 +1114,11 @@ }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/resend" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] }, { "type": "post", @@ -1002,39 +1129,48 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + } + ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" + } + ] }, "header": { "fields": { - "Header": [{ - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - }] + "Header": [ + { + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + } + ] }, - "examples": [{ - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - }] + "examples": [ + { + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1050,20 +1186,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": must have authentication token" - }], + "permission": [ + { + "name": ": must have authentication token" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/reset" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/reset" + } + ] }, { "type": "patch", @@ -1074,18 +1216,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1101,13 +1246,16 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ + "permission": [ + { "name": "Administrator" }, { @@ -1116,9 +1264,11 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] }, { "type": "post", @@ -1129,7 +1279,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "MongoID", "optional": false, @@ -1194,15 +1345,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1218,15 +1372,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -1242,39 +1399,46 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/" + } + ] }, { "type": "get", - "url": "/hacker/email/:email", + "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - }] + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1290,15 +1454,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1314,39 +1481,46 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] }, { "type": "get", - "url": "/hacker/:id", + "url": "/hacker/email/:email", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1362,15 +1536,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1386,17 +1563,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/:email" + } + ] }, { "type": "get", @@ -1407,50 +1588,62 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ] } }, "success": { "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }] + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + } + ] }, - "examples": [{ - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - }] - }, - "examples": [{ - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker" }, @@ -1463,7 +1656,8 @@ "version": "0.0.9", "parameter": { "fields": { - "query": [{ + "query": [ + { "group": "query", "type": "String", "optional": false, @@ -1482,7 +1676,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1498,17 +1693,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/stats" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/stats" + } + ] }, { "type": "patch", @@ -1520,7 +1719,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -1571,15 +1771,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1595,15 +1798,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -1619,17 +1825,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] }, { "type": "patch", @@ -1640,18 +1850,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1667,13 +1880,16 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ + "permission": [ + { "name": "Administrator" }, { @@ -1682,9 +1898,11 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] }, { "type": "patch", @@ -1695,18 +1913,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1722,20 +1943,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/status/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/status/:id" + } + ] }, { "type": "post", @@ -1747,25 +1974,30 @@ "description": "

NOTE: This must be sent via multipart/form-data POST request

", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }], - "body": [{ - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ], + "body": [ + { + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1781,20 +2013,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" + } + ] }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/resume/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] }, { "type": "post", @@ -1806,18 +2044,21 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1833,20 +2074,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] }, { "type": "post", @@ -1858,18 +2105,21 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1885,20 +2135,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] }, { "type": "get", @@ -1909,7 +2165,8 @@ "version": "1.4.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1925,15 +2182,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1949,20 +2209,26 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": Sponsor" - }], + "permission": [ + { + "name": ": Sponsor" + } + ], "filename": "routes/api/sponsor.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/self" + } + ] }, { "type": "get", @@ -1973,7 +2239,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1989,15 +2256,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2013,17 +2283,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/self" + } + ] }, { "type": "get", @@ -2032,14 +2306,18 @@ "version": "0.0.8", "name": "index", "group": "Index", - "permission": [{ - "name": "public" - }], + "permission": [ + { + "name": "public" + } + ], "filename": "routes/index.js", "groupTitle": "Index", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/" + } + ] }, { "type": "post", @@ -2050,7 +2328,8 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2066,15 +2345,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2090,15 +2372,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2114,17 +2399,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/role.js", "groupTitle": "Role", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/api/role/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/api/role/" + } + ] }, { "type": "get", @@ -2135,7 +2424,8 @@ "version": "0.0.8", "parameter": { "fields": { - "query": [{ + "query": [ + { "group": "query", "type": "String", "optional": false, @@ -2189,7 +2479,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2205,7 +2496,8 @@ } ] }, - "examples": [{ + "examples": [ + { "title": "Success-Response:", "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", "type": "object" @@ -2219,7 +2511,8 @@ }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2235,17 +2528,142 @@ } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/search.js", "groupTitle": "Search", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/search/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/search/" + } + ] + }, + { + "type": "get", + "url": "/settings/", + "title": "Get the settings for the current hackathon", + "name": "getSettings", + "group": "Settings", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "public" + } + ], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + "type": "patch", + "url": "/settings/", + "title": "Patch the settings for the current hackathon", + "name": "patchSettings", + "group": "Settings", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "Date", + "optional": true, + "field": "openTime", + "description": "

The opening time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "closeTime", + "description": "

The closing time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "confirmTime", + "description": "

The deadline for confirmation for the hackathon.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrators" + } + ], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] }, { "type": "post", @@ -2256,7 +2674,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "MongoID", "optional": false, @@ -2296,7 +2715,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2312,15 +2732,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2336,17 +2759,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] }, { "type": "get", @@ -2357,18 +2784,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2384,15 +2814,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2408,17 +2841,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/:id" + } + ] }, { "type": "patch", @@ -2429,14 +2866,17 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - }], - "body": [{ + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + } + ], + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2462,7 +2902,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2478,15 +2919,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2502,17 +2946,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] }, { "type": "post", @@ -2523,7 +2971,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2549,7 +2998,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2565,15 +3015,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2589,17 +3042,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/" + } + ] }, { "type": "patch", @@ -2610,7 +3067,8 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2626,17 +3084,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/leave/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/leave/" + } + ] }, { "type": "get", @@ -2647,18 +3109,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2674,15 +3139,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2698,17 +3166,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:id" + } + ] }, { "type": "patch", @@ -2719,18 +3191,21 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2746,17 +3221,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/join/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/join/" + } + ] }, { "type": "patch", @@ -2768,18 +3247,21 @@ "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2795,15 +3277,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2819,17 +3304,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:hackerId" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:hackerId" + } + ] }, { "type": "post", @@ -2840,18 +3329,21 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - }] + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2867,15 +3359,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2891,17 +3386,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/" + } + ] }, { "type": "get", @@ -2912,18 +3411,21 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2939,15 +3441,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2963,16 +3468,20 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/:id" + } + ] } -] \ No newline at end of file +] diff --git a/docs/api/api_project.js b/docs/api/api_project.js index a30d316c..50871819 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -9,7 +9,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-02T19:22:47.311Z", + "time": "2019-02-07T00:12:02.506Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/docs/api/api_project.json b/docs/api/api_project.json index 149ba493..2ca1c771 100644 --- a/docs/api/api_project.json +++ b/docs/api/api_project.json @@ -9,7 +9,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-02T19:22:47.311Z", + "time": "2019-02-07T00:12:02.506Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/middlewares/settings.middleware.js b/middlewares/settings.middleware.js new file mode 100644 index 00000000..35c788a8 --- /dev/null +++ b/middlewares/settings.middleware.js @@ -0,0 +1,81 @@ +const Services = { + Settings: require("../services/settings.service"), + Account: require("../services/account.service"), +}; +const Middleware = { + Util: require("./util.middleware") +}; +const Constants = { + Error: require("../constants/error.constant"), +}; +const Settings = require("../models/settings.model"); + +/** + * @function parsePatch + * @param {body: *} req + * @param {*} res + * @param {(err?) => void} next + * @return {void} + * @description Put relevent settings attributes into settingsDetails + */ +function parsePatch(req, res, next) { + let settingsDetails = {}; + + for (const val in req.body) { + // use .hasOwnProperty instead of 'in' to get rid of inherited properties such as 'should' + if (Settings.schema.paths.hasOwnProperty(val)) { + settingsDetails[val] = req.body[val]; + delete req.body[val]; + } + } + + req.body.settingsDetails = settingsDetails; + return next(); +} + +/** + * @function updateSettings + * @param {body: *} req + * @param {*} res + * @param {(err?) => void} next + * @return {void} + * @description Update settings object + */ +async function updateSettings(req, res, next) { + const settings = await Services.Settings.updateSettings(req.body.settingsDetails); + if (!settings) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE + }); + } else { + next(); + } +} + +/** + * @function updateSettings + * @param {*} req + * @param {*} res + * @param {(err?) => void} next + * @return {void} + * @description get the settings object and puts it in the settingsDetails. + */ +async function getSettings(req, res, next) { + const settings = await Services.Settings.getSettings(); + if (!settings) { + return next({ + status: 404, + message: Constants.Error.SETTINGS_404_MESSAGE + }); + } else { + req.body.settingsDetails = settings; + next(); + } +} + +module.exports = { + parsePatch: parsePatch, + updateSettings: Middleware.Util.asyncMiddleware(updateSettings), + getSettings: Middleware.Util.asyncMiddleware(getSettings), +} \ No newline at end of file diff --git a/middlewares/validators/settings.validator.js b/middlewares/validators/settings.validator.js new file mode 100644 index 00000000..8ce343c2 --- /dev/null +++ b/middlewares/validators/settings.validator.js @@ -0,0 +1,10 @@ +"use strict"; +const VALIDATOR = require("./validator.helper"); + +module.exports = { + createSettingsValidator: [ + VALIDATOR.dateValidator("body", "openTime", true), + VALIDATOR.dateValidator("body", "closeTime", true), + VALIDATOR.dateValidator("body", "confirmTime", true), + ], +}; \ No newline at end of file diff --git a/models/settings.model.js b/models/settings.model.js new file mode 100644 index 00000000..45934db3 --- /dev/null +++ b/models/settings.model.js @@ -0,0 +1,27 @@ +"use strict"; +const mongoose = require("mongoose"); +//describes the data type +const settings = new mongoose.Schema({ + openTime: { + type: Date, + default: 0 + }, + closeTime: { + type: Date, + default: Date.now() + 31104000000 // Add a year from now. + }, + confirmTime: { + type: Date, + default: Date.now() + 31104000000 + 2628000000 // 1 year and 1 month from now. + } +}); + +settings.methods.toJSON = function () { + const ss = this.toObject(); + delete ss.__v; + ss.id = ss._id; + delete ss._id; + return ss; +}; +//export the model +module.exports = mongoose.model("Settings", settings); \ No newline at end of file diff --git a/routes/api/settings.js b/routes/api/settings.js new file mode 100644 index 00000000..d379e9dd --- /dev/null +++ b/routes/api/settings.js @@ -0,0 +1,85 @@ +"use strict"; + +const express = require("express"); +const Controllers = { + Settings: require("../../controllers/settings.controller") +}; +const Middleware = { + Validator: { + /* Insert the require statement to the validator file here */ + Settings: require("../../middlewares/validators/settings.validator"), + }, + /* Insert all of ther middleware require statements here */ + parseBody: require("../../middlewares/parse-body.middleware"), + Settings: require("../../middlewares/settings.middleware"), + Auth: require("../../middlewares/auth.middleware") +}; + +module.exports = { + activate: function (apiRouter) { + const settingsRouter = express.Router(); + + /** + * @api {get} /settings/ Get the settings for the current hackathon + * @apiName getSettings + * @apiGroup Settings + * @apiVersion 1.1.1 + * + * @apiSuccess {string} message Success message + * @apiSuccess {object} data Settings Object + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Settings creation successful.", + * "data": { + * "settings": { + * openTime: "Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)", + * closeTime: "Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)", + * confirmTime: "Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)" + * } + * } + * } + * @apiPermission public + */ + settingsRouter.get('/', + Middleware.Settings.getSettings, + Controllers.Settings.gotSettings + ); + + /** + * @api {patch} /settings/ Patch the settings for the current hackathon + * @apiName patchSettings + * @apiGroup Settings + * @apiVersion 1.1.1 + * + * @apiParam (body) {Date} [openTime] The opening time for the hackathon. + * @apiParam (body) {Date} [closeTime] The closing time for the hackathon. + * @apiParam (body) {Date} [confirmTime] The deadline for confirmation for the hackathon. + * + * @apiSuccess {string} message Success message + * @apiSuccess {object} data Settings Object + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Settings patch successful.", + * "data": { + * "settings": { + * openTime: "Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)", + * closeTime: "Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)", + * confirmTime: "Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)" + * } + * } + * } + * @apiPermission Administrators + */ + settingsRouter.patch('/', + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([]), + Middleware.Validator.Settings.createSettingsValidator, + Middleware.parseBody.middleware, + Middleware.Settings.parsePatch, + Middleware.Settings.updateSettings, + Controllers.Settings.patchedSettings + ); + + apiRouter.use("/settings", settingsRouter); + } +}; \ No newline at end of file diff --git a/services/database.service.js b/services/database.service.js index 54facd8a..6e4979fb 100644 --- a/services/database.service.js +++ b/services/database.service.js @@ -46,7 +46,8 @@ module.exports = { logger.info(`${TAG} Connecting to db on ${url}`); mongoose.connect(url, { useNewUrlParser: true, - useCreateIndex: true + useCreateIndex: true, + useFindAndModify: false }).then(function () { logger.info(`${TAG} Connected to database on ${url}`); if (app) { diff --git a/services/settings.service.js b/services/settings.service.js new file mode 100644 index 00000000..78705622 --- /dev/null +++ b/services/settings.service.js @@ -0,0 +1,35 @@ +"use strict"; +const Settings = require("../models/settings.model"); +const logger = require("./logger.service"); + +/** + * @function updateSettings + * @param {{_id: ObjectId, openTime: Date, closeTime: Date, confirmTime: Date}} settingsDetails + * @return {Promise} The promise will resolve to a Settings object if save was successful. + * @description Adds a new setting to database. + */ +async function updateSettings(settingsDetails) { + const TAG = "[Setting service # updateSettings]:"; + const existingSetting = await getSettings(); + if (existingSetting) { + return Settings.findOneAndUpdate({}, settingsDetails, logger.queryCallbackFactory(TAG, "settings", {})) + } else { + const setting = new Settings(settingsDetails); + return setting.save(); + } +} + +/** + * @function getSettings + * @return {Promise} The promise will resolve to a Settings object if retrieval was successful. + * @description Returns the setting item + */ +function getSettings() { + const TAG = "[Setting service # getSettings]:"; + return Settings.findOne({}, logger.queryCallbackFactory(TAG, "settings", {})); +} + +module.exports = { + updateSettings: updateSettings, + getSettings: getSettings, +}; \ No newline at end of file diff --git a/tests/settings.test.js b/tests/settings.test.js new file mode 100644 index 00000000..eec1bd11 --- /dev/null +++ b/tests/settings.test.js @@ -0,0 +1,100 @@ +"use strict"; +const chai = require("chai"); +const chaiHttp = require("chai-http"); +chai.use(chaiHttp); +const server = require("../app"); +const agent = chai.request.agent(server.app); +chai.should(); +const util = { + account: require("./util/account.test.util"), + auth: require("./util/auth.test.util"), +}; + +const Constants = { + Success: require("../constants/success.constant"), + Error: require("../constants/error.constant"), +}; + +const invalidAccount = util.account.hackerAccounts.stored.noTeam[0]; +const Admin = util.account.staffAccounts.stored[0]; + + +describe("GET settings", function () { + it("should get the current settings", function (done) { + chai.request(server.app) + .get(`/api/settings/`) + // does not have password because of to stripped json + .end(function (err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.SETTINGS_GET); + done(); + }); + }); +}); + +describe("PATCH settings", function () { + it("should fail to update the settings due to lack of authentication", function (done) { + chai.request(server.app) + .patch(`/api/settings/`) + // does not have password because of to stripped json + .end(function (err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + it("should fail to update the settings due to lack of authorization", function (done) { + util.auth.login(agent, invalidAccount, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/settings/`) + .type("application/json") + .send({ + openTime: new Date().toString(), + closeTime: new Date().toString(), + confirmTime: new Date().toString(), + }) + // does not have password because of to stripped json + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + done(); + }); + }); + }); + it("should succeed to update the settings", function (done) { + util.auth.login(agent, Admin, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/settings/`) + .type("application/json") + .send({ + openTime: new Date().toString(), + closeTime: new Date().toString(), + confirmTime: new Date().toString(), + }) + // does not have password because of to stripped json + .end(function (err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.SETTINGS_PATCH); + done(); + }); + }); + + }); + +}) \ No newline at end of file diff --git a/tests/setup.spec.js b/tests/setup.spec.js index a369e2e1..40401601 100644 --- a/tests/setup.spec.js +++ b/tests/setup.spec.js @@ -8,6 +8,7 @@ const Util = { Hacker: require("./util/hacker.test.util"), Role: require("./util/role.test.util"), RoleBinding: require("./util/roleBinding.test.util"), + Settings: require("./util/settings.test.util"), Sponsor: require("./util/sponsor.test.util"), Staff: require("./util/staff.test.util"), Team: require("./util/team.test.util"), @@ -51,6 +52,7 @@ afterEach(function (done) { }); async function storeAll() { await Util.Account.storeAll(); + await Util.Settings.storeAll(); await Util.Hacker.storeAll(); await Util.Sponsor.storeAll(); await Util.Team.storeAll(); @@ -69,6 +71,7 @@ async function dropAll() { await Util.ResetPassword.dropAll(); await Util.AccountConfirmation.dropAll(); await Util.Volunteer.dropAll(); + await Util.Settings.dropAll(); await Util.Staff.dropAll(); await Util.Team.dropAll(); await Util.Sponsor.dropAll(); diff --git a/tests/util/settings.test.util.js b/tests/util/settings.test.util.js new file mode 100644 index 00000000..bb84e005 --- /dev/null +++ b/tests/util/settings.test.util.js @@ -0,0 +1,52 @@ +const Settings = require("../../models/settings.model"); +const logger = require("../../services/logger.service"); + +const settingRegistrationNotYetOpen = { + openTime: new Date(Date.now() + 100000000000), + closeTime: new Date(Date.now() + 10000000000000000), + confirmTime: new Date(Date.now() + 100000000000000000) +} + + +const settingRegistrationOpen = { + openTime: new Date(Date.now() - 100), + closeTime: new Date(Date.now() + 10000000000), + confirmTime: new Date(Date.now() + 100000000000000) +} + +const settingRegistrationClosed = { + openTime: new Date(Date.now() - 100), + closeTime: new Date(Date.now() - 1000), + confirmTime: new Date(Date.now() + 100000000000000) +} + +const settingConfirmClosed = { + openTime: new Date(Date.now() - 10000), + closeTime: new Date(Date.now() - 1000), + confirmTime: new Date(Date.now() - 100) +} + + +async function storeAll() { + const toStore = new Settings(settingRegistrationClosed); + Settings.collection.insertOne(toStore); +} +async function dropAll() { + try { + await Settings.collection.drop(); + } catch (e) { + if (e.code === 26) { + logger.info("namespace %s not found", Settings.collection.name); + } else { + throw e; + } + } +} +module.exports = { + storeAll: storeAll, + dropAll: dropAll, + settingRegistrationNotYetOpen: settingRegistrationNotYetOpen, + settingRegistrationOpen: settingRegistrationOpen, + settingRegistrationClosed: settingRegistrationClosed, + settingConfirmClosed: settingConfirmClosed, +} \ No newline at end of file From 92d14dd9ca513f5334e4dc8cece5ea73b7327bcd Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 18 Feb 2019 16:50:23 -0500 Subject: [PATCH 025/243] Make error routing use the error handler (#343) --- middlewares/account.middleware.js | 12 ++++++------ middlewares/hacker.middleware.js | 21 ++++++++++++--------- middlewares/sponsor.middleware.js | 7 +++++-- middlewares/team.middleware.js | 17 +++++++++++------ middlewares/volunteer.middleware.js | 3 ++- 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/middlewares/account.middleware.js b/middlewares/account.middleware.js index c47d5fb8..6233af93 100644 --- a/middlewares/account.middleware.js +++ b/middlewares/account.middleware.js @@ -94,9 +94,9 @@ async function getById(req, res, next) { const acc = await Services.Account.findById(req.body.id); if (!acc) { - return res.status(404).json({ - message: Constants.Error.ACCOUNT_404_MESSAGE, - data: {} + return next({ + status: 404, + message: Constants.Error.ACCOUNT_404_MESSAGE }); } @@ -115,9 +115,9 @@ async function getByEmail(req, res, next) { const acc = await Services.Account.findByEmail(req.user.email); if (!acc) { - return res.status(404).json({ - message: Constants.Error.ACCOUNT_404_MESSAGE, - data: {} + return next({ + status: 404, + message: Constants.Error.ACCOUNT_404_MESSAGE }); } diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index d1ab0c77..93b49ca3 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -169,9 +169,9 @@ async function findById(req, res, next) { const hacker = await Services.Hacker.findById(req.body.id); if (!hacker) { - return res.status(404).json({ - message: Constants.Error.HACKER_404_MESSAGE, - data: {} + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE }); } @@ -190,9 +190,10 @@ async function findByEmail(req, res, next) { } const hacker = await Services.Hacker.findByAccountId(account._id); if (!hacker) { - return res.status(404).json({ + return next({ + status: 404, message: Constants.Error.HACKER_404_MESSAGE, - data: {} + error: {} }); } @@ -527,9 +528,10 @@ async function checkDuplicateAccountLinks(req, res, next) { */ async function findSelf(req, res, next) { if (req.user.accountType != Constants.General.HACKER) { - return res.status(409).json({ + return next({ + status: 409, message: Constants.Error.ACCOUNT_TYPE_409_MESSAGE, - data: { + error: { id: req.user.id, } }); @@ -541,9 +543,10 @@ async function findSelf(req, res, next) { req.body.hacker = hacker; return next(); } else { - return res.status(404).json({ + return next({ + status: 409, message: Constants.Error.HACKER_404_MESSAGE, - data: { + error: { id: req.user.id, } }); diff --git a/middlewares/sponsor.middleware.js b/middlewares/sponsor.middleware.js index 339ada3d..ec1261bd 100644 --- a/middlewares/sponsor.middleware.js +++ b/middlewares/sponsor.middleware.js @@ -144,9 +144,12 @@ async function findById(req, res, next) { const sponsor = await Services.Sponsor.findById(req.body.id); if (!sponsor) { - return res.status(404).json({ + return next({ + status: 404, message: Constants.Error.SPONSOR_404_MESSAGE, - data: {} + error: { + id: req.user.id + } }); } diff --git a/middlewares/team.middleware.js b/middlewares/team.middleware.js index 830866e7..823473d4 100644 --- a/middlewares/team.middleware.js +++ b/middlewares/team.middleware.js @@ -67,7 +67,8 @@ async function createTeam(req, res, next) { const team = await Services.Team.createTeam(teamDetails); if (!team) { - return res.status(500).json({ + return next({ + status: 500, message: Constants.Error.TEAM_CREATE_500_MESSAGE, data: {} }); @@ -79,8 +80,9 @@ async function createTeam(req, res, next) { }); if (!hacker) { - return res.status(500).json({ - message: Constants.Error.HACKER_UPDATE_500_MESSAGE, + return next({ + status: 500, + message: Constants.Error.TEAM_CREATE_500_MESSAGE, data: {} }); } @@ -260,7 +262,8 @@ async function findById(req, res, next) { const team = await Services.Team.findById(req.body.id); if (!team) { - return res.status(404).json({ + return next({ + status: 404, message: Constants.Error.TEAM_404_MESSAGE, data: {} }); @@ -373,7 +376,8 @@ async function findById(req, res, next) { const team = await Services.Team.findById(req.body.id); if (!team) { - return res.status(404).json({ + return next({ + status: 404, message: Constants.Error.TEAM_404_MESSAGE, data: {} }); @@ -402,7 +406,8 @@ async function populateMemberAccountsById(req, res, next) { }); if (!team) { - return res.status(404).json({ + return next({ + status: 404, message: Constants.Error.TEAM_404_MESSAGE, data: {} }); diff --git a/middlewares/volunteer.middleware.js b/middlewares/volunteer.middleware.js index 225f1361..17f3f8f7 100644 --- a/middlewares/volunteer.middleware.js +++ b/middlewares/volunteer.middleware.js @@ -69,7 +69,8 @@ async function createVolunteer(req, res, next) { const volunteer = await Services.Volunteer.createVolunteer(volunteerDetails); if (!volunteer) { - return res.status(400).json({ + return next({ + status: 500, message: Constants.Error.VOLUNTEER_CREATE_500_MESSAGE, data: {} }); From 0c40c107b71695341a88f53a28446e273bdb7b1a Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 18 Feb 2019 16:50:40 -0500 Subject: [PATCH 026/243] Fix linking of accountType in schema (#371) --- models/accountConfirmationToken.model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/accountConfirmationToken.model.js b/models/accountConfirmationToken.model.js index 11ba28db..498598fa 100644 --- a/models/accountConfirmationToken.model.js +++ b/models/accountConfirmationToken.model.js @@ -12,8 +12,8 @@ const AccountConfirmationSchema = new mongoose.Schema({ }, accountType: { type: String, - enum: Constants.EXTENDED_USER_TYPES, - default: Constants.HACKER + enum: Constants.General.EXTENDED_USER_TYPES, + default: Constants.General.HACKER }, email: { type: String, From 5021064827da772e6299d35c18ce168fa168472d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Feb 2019 16:51:57 -0500 Subject: [PATCH 027/243] Bump mocha from 5.2.0 to 6.0.0 (#372) Bumps [mocha](https://github.com/mochajs/mocha) from 5.2.0 to 6.0.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v5.2.0...v6.0.0) Signed-off-by: dependabot[bot] --- package-lock.json | 783 +++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 714 insertions(+), 71 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3e4449e..22031da7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -708,6 +708,12 @@ } } }, + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -1933,12 +1939,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", @@ -2203,6 +2203,15 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.1.1.tgz", "integrity": "sha512-urQxA1smbLZ2cBbXbaYObM1dJ82aJ2H57A1C/Kklfh/ZN1bgH4G/n5KWhdNfOK11W98gqZfyYj7W4frJJRwA2w==" }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -2259,6 +2268,12 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, "diagnostics": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", @@ -2445,6 +2460,31 @@ "integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA==", "dev": true }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", @@ -2468,6 +2508,12 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -2547,6 +2593,15 @@ } } }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, "express": { "version": "4.16.3", "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", @@ -2785,6 +2840,55 @@ } } }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + } + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -2879,7 +2983,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2900,12 +3005,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2920,17 +3027,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3047,7 +3157,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3059,6 +3170,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3073,6 +3185,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3080,12 +3193,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3104,6 +3219,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3184,7 +3300,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3196,6 +3313,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3281,7 +3399,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3317,6 +3436,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3336,6 +3456,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3379,15 +3500,23 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "gaxios": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.4.0.tgz", @@ -3673,6 +3802,30 @@ "ini": "^1.3.4" } }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, "google-auth-library": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.0.1.tgz", @@ -4273,6 +4426,15 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-color": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", @@ -4283,6 +4445,12 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -4355,9 +4523,9 @@ } }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "hex2dec": { @@ -4370,6 +4538,15 @@ "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", @@ -4553,6 +4730,12 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", @@ -4582,6 +4765,12 @@ } } }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -4704,6 +4893,15 @@ "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, "is-retry-allowed": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", @@ -4720,6 +4918,15 @@ "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -4752,6 +4959,16 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -5097,6 +5314,37 @@ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, "logform": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/logform/-/logform-1.10.0.tgz", @@ -5329,70 +5577,255 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.0.tgz", + "integrity": "sha512-A7g9k3yr8oJaXn2IItFnfgjyxFc/LTe6Wwv7FczP+e8G74o9xYNSbMYmCf1ouldRojLrFcOb+z75P6Ak0GX6ug==", "dev": true, "requires": { + "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", + "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "findup-sync": "2.0.0", + "glob": "7.1.3", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.12.0", + "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.1", + "node-environment-flags": "1.0.4", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "12.0.5", + "yargs-parser": "11.1.1", + "yargs-unparser": "1.5.0" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } - } - } - }, - "mongodb": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz", - "integrity": "sha512-sz2dhvBZQWf3LRNDhbd30KHVzdjZx9IKC0L+kSZ/gzYquCF5zPOgGqRz6sSCqYZtKP2ekB4nfLxhGtzGHnIKxA==", - "requires": { - "mongodb-core": "3.1.11", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "mongodb-core": { - "version": "3.1.11", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.11.tgz", - "integrity": "sha512-rD2US2s5qk/ckbiiGFHeu+yKYDXdJ1G87F6CG3YdaZpzdOm5zpoAZd/EKbPmFO6cQZ+XVXBXBJ660sSI0gc6qg==", - "requires": { - "bson": "^1.1.0", - "require_optional": "^1.0.1", - "safe-buffer": "^5.1.2", - "saslprep": "^1.0.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "mongoose": { + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + } + } + }, + "mongodb": { + "version": "3.1.13", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz", + "integrity": "sha512-sz2dhvBZQWf3LRNDhbd30KHVzdjZx9IKC0L+kSZ/gzYquCF5zPOgGqRz6sSCqYZtKP2ekB4nfLxhGtzGHnIKxA==", + "requires": { + "mongodb-core": "3.1.11", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "mongodb-core": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.11.tgz", + "integrity": "sha512-rD2US2s5qk/ckbiiGFHeu+yKYDXdJ1G87F6CG3YdaZpzdOm5zpoAZd/EKbPmFO6cQZ+XVXBXBJ660sSI0gc6qg==", + "requires": { + "bson": "^1.1.0", + "require_optional": "^1.0.1", + "safe-buffer": "^5.1.2", + "saslprep": "^1.0.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "mongoose": { "version": "5.4.13", "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.13.tgz", "integrity": "sha512-4dgmFbtNECbW3ZMS6ha2pebinUzZo789scdccdyyajbmaunBPqZJqp6eO6pThIqDsgSOkRi4IrzkZm8kmhtZMA==", @@ -5521,6 +5954,15 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, + "node-environment-flags": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", + "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } + }, "node-fetch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", @@ -5635,6 +6077,12 @@ } } }, + "object-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -5644,6 +6092,28 @@ "isobject": "^3.0.0" } }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -5772,6 +6242,12 @@ "semver": "^5.1.0" } }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -6296,6 +6772,16 @@ "semver": "^5.1.0" } }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, "resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", @@ -7275,6 +7761,15 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, "widest-line": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", @@ -7435,6 +7930,154 @@ "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" } } + }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + } + } } } } diff --git a/package.json b/package.json index 2d4d2f44..3d33d379 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.1", "jslint": "^0.12.1", - "mocha": "^5.2.0", + "mocha": "^6.0.0", "nodemon": "^1.18.10" } } From cacbb103658ade649019859496f07f505efd944d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Feb 2019 16:52:52 -0500 Subject: [PATCH 028/243] Bump @google-cloud/logging-winston from 0.10.2 to 0.11.0 (#369) Bumps [@google-cloud/logging-winston](https://github.com/googleapis/nodejs-logging-winston) from 0.10.2 to 0.11.0. - [Release notes](https://github.com/googleapis/nodejs-logging-winston/releases) - [Changelog](https://github.com/googleapis/nodejs-logging-winston/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-logging-winston/compare/v0.10.2...v0.11.0) Signed-off-by: dependabot[bot] --- package-lock.json | 92 ++++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 56 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22031da7..b78a59f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,9 +58,9 @@ } }, "@google-cloud/logging": { - "version": "4.3.0", - "resolved": "http://registry.npmjs.org/@google-cloud/logging/-/logging-4.3.0.tgz", - "integrity": "sha512-SRTo+2dP9ycGVoYHMGKtRkv7CFj75u6vK+GqKYO1rUjfs6zSB6qD74vKQmpEEmmrcWSrZRk3Fekbs9/4AKU4ww==", + "version": "4.4.0", + "resolved": "http://registry.npmjs.org/@google-cloud/logging/-/logging-4.4.0.tgz", + "integrity": "sha512-e2KVDOSexgpsf9ftHiHTGGhlzaIZNpZUI+cHWSsni/2T2Bfx0erd1rlXf2l5T1E9/3V699dDCsg5guDUykq8hA==", "requires": { "@google-cloud/common-grpc": "^0.10.0", "@google-cloud/paginator": "^0.1.0", @@ -101,18 +101,39 @@ } }, "@google-cloud/logging-winston": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@google-cloud/logging-winston/-/logging-winston-0.10.2.tgz", - "integrity": "sha512-dvd4Qnh9c3KNeur9ZZwYMm2zNfHMF5STXgoLnmtVS484mZgl1yDhPVPqKZlodrirKrIxRsZOZwm9BCghSIpDeA==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@google-cloud/logging-winston/-/logging-winston-0.11.0.tgz", + "integrity": "sha512-Z1G4YJ2pjS3DvMvUradBWfOZxoE6DUnY5Ex9Rbe9qyWSc+KoC87KQrWN2WKrvtsWAY3sXGbn7gLuamRz8gUs/A==", "requires": { - "@google-cloud/logging": "^4.0.1", - "@sindresorhus/is": "^0.10.0", + "@google-cloud/logging": "^4.4.0", "lodash.mapvalues": "^4.6.0", - "logform": "^1.9.1", + "logform": "^2.0.0", "semver": "^5.5.1", "winston-transport": "^4.2.0" }, "dependencies": { + "colors": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", + "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" + }, + "logform": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", + "integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==", + "requires": { + "colors": "^1.2.1", + "fast-safe-stringify": "^2.0.4", + "fecha": "^2.3.3", + "ms": "^2.1.1", + "triple-beam": "^1.3.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", @@ -438,14 +459,6 @@ "@sendgrid/helpers": "^6.3.0" } }, - "@sindresorhus/is": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.10.0.tgz", - "integrity": "sha512-bmfpY7xAyYhgE531LyMH40uVWgBymnUbL6scPM3pogT/v9CDDnS8N5LRlwLiBGrvjYhBSylIz9P5mIqAMcoKIg==", - "requires": { - "symbol-observable": "^1.2.0" - } - }, "@types/body-parser": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", @@ -3827,9 +3840,9 @@ } }, "google-auth-library": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.0.1.tgz", - "integrity": "sha512-ZGTBMiQga/pwEw26ZKCn+q9PTPXvE4v5sL2V9HV3f2Gt0lrS+2H7XgbVCx850jrvlEL59JIheFiDqEn9CIa0nA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.0.tgz", + "integrity": "sha512-EntjrOgSffw5EhZGoV8+ROPwEK/aQpoMZaULw3bKailEGdjaUI25PmmFc4AN6vG/Q24YEUiuLxtTXa1Usar5Eg==", "requires": { "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", @@ -3858,9 +3871,9 @@ } }, "google-gax": { - "version": "0.25.0", - "resolved": "http://registry.npmjs.org/google-gax/-/google-gax-0.25.0.tgz", - "integrity": "sha512-ZBDPgNuck0G7W2bIEc0hL0N8QgUJzAuVZ6bt7GcP61fWx6snAcKPTX9z5/MmcwKBZlUnzruONcyOQiVZZKZXnQ==", + "version": "0.25.2", + "resolved": "http://registry.npmjs.org/google-gax/-/google-gax-0.25.2.tgz", + "integrity": "sha512-I1hgeywHG8AZ2d9EWqd0iZq2msoDlcGuGwXw4wJccXjMz6H9pw+TzB2aiYREjFPBqMe5dtimrwobD6LM9XrzOQ==", "requires": { "@grpc/grpc-js": "^0.3.0", "@grpc/proto-loader": "^0.4.0", @@ -3875,7 +3888,7 @@ "protobufjs": "^6.8.8", "retry-request": "^4.0.0", "semver": "^5.5.1", - "walkdir": "0.0.12" + "walkdir": "^0.3.2" }, "dependencies": { "semver": { @@ -3901,6 +3914,13 @@ "requires": { "protobufjs": "^6.8.0", "walkdir": "0.0.12" + }, + "dependencies": { + "walkdir": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.12.tgz", + "integrity": "sha512-HFhaD4mMWPzFSqhpyDG48KDdrjfn409YQuVW7ckZYhW4sE87mYtWifdB/+73RA7+p4s4K18n5Jfx1kHthE1gBw==" + } } }, "got": { @@ -5349,6 +5369,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/logform/-/logform-1.10.0.tgz", "integrity": "sha512-em5ojIhU18fIMOw/333mD+ZLE2fis0EzXl1ZwHx4iQzmpQi6odNiY/t+ITNr33JZhT9/KEaH+UPIipr6a9EjWg==", + "dev": true, "requires": { "colors": "^1.2.1", "fast-safe-stringify": "^2.0.4", @@ -5360,12 +5381,14 @@ "colors": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" + "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "dev": true }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true } } }, @@ -6373,9 +6396,9 @@ }, "dependencies": { "@types/node": { - "version": "10.12.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.21.tgz", - "integrity": "sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==" + "version": "10.12.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.26.tgz", + "integrity": "sha512-nMRqS+mL1TOnIJrL6LKJcNZPB8V3eTfRo9FQA2b5gDvrHurC8XbSA86KNe0dShlEL7ReWJv/OU9NL7Z0dnqWTg==" } } }, @@ -7305,11 +7328,6 @@ "has-flag": "^3.0.0" } }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" - }, "teeny-request": { "version": "3.11.3", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", @@ -7744,9 +7762,9 @@ } }, "walkdir": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.12.tgz", - "integrity": "sha512-HFhaD4mMWPzFSqhpyDG48KDdrjfn409YQuVW7ckZYhW4sE87mYtWifdB/+73RA7+p4s4K18n5Jfx1kHthE1gBw==" + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.3.2.tgz", + "integrity": "sha512-0Twghia4Z5wDGDYWURlhZmI47GvERMCsXIu0QZWVVZyW9ZjpbbZvD9Zy9M6cWiQQRRbAcYajIyKNavaZZDt1Uw==" }, "which": { "version": "1.3.0", diff --git a/package.json b/package.json index 3d33d379..94a4a956 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "docs": "apidoc -i ./routes -o ./docs/api/" }, "dependencies": { - "@google-cloud/logging-winston": "^0.10.2", + "@google-cloud/logging-winston": "^0.11.0", "@google-cloud/storage": "^2.4.2", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.4", From 2d3681a0fcf74dec61e54c9d6d323ec6063e7fe4 Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 18 Feb 2019 17:26:21 -0500 Subject: [PATCH 029/243] Convert major to list, convert ascii to string validation (#355) * Convert major to list, convert ascii to string validation * update docs * Fix majors valdiation for edit --- docs/api/api_data.js | 6 +- docs/api/api_data.json | 2053 ++++++++----------- docs/api/api_project.js | 2 +- docs/api/api_project.json | 2 +- middlewares/validators/account.validator.js | 12 +- middlewares/validators/hacker.validator.js | 16 +- middlewares/validators/sponsor.validator.js | 4 +- middlewares/validators/team.validator.js | 10 +- middlewares/validators/validator.helper.js | 18 + models/hacker.model.js | 4 +- routes/api/hacker.js | 6 +- tests/util/hacker.test.util.js | 26 +- 12 files changed, 887 insertions(+), 1272 deletions(-) diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 4cc31425..ab46549f 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1167,7 +1167,7 @@ define({ }, { "group": "body", - "type": "String", + "type": "String[]", "optional": false, "field": "major", "description": "

the major of the hacker

" @@ -1551,7 +1551,7 @@ define({ }, { "group": "body", - "type": "String", + "type": "String[]", "optional": true, "field": "major", "description": "

the major of the hacker

" @@ -1992,7 +1992,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", "type": "object" }] }, diff --git a/docs/api/api_data.json b/docs/api/api_data.json index 6aad836e..dcb9e4ed 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1,5 +1,4 @@ -[ - { +[{ "type": "post", "url": "/account/", "title": "create a new account", @@ -8,8 +7,7 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "String", "optional": false, @@ -73,28 +71,23 @@ "description": "

the user's phone number, represented as a string.

" } ], - "header": [ - { - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - } - ] - }, - "examples": [ - { - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - } - ] + "header": [{ + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + }] + }, + "examples": [{ + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -110,18 +103,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -137,21 +127,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" + }] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/account/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/" + }] }, { "type": "get", @@ -162,21 +148,18 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -192,18 +175,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -219,21 +199,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/account/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/:id" + }] }, { "type": "get", @@ -244,21 +220,17 @@ "version": "0.0.8", "description": "

Get all of the invites that currently exist in the database.

", "success": { - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" + }] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/account/invite" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/invite" + }] }, { "type": "post", @@ -270,8 +242,7 @@ "description": "

sends link with token to be used with the account/create route

", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "String", "optional": true, @@ -290,8 +261,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -307,18 +277,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -334,21 +301,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" + }] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/account/invite" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/invite" + }] }, { "type": "get", @@ -359,8 +322,7 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -376,18 +338,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -403,21 +362,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/account/self" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/self" + }] }, { "type": "patch", @@ -428,8 +383,7 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "String", "optional": true, @@ -487,18 +441,15 @@ } ] }, - "examples": [ - { - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - } - ] + "examples": [{ + "title": "Request-Example:", + "content": "{ \"shirtSize\": \"M\" }", + "type": "json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -514,18 +465,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -541,21 +489,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/account/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/:id" + }] }, { "type": "patch", @@ -566,8 +510,7 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [ - { + "Parameter": [{ "group": "Parameter", "type": "String", "optional": false, @@ -583,18 +526,15 @@ } ] }, - "examples": [ - { - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - } - ] + "examples": [{ + "title": "Request-Example:", + "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -610,26 +550,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + }] }, - "permission": [ - { - "name": ": Must be logged in" - } - ], + "permission": [{ + "name": ": Must be logged in" + }], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/password/change" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/password/change" + }] }, { "type": "post", @@ -640,21 +574,18 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [ - { - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - } - ] + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -670,18 +601,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -697,21 +625,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/confirm/:token" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + }] }, { "type": "post", @@ -722,28 +646,23 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [ - { - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - } - ] + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + }] }, - "examples": [ - { - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - } - ] + "examples": [{ + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -759,26 +678,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" + }] }, - "permission": [ - { - "name": ": public" - } - ], + "permission": [{ + "name": ": public" + }], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/password/forgot" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/password/forgot" + }] }, { "type": "get", @@ -789,21 +702,18 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -819,18 +729,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -846,21 +753,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + }] }, { "type": "get", @@ -872,8 +775,7 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -889,21 +791,17 @@ } ] }, - "examples": [ - { - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" + }] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/roles" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/roles" + }] }, { "type": "post", @@ -914,8 +812,7 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [ - { + "Parameter": [{ "group": "Parameter", "type": "string", "optional": false, @@ -934,8 +831,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -951,18 +847,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -978,26 +871,20 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" + }] }, - "permission": [ - { - "name": ": public" - } - ], + "permission": [{ + "name": ": public" + }], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/login" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/login" + }] }, { "type": "get", @@ -1008,8 +895,7 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1025,26 +911,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" + }] }, - "permission": [ - { - "name": ": public" - } - ], + "permission": [{ + "name": ": public" + }], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/logout" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/logout" + }] }, { "type": "get", @@ -1055,8 +935,7 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1072,18 +951,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -1099,8 +975,7 @@ } ] }, - "examples": [ - { + "examples": [{ "title": "Error-Response:", "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", "type": "json" @@ -1114,11 +989,9 @@ }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/confirm/resend" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + }] }, { "type": "post", @@ -1129,48 +1002,39 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [ - { - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - } - ] + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + }] }, - "examples": [ - { - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - } - ] + "examples": [{ + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" + }] }, "header": { "fields": { - "Header": [ - { - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - } - ] + "Header": [{ + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + }] }, - "examples": [ - { - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - } - ] + "examples": [{ + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1186,26 +1050,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + }] }, - "permission": [ - { - "name": ": must have authentication token" - } - ], + "permission": [{ + "name": ": must have authentication token" + }], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/auth/password/reset" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/password/reset" + }] }, { "type": "patch", @@ -1216,21 +1074,18 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [ - { - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - } - ] + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1246,16 +1101,13 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" + }] }, - "permission": [ - { + "permission": [{ "name": "Administrator" }, { @@ -1264,11 +1116,9 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + }] }, { "type": "post", @@ -1279,8 +1129,7 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "MongoID", "optional": false, @@ -1317,7 +1166,7 @@ }, { "group": "body", - "type": "String", + "type": "String[]", "optional": false, "field": "major", "description": "

the major of the hacker

" @@ -1345,18 +1194,15 @@ } ] }, - "examples": [ - { - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - } - ] + "examples": [{ + "title": "application: ", + "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", + "type": "Json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1372,18 +1218,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -1399,21 +1242,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/" + }] }, { "type": "get", @@ -1424,21 +1263,18 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - } - ] + "param": [{ + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -1454,18 +1290,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -1481,21 +1314,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/:id" + }] }, { "type": "get", @@ -1506,21 +1335,18 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - } - ] + "param": [{ + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -1536,18 +1362,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -1563,21 +1386,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/email/:email" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/:email" + }] }, { "type": "get", @@ -1588,62 +1407,50 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + }] } }, "success": { "fields": { - "Success 200": [ - { - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - } - ] + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }] }, - "examples": [ - { - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", + "type": "json" + }] }, "error": { "fields": { - "Error 4xx": [ - { - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - } - ] - }, - "examples": [ - { - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - } - ] - }, - "permission": [ - { - "name": "Must be logged in, and the account id must be linked to the hacker." - } - ], + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + }] + }, + "examples": [{ + "title": "Error-Response:", + "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", + "type": "json" + }] + }, + "permission": [{ + "name": "Must be logged in, and the account id must be linked to the hacker." + }], "filename": "routes/api/hacker.js", "groupTitle": "Hacker" }, @@ -1656,8 +1463,7 @@ "version": "0.0.9", "parameter": { "fields": { - "query": [ - { + "query": [{ "group": "query", "type": "String", "optional": false, @@ -1676,8 +1482,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1693,21 +1498,17 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" + }] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/stats" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/stats" + }] }, { "type": "patch", @@ -1719,8 +1520,7 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "String", "optional": true, @@ -1750,7 +1550,7 @@ }, { "group": "body", - "type": "String", + "type": "String[]", "optional": true, "field": "major", "description": "

the major of the hacker

" @@ -1771,18 +1571,15 @@ } ] }, - "examples": [ - { - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - } - ] + "examples": [{ + "title": "application: ", + "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", + "type": "Json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1798,18 +1595,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -1825,21 +1619,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/:id" + }] }, { "type": "patch", @@ -1850,21 +1640,18 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [ - { - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" - } - ] + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1880,16 +1667,13 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" + }] }, - "permission": [ - { + "permission": [{ "name": "Administrator" }, { @@ -1898,11 +1682,9 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + }] }, { "type": "patch", @@ -1913,21 +1695,18 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [ - { - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" - } - ] + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -1943,26 +1722,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + }] }, - "permission": [ - { - "name": "Administrator" - } - ], + "permission": [{ + "name": "Administrator" + }], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/status/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/status/:id" + }] }, { "type": "post", @@ -1974,30 +1747,25 @@ "description": "

NOTE: This must be sent via multipart/form-data POST request

", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - } - ], - "body": [ - { - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + }], + "body": [{ + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -2013,26 +1781,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" + }] }, - "permission": [ - { - "name": "Must be logged in, and the account id must be linked to the hacker." - } - ], + "permission": [{ + "name": "Must be logged in, and the account id must be linked to the hacker." + }], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/resume/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + }] }, { "type": "post", @@ -2043,22 +1805,19 @@ "group": "Hacker", "version": "0.0.9", "parameter": { - "fields": { - "param": [ - { - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - } - ] + "fields": { + "param": [{ + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -2074,26 +1833,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + }] }, - "permission": [ - { - "name": "Administrator" - } - ], + "permission": [{ + "name": "Administrator" + }], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + }] }, { "type": "post", @@ -2105,21 +1858,18 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - } - ] + "param": [{ + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -2135,26 +1885,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + }] }, - "permission": [ - { - "name": "Administrator" - } - ], + "permission": [{ + "name": "Administrator" + }], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + }] }, { "type": "get", @@ -2165,8 +1909,7 @@ "version": "1.4.1", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -2182,18 +1925,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -2209,26 +1949,20 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + }] }, - "permission": [ - { - "name": ": Sponsor" - } - ], + "permission": [{ + "name": ": Sponsor" + }], "filename": "routes/api/sponsor.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/sponsor/self" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/self" + }] }, { "type": "get", @@ -2239,8 +1973,7 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -2256,18 +1989,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -2283,21 +2013,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/hacker/self" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/self" + }] }, { "type": "get", @@ -2306,18 +2032,14 @@ "version": "0.0.8", "name": "index", "group": "Index", - "permission": [ - { - "name": "public" - } - ], + "permission": [{ + "name": "public" + }], "filename": "routes/index.js", "groupTitle": "Index", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/" + }] }, { "type": "post", @@ -2328,8 +2050,7 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "String", "optional": false, @@ -2345,18 +2066,15 @@ } ] }, - "examples": [ - { - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - } - ] + "examples": [{ + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" + }] }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -2372,18 +2090,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -2399,21 +2114,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/role.js", "groupTitle": "Role", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/api/role/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/api/role/" + }] }, { "type": "get", @@ -2424,8 +2135,7 @@ "version": "0.0.8", "parameter": { "fields": { - "query": [ - { + "query": [{ "group": "query", "type": "String", "optional": false, @@ -2479,8 +2189,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -2496,8 +2205,7 @@ } ] }, - "examples": [ - { + "examples": [{ "title": "Success-Response:", "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", "type": "object" @@ -2511,8 +2219,7 @@ }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -2528,21 +2235,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/search.js", "groupTitle": "Search", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/search/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/search/" + }] }, { "type": "get", @@ -2553,8 +2256,7 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -2570,26 +2272,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + }] }, - "permission": [ - { - "name": "public" - } - ], + "permission": [{ + "name": "public" + }], "filename": "routes/api/settings.js", "groupTitle": "Settings", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/settings/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/settings/" + }] }, { "type": "patch", @@ -2600,8 +2296,7 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "Date", "optional": true, @@ -2627,8 +2322,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -2644,26 +2338,20 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + }] }, - "permission": [ - { - "name": "Administrators" - } - ], + "permission": [{ + "name": "Administrators" + }], "filename": "routes/api/settings.js", "groupTitle": "Settings", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/settings/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/settings/" + }] }, { "type": "post", @@ -2674,8 +2362,7 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "MongoID", "optional": false, @@ -2715,8 +2402,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -2732,18 +2418,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -2759,21 +2442,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/sponsor/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/" + }] }, { "type": "get", @@ -2784,21 +2463,18 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - } - ] + "param": [{ + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -2814,18 +2490,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -2841,21 +2514,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/sponsor/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/:id" + }] }, { "type": "patch", @@ -2866,17 +2535,14 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - } - ], - "body": [ - { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + }], + "body": [{ "group": "body", "type": "String", "optional": false, @@ -2902,8 +2568,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -2919,18 +2584,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -2946,21 +2608,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/sponsor/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/" + }] }, { "type": "post", @@ -2971,8 +2629,7 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { + "body": [{ "group": "body", "type": "String", "optional": false, @@ -2998,8 +2655,7 @@ }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -3015,18 +2671,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -3042,21 +2695,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/team/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/" + }] }, { "type": "patch", @@ -3067,8 +2716,7 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -3084,21 +2732,17 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", + "type": "object" + }] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/team/leave/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/leave/" + }] }, { "type": "get", @@ -3109,21 +2753,18 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -3139,18 +2780,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -3166,21 +2804,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/team/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/:id" + }] }, { "type": "patch", @@ -3191,21 +2825,18 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [ - { - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - } - ] + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -3221,21 +2852,17 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", + "type": "object" + }] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/team/join/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/join/" + }] }, { "type": "patch", @@ -3247,21 +2874,18 @@ "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -3277,18 +2901,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -3304,21 +2925,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + }] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/team/:hackerId" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/:hackerId" + }] }, { "type": "post", @@ -3329,21 +2946,18 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [ - { - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - } - ] + "body": [{ + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "string", "optional": false, @@ -3359,18 +2973,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "string", "optional": false, @@ -3386,21 +2997,17 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/volunteer/" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/volunteer/" + }] }, { "type": "get", @@ -3411,21 +3018,18 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [ - { - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - } - ] + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -3441,18 +3045,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -3468,20 +3069,16 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/volunteer/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/volunteer/:id" + }] } -] +] \ No newline at end of file diff --git a/docs/api/api_project.js b/docs/api/api_project.js index 50871819..5875ef3e 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -9,7 +9,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-07T00:12:02.506Z", + "time": "2019-02-18T21:54:16.394Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/docs/api/api_project.json b/docs/api/api_project.json index 2ca1c771..befdcc87 100644 --- a/docs/api/api_project.json +++ b/docs/api/api_project.json @@ -9,7 +9,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-07T00:12:02.506Z", + "time": "2019-02-18T21:54:16.394Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/middlewares/validators/account.validator.js b/middlewares/validators/account.validator.js index 69ef5fb7..a1c86932 100644 --- a/middlewares/validators/account.validator.js +++ b/middlewares/validators/account.validator.js @@ -4,9 +4,9 @@ const Constants = require("../../constants/general.constant"); module.exports = { newAccountValidator: [ - VALIDATOR.asciiValidator("body", "firstName", false), - VALIDATOR.asciiValidator("body", "lastName", false), - VALIDATOR.asciiValidator("body", "pronoun", false), + VALIDATOR.stringValidator("body", "firstName", false), + VALIDATOR.stringValidator("body", "lastName", false), + VALIDATOR.stringValidator("body", "pronoun", false), VALIDATOR.regexValidator("body", "email", false, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", false), VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, false), @@ -16,9 +16,9 @@ module.exports = { VALIDATOR.phoneNumberValidator("body", "phoneNumber", false) ], updateAccountValidator: [ - VALIDATOR.asciiValidator("body", "firstName", true), - VALIDATOR.asciiValidator("body", "lastName", true), - VALIDATOR.asciiValidator("body", "pronoun", true), + VALIDATOR.stringValidator("body", "firstName", true), + VALIDATOR.stringValidator("body", "lastName", true), + VALIDATOR.stringValidator("body", "pronoun", true), VALIDATOR.regexValidator("body", "email", true, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", true), VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, true), diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js index 0170fce6..6728a9f6 100644 --- a/middlewares/validators/hacker.validator.js +++ b/middlewares/validators/hacker.validator.js @@ -6,13 +6,13 @@ module.exports = { newHackerValidator: [ // status will be added automatically VALIDATOR.mongoIdValidator("body", "accountId", false), - VALIDATOR.asciiValidator("body", "school", false), - VALIDATOR.asciiValidator("body", "degree", false), - VALIDATOR.asciiValidator("body", "gender", false), + VALIDATOR.stringValidator("body", "school", false), + VALIDATOR.stringValidator("body", "degree", false), + VALIDATOR.stringValidator("body", "gender", false), VALIDATOR.booleanValidator("body", "needsBus", false), VALIDATOR.applicationValidator("body", "application", false), VALIDATOR.alphaArrayValidator("body", "ethnicity", false), - VALIDATOR.asciiValidator("body", "major", false), + VALIDATOR.alphaArrayValidator("body", "major", false), VALIDATOR.integerValidator("body", "graduationYear", false, 2019, 2030), VALIDATOR.booleanValidator("body", "codeOfConduct", false, true), VALIDATOR.mongoIdValidator("body", "teamId", true) @@ -23,13 +23,13 @@ module.exports = { ], updateHackerValidator: [ - VALIDATOR.asciiValidator("body", "school", true), - VALIDATOR.asciiValidator("body", "degree", true), - VALIDATOR.asciiValidator("body", "gender", true), + VALIDATOR.stringValidator("body", "school", true), + VALIDATOR.stringValidator("body", "degree", true), + VALIDATOR.stringValidator("body", "gender", true), VALIDATOR.booleanValidator("body", "needsBus", true), VALIDATOR.applicationValidator("body", "application", true), VALIDATOR.alphaArrayValidator("body", "ethnicity", true), - VALIDATOR.asciiValidator("body", "major", true), + VALIDATOR.alphaArrayValidator("body", "major", true), VALIDATOR.integerValidator("body", "graduationYear", true, 2019, 2030), ], updateStatusValidator: [ diff --git a/middlewares/validators/sponsor.validator.js b/middlewares/validators/sponsor.validator.js index 60deab29..f2f9d8f5 100644 --- a/middlewares/validators/sponsor.validator.js +++ b/middlewares/validators/sponsor.validator.js @@ -10,13 +10,13 @@ module.exports = { // assuming that the tiers are between 0 and 5 (inclusive) // 5 is the custom class VALIDATOR.integerValidator("body", "tier", false, 0, 5), - VALIDATOR.asciiValidator("body", "company", false), + VALIDATOR.stringValidator("body", "company", false), VALIDATOR.regexValidator("body", "contractURL", false, Constants.URL_REGEX), VALIDATOR.mongoIdArrayValidator("body", "nominees", true), ], updateSponsorValidator: [ - VALIDATOR.asciiValidator("body", "company", true), + VALIDATOR.stringValidator("body", "company", true), VALIDATOR.regexValidator("body", "contractURL", true, Constants.URL_REGEX), VALIDATOR.mongoIdArrayValidator("body", "nominees", true), ], diff --git a/middlewares/validators/team.validator.js b/middlewares/validators/team.validator.js index c064fe00..bd18949a 100644 --- a/middlewares/validators/team.validator.js +++ b/middlewares/validators/team.validator.js @@ -4,18 +4,18 @@ const Constants = require("../../constants/general.constant"); module.exports = { newTeamValidator: [ - VALIDATOR.asciiValidator("body", "name", false), + VALIDATOR.stringValidator("body", "name", false), VALIDATOR.regexValidator("body", "devpostURL", true, Constants.DEVPOST_REGEX), - VALIDATOR.asciiValidator("body", "projectName", true) + VALIDATOR.stringValidator("body", "projectName", true) ], joinTeamValidator: [ - VALIDATOR.asciiValidator("body", "name", false), + VALIDATOR.stringValidator("body", "name", false), ], patchTeamValidator: [ - VALIDATOR.asciiValidator("body", "name", true), + VALIDATOR.stringValidator("body", "name", true), VALIDATOR.regexValidator("body", "devpostURL", true, Constants.DEVPOST_REGEX), - VALIDATOR.asciiValidator("body", "projectName", true) + VALIDATOR.stringValidator("body", "projectName", true) ], }; \ No newline at end of file diff --git a/middlewares/validators/validator.helper.js b/middlewares/validators/validator.helper.js index 1ebcf272..3fff34b4 100644 --- a/middlewares/validators/validator.helper.js +++ b/middlewares/validators/validator.helper.js @@ -124,6 +124,23 @@ function asciiValidator(fieldLocation, fieldname, optional = true) { } } +/** + * Validates that field name is string only. + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {string} fieldname name of the field that needs to be validated. + * @param {boolean} optional whether the field is optional or not. + */ +function stringValidator(fieldLocation, fieldname, optional = true) { + const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid string"); + if (optional) { + return name.optional({ + checkFalsy: true + }).isString().withMessage("must be a string"); + } else { + return name.exists().withMessage("name must exist").isString().withMessage("must be a string"); + } +} + /** * Validates the field against a regex * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found @@ -614,4 +631,5 @@ module.exports = { dateValidator: dateValidator, enumValidator: enumValidator, routesValidator: routesValidator, + stringValidator: stringValidator }; \ No newline at end of file diff --git a/models/hacker.model.js b/models/hacker.model.js index d1536cf6..26316e6b 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -83,10 +83,10 @@ const HackerSchema = new mongoose.Schema({ }], required: true }, - major: { + major: [{ type: String, required: true - }, + }], graduationYear: { type: Number, required: true diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 250a2c51..2ce81ad9 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -59,7 +59,7 @@ module.exports = { "school":"McPherson College", "gender":"Female", "needsBus":false, - "major":"Accounting", + "major":["Accounting"], "graduationYear":2019, "codeOfConduct":true, } @@ -89,7 +89,7 @@ module.exports = { * @apiParam (body) {String} gender Gender of the hacker * @apiParam (body) {Boolean} needsBus Whether the hacker requires a bus for transportation * @apiParam (body) {String[]} ethnicity the ethnicities of the hacker - * @apiParam (body) {String} major the major of the hacker + * @apiParam (body) {String[]} major the major of the hacker * @apiParam (body) {Number} graduationYear the graduation year of the hacker * @apiParam (body) {Boolean} codeOfConduct acceptance of the code of conduct * @apiParam (body) {Json} application The hacker's application. Resume and jobInterest fields are required. @@ -291,7 +291,7 @@ module.exports = { * @apiParam (body) {String} [gender] Gender of the hacker * @apiParam (body) {Boolean} [needsBus] Whether the hacker requires a bus for transportation * @apiParam (body) {String[]} [ethnicity] the ethnicities of the hacker - * @apiParam (body) {String} [major] the major of the hacker + * @apiParam (body) {String[]} [major] the major of the hacker * @apiParam (body) {Number} [graduationYear] the graduation year of the hacker * @apiParam (body) {Json} [application] The hacker's application * @apiParamExample {Json} application: diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index a23e62bf..a34c6565 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -32,7 +32,7 @@ const TeamHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Native American"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team1Id, @@ -60,7 +60,7 @@ const TeamHacker1 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -88,7 +88,7 @@ const TeamHacker2 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -116,7 +116,7 @@ const TeamHacker3 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -144,7 +144,7 @@ const TeamHacker4 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -172,7 +172,7 @@ const NoTeamHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -197,7 +197,7 @@ const newHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Caucasian"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -222,7 +222,7 @@ const newHacker1 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["African American"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -248,7 +248,7 @@ const invalidHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Caucasian"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": false, }; @@ -268,7 +268,7 @@ const invalidHacker1 = { "jobInterest": "ASDF", }, "ethnicity": ["Asian", "Caucasian"], - "major": "CS", + "major": ["CS"], "graduationYear": 2020, "codeOfConduct": true, }; @@ -295,7 +295,7 @@ const duplicateAccountLinkHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Caucasian"], - "major": "CS", + "major": ["CS"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -322,7 +322,7 @@ const waitlistedHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team2Id, @@ -350,7 +350,7 @@ const unconfirmedAccountHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; From 6293ea8576e331f02998fa333af17564e950c313 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Feb 2019 02:09:55 +0000 Subject: [PATCH 030/243] Bump @types/mongoose from 5.3.17 to 5.3.18 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped) from 5.3.17 to 5.3.18. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b78a59f1..db6f3daa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -580,9 +580,9 @@ } }, "@types/mongoose": { - "version": "5.3.17", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.17.tgz", - "integrity": "sha512-LkddA9pB/c2H3en2wFkHLOTUJJ8i/gzCs3R9fh1VkL0vJnZo3av/lJleVoKe6h6puB0S7Uy+NSLDkR5QTNbSfg==", + "version": "5.3.18", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.18.tgz", + "integrity": "sha512-1kR2A7Uf5iA3HehtzcXqVmr/zn1DFlwkmMcP2mTPkAlXNjZwa+F+2wdEfFOilLHEQkPHQ2dcfmYuBjBDA8YQkQ==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 94a4a956..c14ec931 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.17", + "@types/mongoose": "^5.3.18", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From a522912a3c0c5c072d9f817ca2e8484cde3ac46d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Feb 2019 10:26:50 +0000 Subject: [PATCH 031/243] Bump mongoose from 5.4.13 to 5.4.14 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.13 to 5.4.14. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.13...5.4.14) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index db6f3daa..33163194 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5849,9 +5849,9 @@ } }, "mongoose": { - "version": "5.4.13", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.13.tgz", - "integrity": "sha512-4dgmFbtNECbW3ZMS6ha2pebinUzZo789scdccdyyajbmaunBPqZJqp6eO6pThIqDsgSOkRi4IrzkZm8kmhtZMA==", + "version": "5.4.14", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.14.tgz", + "integrity": "sha512-lAISH4xdx0/o0bVWPB4bxApP3bA1b08oHPEjTBq3/mIr4R494hepDJJowByBgpGYf8tj/oe6VkFCx8wbRcOciA==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index c14ec931..4f4a2a6b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.1.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.13", + "mongoose": "^5.4.14", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 13d4f056bcf471b8436a7d051bbf603abfbdbaf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Feb 2019 14:10:14 +0000 Subject: [PATCH 032/243] Bump jsonwebtoken from 8.3.0 to 8.5.0 Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) from 8.3.0 to 8.5.0. - [Release notes](https://github.com/auth0/node-jsonwebtoken/releases) - [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](https://github.com/auth0/node-jsonwebtoken/compare/v8.3.0...v8.5.0) Signed-off-by: dependabot[bot] --- package-lock.json | 42 +++++++++++++++++++++++++++++++++--------- package.json | 2 +- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 33163194..9e6c5090 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2429,6 +2429,14 @@ "jsbn": "~0.1.0" } }, + "ecdsa-sig-formatter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -5117,11 +5125,11 @@ } }, "jsonwebtoken": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.3.0.tgz", - "integrity": "sha512-oge/hvlmeJCH+iIz1DwcO7vKPkNGJHhgkspk8OH3VKlw+mbi42WtD4ig1+VXRln765vxptAv+xT26Fd3cteqag==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz", + "integrity": "sha512-IqEycp0znWHNA11TpYi77bVgyBO/pGESDh7Ajhas+u0ttkGkKYIIAjniL4Bw5+oVejVF+SYkaI7XKfwCCyeTuA==", "requires": { - "jws": "^3.1.5", + "jws": "^3.2.1", "lodash.includes": "^4.3.0", "lodash.isboolean": "^3.0.3", "lodash.isinteger": "^4.0.4", @@ -5129,15 +5137,26 @@ "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", - "ms": "^2.1.1" + "ms": "^2.1.1", + "semver": "^5.6.0" }, "dependencies": { + "jwa": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.2.0.tgz", + "integrity": "sha512-Grku9ZST5NNQ3hqNUodSkDfEBqAmGA1R8yiyPHOnLzEKI0GaCQC/XhFmsheXYuXzFQJdILbh+lYBiliqG5R/Vg==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.10", + "safe-buffer": "^5.0.1" + } + }, "jws": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", - "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.1.tgz", + "integrity": "sha512-bGA2omSrFUkd72dhh05bIAN832znP4wOU3lfuXtRBuGTbsmNmDXMQg28f0Vsxaxgk4myF5YkKQpz6qeRpMgX9g==", "requires": { - "jwa": "^1.1.5", + "jwa": "^1.2.0", "safe-buffer": "^5.0.1" } }, @@ -5145,6 +5164,11 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" } } }, diff --git a/package.json b/package.json index 4f4a2a6b..b3eac72d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "express-validator": "^5.3.1", "express-winston": "^2.6.0", "handlebars": "^4.1.0", - "jsonwebtoken": "^8.1.0", + "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", "mongoose": "^5.4.14", "multer": "^1.3.1", From 59a294970eb7c1865d0a77d47b0829ef9d73ec8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 21 Feb 2019 20:04:36 +0000 Subject: [PATCH 033/243] Bump mocha from 6.0.0 to 6.0.1 Bumps [mocha](https://github.com/mochajs/mocha) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.0.0...v6.0.1) Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e6c5090..67bf5764 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4567,9 +4567,9 @@ "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "requires": { "parse-passwd": "^1.0.0" @@ -5624,9 +5624,9 @@ } }, "mocha": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.0.tgz", - "integrity": "sha512-A7g9k3yr8oJaXn2IItFnfgjyxFc/LTe6Wwv7FczP+e8G74o9xYNSbMYmCf1ouldRojLrFcOb+z75P6Ak0GX6ug==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.1.tgz", + "integrity": "sha512-tQzCxWqxSD6Oyg5r7Ptbev0yAMD8p+Vfh4snPFuiUsWqYj0eVYTDT2DkEY307FTj0WRlIWN9rWMMAUzRmijgVQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", diff --git a/package.json b/package.json index b3eac72d..300ba281 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.1", "jslint": "^0.12.1", - "mocha": "^6.0.0", + "mocha": "^6.0.1", "nodemon": "^1.18.10" } } From 6c85053ff4636390fdfa935e7176e038283f11fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Feb 2019 00:45:51 +0000 Subject: [PATCH 034/243] Bump @types/mongoose from 5.3.18 to 5.3.19 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.3.18 to 5.3.19. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67bf5764..cdd26257 100644 --- a/package-lock.json +++ b/package-lock.json @@ -580,9 +580,9 @@ } }, "@types/mongoose": { - "version": "5.3.18", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.18.tgz", - "integrity": "sha512-1kR2A7Uf5iA3HehtzcXqVmr/zn1DFlwkmMcP2mTPkAlXNjZwa+F+2wdEfFOilLHEQkPHQ2dcfmYuBjBDA8YQkQ==", + "version": "5.3.19", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.19.tgz", + "integrity": "sha512-CKEDkcGBIXmvPNq/0NCbckVR2xndxpCk8CQHb0Dh1UreWSr6HuegT2WuxllNJZm5lXl2XxWBzCW0kwPtLKmtbQ==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 300ba281..3083e38f 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.18", + "@types/mongoose": "^5.3.19", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From aa65594521d9e434734fa797f1ce4d9b118fe7de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 23 Feb 2019 01:39:24 +0000 Subject: [PATCH 035/243] Bump mongoose from 5.4.14 to 5.4.15 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.14 to 5.4.15. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.14...5.4.15) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index cdd26257..99e3b872 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5873,9 +5873,9 @@ } }, "mongoose": { - "version": "5.4.14", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.14.tgz", - "integrity": "sha512-lAISH4xdx0/o0bVWPB4bxApP3bA1b08oHPEjTBq3/mIr4R494hepDJJowByBgpGYf8tj/oe6VkFCx8wbRcOciA==", + "version": "5.4.15", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.15.tgz", + "integrity": "sha512-CodfapidWmPlU93ZmdQ8H9UGg5Mc/5MqEy8y5zNQKw+Kp1UwOzSEJY6zXJW76/5MBQER859KHl3rvHijVMsUMg==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 3083e38f..db92cb0d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.14", + "mongoose": "^5.4.15", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 12fb95e88b844cc903d6bd5faf3f26465e07c198 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Feb 2019 18:20:20 +0000 Subject: [PATCH 036/243] Bump mocha from 6.0.1 to 6.0.2 Bumps [mocha](https://github.com/mochajs/mocha) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.0.1...v6.0.2) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 99e3b872..20e40fbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5624,9 +5624,9 @@ } }, "mocha": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.1.tgz", - "integrity": "sha512-tQzCxWqxSD6Oyg5r7Ptbev0yAMD8p+Vfh4snPFuiUsWqYj0eVYTDT2DkEY307FTj0WRlIWN9rWMMAUzRmijgVQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", + "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", diff --git a/package.json b/package.json index db92cb0d..c565d310 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.1", "jslint": "^0.12.1", - "mocha": "^6.0.1", + "mocha": "^6.0.2", "nodemon": "^1.18.10" } } From 32e99e17e4a2f1b20bcfa8b7d88cc740ca8952e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Feb 2019 23:54:32 +0000 Subject: [PATCH 037/243] Bump @types/mongoose from 5.3.19 to 5.3.20 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.3.19 to 5.3.20. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20e40fbf..1cc8be62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -580,9 +580,9 @@ } }, "@types/mongoose": { - "version": "5.3.19", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.19.tgz", - "integrity": "sha512-CKEDkcGBIXmvPNq/0NCbckVR2xndxpCk8CQHb0Dh1UreWSr6HuegT2WuxllNJZm5lXl2XxWBzCW0kwPtLKmtbQ==", + "version": "5.3.20", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.20.tgz", + "integrity": "sha512-KXD/wRaUkxA7NwU+0yp60WEFFmkhzJ4idGawycjUxFMTANIM7ZqlZsoXhHu3p33cg450D8PuwtAorFUwuMXLwA==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index c565d310..fdc2e585 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.19", - "@types/mongoose": "^5.3.19", + "@types/mongoose": "^5.3.20", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From d0c345371b64a45e9279e857f206ace89aa2ec0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 2 Mar 2019 02:09:03 +0000 Subject: [PATCH 038/243] Bump @types/mongodb from 3.1.19 to 3.1.20 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.19 to 3.1.20. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1cc8be62..022615b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -470,9 +470,9 @@ } }, "@types/bson": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@types/bson/-/bson-1.0.11.tgz", - "integrity": "sha512-j+UcCWI+FsbI5/FQP/Kj2CXyplWAz39ktHFkXk84h7dNblKRSoNJs95PZFRd96NQGqsPEPgeclqnznWZr14ZDA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.0.tgz", + "integrity": "sha512-pq/rqJwJWkbS10crsG5bgnrisL8pML79KlMKQMoQwLUjlPAkrUHMvHJ3oGwE7WHR61Lv/nadMwXVAD2b+fpD8Q==", "dev": true, "requires": { "@types/node": "*" @@ -570,9 +570,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.19", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.19.tgz", - "integrity": "sha512-H54hQEovAhyLrIZOhPNfGyCCDoTqKsjb8GQBy8nptJqfxrYCp5WVcPJf9v0kfTPR72xOhaz9+WcYxOXWwEg1Vg==", + "version": "3.1.20", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.20.tgz", + "integrity": "sha512-tl9iKbhM8d9BQjhB/9L4KuyLxfEn9Weq6cBuM8C06fIuUJyyfk+5wlfwzvltvssuxjGY1GiHvZHmSTK8kJ1zwg==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index fdc2e585..f05ffc29 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.19", + "@types/mongodb": "^3.1.20", "@types/mongoose": "^5.3.20", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From 43acf9f69e91ffe2d987ca3da339789f1c6274b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 2 Mar 2019 02:34:41 +0000 Subject: [PATCH 039/243] Bump mongoose from 5.4.15 to 5.4.16 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.15 to 5.4.16. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.15...5.4.16) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 022615b4..ae52ed38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5873,9 +5873,9 @@ } }, "mongoose": { - "version": "5.4.15", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.15.tgz", - "integrity": "sha512-CodfapidWmPlU93ZmdQ8H9UGg5Mc/5MqEy8y5zNQKw+Kp1UwOzSEJY6zXJW76/5MBQER859KHl3rvHijVMsUMg==", + "version": "5.4.16", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.16.tgz", + "integrity": "sha512-1lGuXBBxs8KloHMe0mZGpC8L+l+flRFh3IoNf2lRmSaSMrpgEjrBHm6Aypfe2s+Y5xO0h7gua3TAZUplWpMxSw==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index f05ffc29..88c7c753 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.15", + "mongoose": "^5.4.16", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From b46711871d90c139569fef76d03c8651436e9db5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sun, 3 Mar 2019 23:40:48 +0000 Subject: [PATCH 040/243] Bump mongoose from 5.4.16 to 5.4.17 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.16 to 5.4.17. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.16...5.4.17) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae52ed38..3787dfd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5873,9 +5873,9 @@ } }, "mongoose": { - "version": "5.4.16", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.16.tgz", - "integrity": "sha512-1lGuXBBxs8KloHMe0mZGpC8L+l+flRFh3IoNf2lRmSaSMrpgEjrBHm6Aypfe2s+Y5xO0h7gua3TAZUplWpMxSw==", + "version": "5.4.17", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.17.tgz", + "integrity": "sha512-9aAg8M0YUmGHQRDYvsKJ02wx/Qaof1Jn2iDH21ZtWGAZpQt9uVLNEOdcBuzi+lPJwGbLYh2dphdKX0sZ+dXAJQ==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 88c7c753..1ce779b1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.16", + "mongoose": "^5.4.17", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 63b9377009ba563c4c84b9e3f2f71bcb20d450ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Mar 2019 16:15:53 +0000 Subject: [PATCH 041/243] Bump @types/mongoose from 5.3.20 to 5.3.21 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.3.20 to 5.3.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3787dfd0..58c31a4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -580,9 +580,9 @@ } }, "@types/mongoose": { - "version": "5.3.20", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.20.tgz", - "integrity": "sha512-KXD/wRaUkxA7NwU+0yp60WEFFmkhzJ4idGawycjUxFMTANIM7ZqlZsoXhHu3p33cg450D8PuwtAorFUwuMXLwA==", + "version": "5.3.21", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.21.tgz", + "integrity": "sha512-Cfx8f9TW+tkxVIkZXsDTWrbsECxrIItlbykNDXNsrNhee85v79YRFkCf1wvn+vlcHL/eEO8gjSRSZ+9Hf9jMnw==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 1ce779b1..b8b6a370 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.20", - "@types/mongoose": "^5.3.20", + "@types/mongoose": "^5.3.21", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From a423594f6bc6be8cee084c7965731c71b9ee0c10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 7 Mar 2019 16:04:42 +0000 Subject: [PATCH 042/243] Bump @types/mongodb from 3.1.20 to 3.1.21 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.20 to 3.1.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 58c31a4b..4630a515 100644 --- a/package-lock.json +++ b/package-lock.json @@ -570,9 +570,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.20.tgz", - "integrity": "sha512-tl9iKbhM8d9BQjhB/9L4KuyLxfEn9Weq6cBuM8C06fIuUJyyfk+5wlfwzvltvssuxjGY1GiHvZHmSTK8kJ1zwg==", + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.21.tgz", + "integrity": "sha512-V1W/OFjUdz8xeVetg37eF1tpC+4y60YAn5pgB1pGW58oxNwNw/gU/k7EaUFXTVUTwKS6Ot6Ui6xEm60ZD4zCAg==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index b8b6a370..989bfc03 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.20", + "@types/mongodb": "^3.1.21", "@types/mongoose": "^5.3.21", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From 567e22afdba922eda6454ef2e2a6487d8b5d5551 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 8 Mar 2019 16:19:04 +0000 Subject: [PATCH 043/243] Bump mongoose from 5.4.17 to 5.4.18 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.17 to 5.4.18. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.17...5.4.18) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4630a515..6ebc21ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5873,9 +5873,9 @@ } }, "mongoose": { - "version": "5.4.17", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.17.tgz", - "integrity": "sha512-9aAg8M0YUmGHQRDYvsKJ02wx/Qaof1Jn2iDH21ZtWGAZpQt9uVLNEOdcBuzi+lPJwGbLYh2dphdKX0sZ+dXAJQ==", + "version": "5.4.18", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.18.tgz", + "integrity": "sha512-yiSd/1OYYfK9EuH6NFO/NnTD4AZPIpRY1i58xUssgCGsYDX3qEYcdgFeknB5OArMB1Ny3wwMW8xiip2I5pgszw==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 989bfc03..9f3db3b8 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.17", + "mongoose": "^5.4.18", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From e512b6d055648b60fa4b66b087f2d02839ff70c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 9 Mar 2019 00:42:07 +0000 Subject: [PATCH 044/243] Bump @types/mongodb from 3.1.21 to 3.1.22 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.21 to 3.1.22. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ebc21ee..d8e6f690 100644 --- a/package-lock.json +++ b/package-lock.json @@ -570,9 +570,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.21.tgz", - "integrity": "sha512-V1W/OFjUdz8xeVetg37eF1tpC+4y60YAn5pgB1pGW58oxNwNw/gU/k7EaUFXTVUTwKS6Ot6Ui6xEm60ZD4zCAg==", + "version": "3.1.22", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.22.tgz", + "integrity": "sha512-hvNR0txBlJJAy1eZOeIDshW4dnQaC694COou4eHHaMdIcteCfoCQATD7sYNlXxNxfTc1iIbHUi7A8CAhQe08uA==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 9f3db3b8..0b205c06 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.21", + "@types/mongodb": "^3.1.22", "@types/mongoose": "^5.3.21", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From 325a7115d47b6ac0d8695ff73a91e04acab036c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 11 Mar 2019 22:44:47 +0000 Subject: [PATCH 045/243] Bump mongoose from 5.4.18 to 5.4.19 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.18 to 5.4.19. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.18...5.4.19) Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8e6f690..c4fce8ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1625,9 +1625,9 @@ "dev": true }, "bson": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz", - "integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.1.tgz", + "integrity": "sha512-jCGVYLoYMHDkOsbwJZBCqwMHyH4c+wzgI9hG7Z6SZJRXWr+x58pdIbm2i9a/jFGCkRJqRUr8eoI7lDWa0hTkxg==" }, "buffer-equal-constant-time": { "version": "1.0.1", @@ -5873,9 +5873,9 @@ } }, "mongoose": { - "version": "5.4.18", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.18.tgz", - "integrity": "sha512-yiSd/1OYYfK9EuH6NFO/NnTD4AZPIpRY1i58xUssgCGsYDX3qEYcdgFeknB5OArMB1Ny3wwMW8xiip2I5pgszw==", + "version": "5.4.19", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.19.tgz", + "integrity": "sha512-paRU3nbCrPIUVw1GAlxo11uIIqrYORctUx1kcLj7i2NhkxPQuy5OK2/FYj8+tglsaixycmONSyop2HQp1IUQSA==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 0b205c06..780e0eef 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.0", "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", - "mongoose": "^5.4.18", + "mongoose": "^5.4.19", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From b78a32ba76f137e31d36c44eab7fba142d39da5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 13 Mar 2019 20:40:58 +0000 Subject: [PATCH 046/243] Bump jshint from 2.10.1 to 2.10.2 Bumps [jshint](https://github.com/jshint/jshint) from 2.10.1 to 2.10.2. - [Release notes](https://github.com/jshint/jshint/releases) - [Changelog](https://github.com/jshint/jshint/blob/master/CHANGELOG.md) - [Commits](https://github.com/jshint/jshint/compare/2.10.1...2.10.2) Signed-off-by: dependabot[bot] --- package-lock.json | 24 +++++++++--------------- package.json | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4fce8ff..0df71291 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2342,21 +2342,15 @@ "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs=" }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", "dev": true, "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" + "domelementtype": "^1.3.0", + "entities": "^1.1.1" }, "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", @@ -5004,16 +4998,16 @@ "optional": true }, "jshint": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.1.tgz", - "integrity": "sha512-9GpPfKeffYBl7oBDX2lHPG16j0AM7D2bn3aLy9DaWTr6CWa0i/7UGhX8WLZ7V14QQnnr4hXbjauTLYg06F+HYw==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.2.tgz", + "integrity": "sha512-e7KZgCSXMJxznE/4WULzybCMNXNAd/bf5TSrvVEq78Q/K8ZwFpmBqQeDtNiHc3l49nV4E/+YeHU/JZjSUIrLAA==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.10", + "lodash": "~4.17.11", "minimatch": "~3.0.2", "shelljs": "0.3.x", "strip-json-comments": "1.0.x" diff --git a/package.json b/package.json index 780e0eef..d344a532 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "apidoc": "^0.17.7", "chai": "^4.2.0", "chai-http": "^4.2.1", - "jshint": "^2.10.1", + "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.0.2", "nodemon": "^1.18.10" From d043d95ccb16563db5be4cc5ad62fb95132a314e Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Thu, 14 Mar 2019 12:32:52 -0400 Subject: [PATCH 047/243] Clean up code in seed files (#389) --- seed/index.js | 26 +++++++++++++------------- seed/roles.seed.js | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/seed/index.js b/seed/index.js index 09858612..01ab7b8f 100644 --- a/seed/index.js +++ b/seed/index.js @@ -9,21 +9,21 @@ const Seed = { const db = require("../services/database.service"); //connect to db -db.connect(undefined, onConnected); - -//called when the db is connected -function onConnected() { - dropAll().then(() => { - console.log("Finished dropping"); - storeAll().then(() => { - console.log("Finished seeding"); - }).catch((error) => { - console.log(error); - }); - }, (err) => { - console.error(err); +db.connect(undefined, () => { + onConnected().catch((reason) => { + console.error(reason); + process.exit(1); + }).then(() => { + process.exit(0); }); +}); +//called when the db is connected +async function onConnected() { + await dropAll(); + console.log("Finished dropping"); + await storeAll(); + console.log("Finished seeding"); } async function dropAll() { diff --git a/seed/roles.seed.js b/seed/roles.seed.js index 867e6c31..eeddf709 100644 --- a/seed/roles.seed.js +++ b/seed/roles.seed.js @@ -14,7 +14,7 @@ if (envLoadResult.error) { * Drops all elements in Role */ function dropAll() { - return Role.remove({}); + return Role.deleteMany({}); } /** From 32990a849fa8285adb8863a11021cedf94184bc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 14 Mar 2019 23:42:22 +0000 Subject: [PATCH 048/243] Bump @google-cloud/storage from 2.4.2 to 2.4.3 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 2.4.2 to 2.4.3. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v2.4.2...v2.4.3) Signed-off-by: dependabot[bot] --- package-lock.json | 355 ++++++++++------------------------------------ package.json | 2 +- 2 files changed, 75 insertions(+), 282 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0df71291..6272b191 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,20 +174,20 @@ "integrity": "sha512-QzB0/IMvB0eFxFK7Eqh+bfC8NLv3E9ScjWQrPOk6GgfNroxcVITdTlT8NRsRrcp5+QQJVPLkRqKG0PUdaWXmHw==" }, "@google-cloud/storage": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.4.2.tgz", - "integrity": "sha512-G4rlt5h2oypPYU2ZtmF3N0FpE47aRvsxp8NmZEdlScd5LgjDAu5Ha01hMOA/ZHBVsUlOGFfa+TxU5Ei/56+0Gg==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.4.3.tgz", + "integrity": "sha512-Ol0Ed1zYNYixq+wPPaFNIVjT5+KJldBI6vyRDXnrAu5Yu66PU4iMJvEztUVfckz6vsihwApBMeXxdDUyJzMM2w==", "requires": { "@google-cloud/common": "^0.31.0", - "@google-cloud/paginator": "^0.1.0", - "@google-cloud/promisify": "^0.3.0", + "@google-cloud/paginator": "^0.2.0", + "@google-cloud/promisify": "^0.4.0", "arrify": "^1.0.0", "async": "^2.0.1", "compressible": "^2.0.12", "concat-stream": "^2.0.0", "duplexify": "^3.5.0", "extend": "^3.0.0", - "gcs-resumable-upload": "^0.14.1", + "gcs-resumable-upload": "^1.0.0", "hash-stream-validation": "^0.2.1", "mime": "^2.2.0", "mime-types": "^2.0.8", @@ -201,12 +201,12 @@ }, "dependencies": { "@google-cloud/common": { - "version": "0.31.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.31.0.tgz", - "integrity": "sha512-mO7WFavzqmr24btNb2zimUh+M3fGnIKGbkR1VT6ZG3yDV+S7BiZPmPiFHKRJVrxwi5sA9U6X6fpNpHgj7j2a2w==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.31.1.tgz", + "integrity": "sha512-MgaF8VmDaoyIqzZUXIbcohTb5sQn+PYlYmcpb0/E8psUpVe+kaBwLq/Z8pcFtACCr6PNT36n+a6s1kG35bAuCA==", "requires": { "@google-cloud/projectify": "^0.3.2", - "@google-cloud/promisify": "^0.3.0", + "@google-cloud/promisify": "^0.4.0", "@types/duplexify": "^3.5.0", "@types/request": "^2.47.0", "arrify": "^1.0.1", @@ -218,6 +218,22 @@ "retry-request": "^4.0.0" } }, + "@google-cloud/paginator": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-0.2.0.tgz", + "integrity": "sha512-2ZSARojHDhkLvQ+CS32K+iUhBsWg3AEw+uxtqblA7xoCABDyhpj99FPp35xy6A+XlzMhOSrHHaxFE+t6ZTQq0w==", + "requires": { + "arrify": "^1.0.1", + "extend": "^3.0.1", + "split-array-stream": "^2.0.0", + "stream-events": "^1.0.4" + } + }, + "@google-cloud/promisify": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz", + "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" + }, "concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", @@ -227,63 +243,6 @@ "inherits": "^2.0.3", "readable-stream": "^3.0.2", "typedarray": "^0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", - "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "gcp-metadata": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.9.3.tgz", - "integrity": "sha512-caV4S84xAjENtpezLCT/GILEAF5h/bC4cNqZFmt/tjTn8t+JBtTkQrgBrJu3857YdsnlM8rxX/PMcKGtE8hUlw==", - "requires": { - "gaxios": "^1.0.2", - "json-bigint": "^0.3.0" - } - }, - "google-auth-library": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.0.1.tgz", - "integrity": "sha512-ZGTBMiQga/pwEw26ZKCn+q9PTPXvE4v5sL2V9HV3f2Gt0lrS+2H7XgbVCx850jrvlEL59JIheFiDqEn9CIa0nA==", - "requires": { - "base64-js": "^1.3.0", - "fast-text-encoding": "^1.0.0", - "gaxios": "^1.2.1", - "gcp-metadata": "^0.9.3", - "gtoken": "^2.3.2", - "https-proxy-agent": "^2.2.1", - "jws": "^3.1.5", - "lru-cache": "^5.0.0", - "semver": "^5.5.0" - } - }, - "gtoken": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz", - "integrity": "sha512-F8EObUGyC8Qd3WXTloNULZBwfUsOABoHElihB1F6zGhT/cy38iPL09wGLRY712I+hQnOyA+sYlgPFX2cOKz0qg==", - "requires": { - "gaxios": "^1.0.4", - "google-p12-pem": "^1.0.0", - "jws": "^3.1.5", - "mime": "^2.2.0", - "pify": "^4.0.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" } }, "mime": { @@ -296,38 +255,23 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" }, - "retry-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz", - "integrity": "sha512-S4HNLaWcMP6r8E4TMH52Y7/pM8uNayOcTDDQNBwsCccL1uI+Ol2TljxRDPzaNfbhOB30+XWP5NnZkB3LiJxi1w==", + "readable-stream": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", + "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", "requires": { - "through2": "^2.0.0" - }, - "dependencies": { - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "through2": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", - "integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", "requires": { - "readable-stream": "2 || 3", - "xtend": "~4.0.1" + "readable-stream": "2 || 3" } - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, @@ -651,6 +595,14 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "abort-controller": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-2.0.3.tgz", + "integrity": "sha512-EPSq5wr2aFyAZ1PejJB32IX9Qd4Nwus+adnp7STYFM5/23nLPBazqZ1oor6ZqbH+4otaaGXTlC8RN5hq3C8w9Q==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", @@ -1959,11 +1911,11 @@ "dev": true }, "compressible": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz", - "integrity": "sha512-4aE67DL33dSW9gw4CI2H/yTxqHLNcxp0yS6jB+4h+wr3e43+1z7vm0HU9qXOH8j+qjKuL8+UtkOxYQSMq60Ylw==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.16.tgz", + "integrity": "sha512-JQfEOdnI7dASwCuSPWIeVYwc/zMsu/+tRhoUvEfXz2gxOA2DNjmG5vhtFdBlhWPPGo+RdT9S3tgc/uH5qgDiiA==", "requires": { - "mime-db": ">= 1.36.0 < 2" + "mime-db": ">= 1.38.0 < 2" }, "dependencies": { "mime-db": { @@ -2534,6 +2486,11 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "eventid": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/eventid/-/eventid-0.1.2.tgz", @@ -3552,33 +3509,18 @@ } }, "gcs-resumable-upload": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-0.14.1.tgz", - "integrity": "sha512-vkIxLeVyW20DdcyhI8GvOkISV62y7+fKAdelUTn8F5en8AmPduqro5xz3VoHkj/RJ3PQmqNovYYaYPyPHwebzw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-1.0.0.tgz", + "integrity": "sha512-InuVkmj7srAb64w/vSaCU162jk7p4UHmibvfFjT1opO1tiK8Yy88/BeEYn2bCVMv6LH0Sw29L70ejG6oPeq8Ig==", "requires": { + "abort-controller": "^2.0.2", "configstore": "^4.0.0", + "gaxios": "^1.5.0", "google-auth-library": "^3.0.0", "pumpify": "^1.5.1", - "request": "^2.87.0", "stream-events": "^1.0.4" }, "dependencies": { - "ajv": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", - "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, "configstore": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", @@ -3592,153 +3534,16 @@ "xdg-basedir": "^3.0.0" } }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "gcp-metadata": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-0.9.3.tgz", - "integrity": "sha512-caV4S84xAjENtpezLCT/GILEAF5h/bC4cNqZFmt/tjTn8t+JBtTkQrgBrJu3857YdsnlM8rxX/PMcKGtE8hUlw==", + "gaxios": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.2.tgz", + "integrity": "sha512-Mp6zmABg+0CxJA4b7DEWQ4ZWQzEaWxRNmHAcvCO+HU3dfoFTY925bdpZrTkLWPEtKjS9RBJKrJInzb+VtvAVYA==", "requires": { - "gaxios": "^1.0.2", - "json-bigint": "^0.3.0" - } - }, - "google-auth-library": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.0.1.tgz", - "integrity": "sha512-ZGTBMiQga/pwEw26ZKCn+q9PTPXvE4v5sL2V9HV3f2Gt0lrS+2H7XgbVCx850jrvlEL59JIheFiDqEn9CIa0nA==", - "requires": { - "base64-js": "^1.3.0", - "fast-text-encoding": "^1.0.0", - "gaxios": "^1.2.1", - "gcp-metadata": "^0.9.3", - "gtoken": "^2.3.2", + "abort-controller": "^2.0.2", + "extend": "^3.0.2", "https-proxy-agent": "^2.2.1", - "jws": "^3.1.5", - "lru-cache": "^5.0.0", - "semver": "^5.5.0" + "node-fetch": "^2.3.0" } - }, - "gtoken": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz", - "integrity": "sha512-F8EObUGyC8Qd3WXTloNULZBwfUsOABoHElihB1F6zGhT/cy38iPL09wGLRY712I+hQnOyA+sYlgPFX2cOKz0qg==", - "requires": { - "gaxios": "^1.0.4", - "google-p12-pem": "^1.0.0", - "jws": "^3.1.5", - "mime": "^2.2.0", - "pify": "^4.0.0" - } - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==" - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "requires": { - "mime-db": "~1.37.0" - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, @@ -6435,11 +6240,6 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, "pstree.remy": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz", @@ -7177,6 +6977,14 @@ "memory-pager": "^1.0.2" } }, + "split-array-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-2.0.0.tgz", + "integrity": "sha512-hmMswlVY91WvGMxs0k8MRgq8zb2mSen4FmDNc5AFiTWtrBpdZN6nwD6kROVe4vNL+ywrvbCKsWVCnEd4riELIg==", + "requires": { + "is-stream-ended": "^0.1.4" + } + }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -7708,21 +7516,6 @@ } } }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - } - } - }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", diff --git a/package.json b/package.json index d344a532..edaac395 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.0", - "@google-cloud/storage": "^2.4.2", + "@google-cloud/storage": "^2.4.3", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.4", "cookie-parser": "~1.4.4", From f83b12067454d95e8e6ef69a0c7d370437233bca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 16 Mar 2019 21:34:10 +0000 Subject: [PATCH 049/243] Bump handlebars from 4.1.0 to 4.1.1 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.1.1/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.0...v4.1.1) Signed-off-by: dependabot[bot] --- package-lock.json | 33 +++++++++++++++++++-------------- package.json | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6272b191..9fab1069 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1904,6 +1904,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "optional": true + }, "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", @@ -4222,11 +4228,11 @@ } }, "handlebars": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz", + "integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==", "requires": { - "async": "^2.5.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" @@ -5795,6 +5801,11 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==" + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -7327,21 +7338,15 @@ "dev": true }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", + "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", "optional": true, "requires": { - "commander": "~2.17.1", + "commander": "~2.19.0", "source-map": "~0.6.1" }, "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "optional": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", diff --git a/package.json b/package.json index edaac395..8a229668 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.16.0", "express-validator": "^5.3.1", "express-winston": "^2.6.0", - "handlebars": "^4.1.0", + "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.0", "memory-cache": "^0.2.0", "mongoose": "^5.4.19", From 796e078e5e31a54d92b5e8db70d08deb546d0e48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Mar 2019 12:59:36 +0000 Subject: [PATCH 050/243] Bump jsonwebtoken from 8.5.0 to 8.5.1 Bumps [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) from 8.5.0 to 8.5.1. - [Release notes](https://github.com/auth0/node-jsonwebtoken/releases) - [Changelog](https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](https://github.com/auth0/node-jsonwebtoken/compare/v8.5.0...v8.5.1) Signed-off-by: dependabot[bot] --- package-lock.json | 30 +++++++++++++++--------------- package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9fab1069..bd26ccc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2382,9 +2382,9 @@ } }, "ecdsa-sig-formatter": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", - "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "requires": { "safe-buffer": "^5.0.1" } @@ -4930,11 +4930,11 @@ } }, "jsonwebtoken": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.0.tgz", - "integrity": "sha512-IqEycp0znWHNA11TpYi77bVgyBO/pGESDh7Ajhas+u0ttkGkKYIIAjniL4Bw5+oVejVF+SYkaI7XKfwCCyeTuA==", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", "requires": { - "jws": "^3.2.1", + "jws": "^3.2.2", "lodash.includes": "^4.3.0", "lodash.isboolean": "^3.0.3", "lodash.isinteger": "^4.0.4", @@ -4947,21 +4947,21 @@ }, "dependencies": { "jwa": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.2.0.tgz", - "integrity": "sha512-Grku9ZST5NNQ3hqNUodSkDfEBqAmGA1R8yiyPHOnLzEKI0GaCQC/XhFmsheXYuXzFQJdILbh+lYBiliqG5R/Vg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "requires": { "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.10", + "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "jws": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.1.tgz", - "integrity": "sha512-bGA2omSrFUkd72dhh05bIAN832znP4wOU3lfuXtRBuGTbsmNmDXMQg28f0Vsxaxgk4myF5YkKQpz6qeRpMgX9g==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "requires": { - "jwa": "^1.2.0", + "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, diff --git a/package.json b/package.json index 8a229668..70230771 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "express-validator": "^5.3.1", "express-winston": "^2.6.0", "handlebars": "^4.1.1", - "jsonwebtoken": "^8.5.0", + "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.4.19", "multer": "^1.3.1", From d39d7255569d01f5c20adaee6582c88b3028a732 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Mar 2019 23:19:23 +0000 Subject: [PATCH 051/243] Bump @types/mongoose from 5.3.21 to 5.3.23 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.3.21 to 5.3.23. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd26ccc4..d3341b2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -524,9 +524,9 @@ } }, "@types/mongoose": { - "version": "5.3.21", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.21.tgz", - "integrity": "sha512-Cfx8f9TW+tkxVIkZXsDTWrbsECxrIItlbykNDXNsrNhee85v79YRFkCf1wvn+vlcHL/eEO8gjSRSZ+9Hf9jMnw==", + "version": "5.3.23", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.23.tgz", + "integrity": "sha512-UZJOkFe/ShSt3iYFBiadwwCu2Y8qm/RZyAoCQI2uf88wr3NfDBpbqqoIyrchBy1y2XtvAAyktEPzvvR7up6/TQ==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 70230771..74edb53e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.22", - "@types/mongoose": "^5.3.21", + "@types/mongoose": "^5.3.23", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From 102caa7f593187bce286637004c540aad8036bb0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Mar 2019 23:12:53 +0000 Subject: [PATCH 052/243] Bump bcrypt from 3.0.4 to 3.0.5 Bumps [bcrypt](https://github.com/kelektiv/node.bcrypt.js) from 3.0.4 to 3.0.5. - [Release notes](https://github.com/kelektiv/node.bcrypt.js/releases) - [Changelog](https://github.com/kelektiv/node.bcrypt.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/kelektiv/node.bcrypt.js/compare/v3.0.4...v3.0.5) Signed-off-by: dependabot[bot] --- package-lock.json | 878 ++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 335 insertions(+), 545 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3341b2b..502c977f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -592,8 +592,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "abort-controller": { "version": "2.0.3", @@ -787,6 +786,20 @@ "resolved": "https://registry.npmjs.org/append-field/-/append-field-0.1.0.tgz", "integrity": "sha1-bdxY+gg8e8VF08WZWygwzCNm1Eo=" }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -864,536 +877,116 @@ "async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "requires": { - "lodash": "^4.17.10" - } - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" - }, - "bcrypt": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.4.tgz", - "integrity": "sha512-XqmCym97kT6l+jFEKeFvGuNE9aVEFDGsLMv+tIBTXkJI1sHS0g8s7VQEPJagSMPwWiB5Vpr2kVzVKc/YfwWthA==", - "requires": { - "nan": "2.12.1", - "node-pre-gyp": "0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "minipass": { - "version": "2.3.4", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, - "minizlib": { - "version": "1.1.1", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" - }, - "needle": { - "version": "2.2.4", - "bundled": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.5", - "bundled": true - }, - "npm-packlist": { - "version": "1.1.12", - "bundled": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true - } - } - }, - "readable-stream": { - "version": "2.3.5", - "bundled": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.0.3", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true - }, - "sax": { - "version": "1.2.4", - "bundled": true - }, - "semver": { - "version": "5.6.0", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.0.3", - "bundled": true, + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "^4.17.10" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "is-descriptor": "^1.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "kind-of": "^6.0.0" } }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } + "kind-of": "^6.0.0" } }, - "util-deprecate": { + "is-descriptor": { "version": "1.0.2", - "bundled": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { - "string-width": "^1.0.2 || 2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + }, + "bcrypt": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.5.tgz", + "integrity": "sha512-m4o91nB+Ce8696Ao4R3B/WtVWTc1Lszgd098/OIjU9D/URmdYwT3ooBs9uv1b97J5YhZweTq9lldPefTYZ0TwA==", + "requires": { + "nan": "2.13.1", + "node-pre-gyp": "0.12.0" + }, + "dependencies": { + "nan": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz", + "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==" } } }, @@ -1535,7 +1128,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1762,6 +1354,11 @@ "upath": "^1.1.0" } }, + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" + }, "ci-info": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", @@ -1934,8 +1531,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -1971,6 +1567,11 @@ "date-now": "^0.1.4" } }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + }, "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -2166,8 +1767,7 @@ "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, "deepmerge": { "version": "2.1.1", @@ -2229,6 +1829,11 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -2245,6 +1850,11 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" + }, "diagnostics": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz", @@ -2935,11 +2545,18 @@ } } }, + "fs-minipass": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "requires": { + "minipass": "^2.2.1" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.7", @@ -3495,6 +3112,21 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, "gaxios": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.4.0.tgz", @@ -4284,6 +3916,11 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -4475,6 +4112,14 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "requires": { + "minimatch": "^3.0.4" + } + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -4490,7 +4135,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4504,8 +4148,7 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "invert-kv": { "version": "1.0.0", @@ -5389,7 +5032,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5399,6 +5041,35 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, + "minipass": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "requires": { + "minipass": "^2.2.1" + } + }, "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", @@ -5796,6 +5467,26 @@ "to-regex": "^3.0.1" } }, + "needle": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", + "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + } + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -5830,6 +5521,34 @@ "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.5.tgz", "integrity": "sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ==" }, + "node-pre-gyp": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", + "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + }, + "dependencies": { + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + } + } + }, "nodemon": { "version": "1.18.10", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.10.tgz", @@ -5880,6 +5599,20 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "npm-bundled": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" + }, + "npm-packlist": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", + "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -5888,6 +5621,17 @@ "path-key": "^2.0.0" } }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -6024,8 +5768,7 @@ "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "os-locale": { "version": "1.4.0", @@ -6038,14 +5781,12 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "osenv": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, "requires": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -6147,8 +5888,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -6483,7 +6223,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -6494,8 +6233,7 @@ "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, @@ -6659,6 +6397,29 @@ "through2": "^2.0.0" } }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -6682,6 +6443,11 @@ "sparse-bitfield": "^3.0.3" } }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", @@ -7114,8 +6880,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "stubs": { "version": "3.0.0", @@ -7165,6 +6930,32 @@ "has-flag": "^3.0.0" } }, + "tar": { + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } + }, "teeny-request": { "version": "3.11.3", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", @@ -7599,7 +7390,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, "requires": { "string-width": "^1.0.2 || 2" } diff --git a/package.json b/package.json index 74edb53e..4a602c52 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@google-cloud/logging-winston": "^0.11.0", "@google-cloud/storage": "^2.4.3", "@sendgrid/mail": "^6.3.1", - "bcrypt": "^3.0.4", + "bcrypt": "^3.0.5", "cookie-parser": "~1.4.4", "cookie-session": "^2.0.0-beta.3", "cors": "^2.8.5", From e9eb7f72f82642c5460c2e27897487996d8277db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Mar 2019 21:31:39 +0000 Subject: [PATCH 053/243] Bump mongoose from 5.4.19 to 5.4.20 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.19 to 5.4.20. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.19...5.4.20) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 502c977f..020c2f9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5349,9 +5349,9 @@ } }, "mongoose": { - "version": "5.4.19", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.19.tgz", - "integrity": "sha512-paRU3nbCrPIUVw1GAlxo11uIIqrYORctUx1kcLj7i2NhkxPQuy5OK2/FYj8+tglsaixycmONSyop2HQp1IUQSA==", + "version": "5.4.20", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.20.tgz", + "integrity": "sha512-CyybxMQbCaq6jvbroamS5mPfFbxTOLLpdpkQrk1cj7Az1TX+mBbcCVhz+7XElfTMIOb58ah9O+EXmZJsLPD3Lg==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 4a602c52..29327e56 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.4.19", + "mongoose": "^5.4.20", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 695b22f58925db76c44ddd892c1ccf0247e0c62e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 2 Apr 2019 16:58:19 +0000 Subject: [PATCH 054/243] Bump mongoose from 5.4.20 to 5.4.21 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.20 to 5.4.21. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.20...5.4.21) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 020c2f9a..4744ada7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5349,9 +5349,9 @@ } }, "mongoose": { - "version": "5.4.20", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.20.tgz", - "integrity": "sha512-CyybxMQbCaq6jvbroamS5mPfFbxTOLLpdpkQrk1cj7Az1TX+mBbcCVhz+7XElfTMIOb58ah9O+EXmZJsLPD3Lg==", + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.21.tgz", + "integrity": "sha512-8teQZ/YUXv7+m5GaPDTmyoSJx7tPczZ99vM0/MS8GFCGVn8BKb5jQzuQCP62nBH4vN6Dmf0OiVKTFUkCpkVp+Q==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index 29327e56..c7b5f417 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.4.20", + "mongoose": "^5.4.21", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From be2e7dee344a631f6fb4d52a2c92e56dd7ca4b62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 4 Apr 2019 19:47:55 +0000 Subject: [PATCH 055/243] Bump mongoose from 5.4.21 to 5.4.22 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.21 to 5.4.22. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.21...5.4.22) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4744ada7..e43da74a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5349,9 +5349,9 @@ } }, "mongoose": { - "version": "5.4.21", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.21.tgz", - "integrity": "sha512-8teQZ/YUXv7+m5GaPDTmyoSJx7tPczZ99vM0/MS8GFCGVn8BKb5jQzuQCP62nBH4vN6Dmf0OiVKTFUkCpkVp+Q==", + "version": "5.4.22", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.22.tgz", + "integrity": "sha512-rbtmFmXe5YJfBrVfOpSW2xeSAKFtnJ5RLQjl4ULzT1icmY/SUHtJ5b+mW4SMCEk7whm/w+2oHO9qMBr8UI1xIw==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index c7b5f417..c9dc7194 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.4.21", + "mongoose": "^5.4.22", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 24b0db550be34342268634eb8d0ed8ecd0e4ed9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 4 Apr 2019 22:53:13 +0000 Subject: [PATCH 056/243] Bump @google-cloud/storage from 2.4.3 to 2.5.0 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 2.4.3 to 2.5.0. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v2.4.3...v2.5.0) Signed-off-by: dependabot[bot] --- package-lock.json | 138 +++++++++++++++++++++++++++++++++++++--------- package.json | 2 +- 2 files changed, 112 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index e43da74a..f0dfb7e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,24 +174,25 @@ "integrity": "sha512-QzB0/IMvB0eFxFK7Eqh+bfC8NLv3E9ScjWQrPOk6GgfNroxcVITdTlT8NRsRrcp5+QQJVPLkRqKG0PUdaWXmHw==" }, "@google-cloud/storage": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.4.3.tgz", - "integrity": "sha512-Ol0Ed1zYNYixq+wPPaFNIVjT5+KJldBI6vyRDXnrAu5Yu66PU4iMJvEztUVfckz6vsihwApBMeXxdDUyJzMM2w==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.5.0.tgz", + "integrity": "sha512-q1mwB6RUebIahbA3eriRs8DbG2Ij81Ynb9k8hMqTPkmbd8/S6Z0d6hVvfPmnyvX9Ej13IcmEYIbymuq/RBLghA==", "requires": { - "@google-cloud/common": "^0.31.0", + "@google-cloud/common": "^0.32.0", "@google-cloud/paginator": "^0.2.0", "@google-cloud/promisify": "^0.4.0", "arrify": "^1.0.0", "async": "^2.0.1", "compressible": "^2.0.12", "concat-stream": "^2.0.0", + "date-and-time": "^0.6.3", "duplexify": "^3.5.0", "extend": "^3.0.0", "gcs-resumable-upload": "^1.0.0", "hash-stream-validation": "^0.2.1", "mime": "^2.2.0", "mime-types": "^2.0.8", - "once": "^1.3.1", + "onetime": "^5.1.0", "pumpify": "^1.5.1", "snakeize": "^0.1.0", "stream-events": "^1.0.1", @@ -201,20 +202,19 @@ }, "dependencies": { "@google-cloud/common": { - "version": "0.31.1", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.31.1.tgz", - "integrity": "sha512-MgaF8VmDaoyIqzZUXIbcohTb5sQn+PYlYmcpb0/E8psUpVe+kaBwLq/Z8pcFtACCr6PNT36n+a6s1kG35bAuCA==", + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.32.0.tgz", + "integrity": "sha512-MkSeoL7p4kApZ2t0GTq4gJxBXW3Qds9d0HQLwd1fFsDUuL0meS7Q/MaSSPEoEXv0JrXo2omV7TvMRzGLth7OUA==", "requires": { - "@google-cloud/projectify": "^0.3.2", + "@google-cloud/projectify": "^0.3.3", "@google-cloud/promisify": "^0.4.0", - "@types/duplexify": "^3.5.0", - "@types/request": "^2.47.0", + "@types/request": "^2.48.1", "arrify": "^1.0.1", "duplexify": "^3.6.0", "ent": "^2.2.0", - "extend": "^3.0.1", - "google-auth-library": "^3.0.0", - "pify": "^4.0.0", + "extend": "^3.0.2", + "google-auth-library": "^3.1.1", + "pify": "^4.0.1", "retry-request": "^4.0.0" } }, @@ -229,11 +229,27 @@ "stream-events": "^1.0.4" } }, + "@google-cloud/projectify": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.3.tgz", + "integrity": "sha512-7522YHQ4IhaafgSunsFF15nG0TGVmxgXidy9cITMe+256RgqfcrfWphiMufW+Ou4kqagW/u3yxwbzVEW3dk2Uw==" + }, "@google-cloud/promisify": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz", "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, + "@types/request": { + "version": "2.48.1", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", + "integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", + "requires": { + "@types/caseless": "*", + "@types/form-data": "*", + "@types/node": "*", + "@types/tough-cookie": "*" + } + }, "concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", @@ -245,10 +261,43 @@ "typedarray": "^0.0.6" } }, + "gcp-metadata": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-1.0.0.tgz", + "integrity": "sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ==", + "requires": { + "gaxios": "^1.0.2", + "json-bigint": "^0.3.0" + } + }, + "google-auth-library": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.2.tgz", + "integrity": "sha512-cDQMzTotwyWMrg5jRO7q0A4TL/3GWBgO7I7q5xGKNiiFf9SmGY/OJ1YsLMgI2MVHHsEGyrqYnbnmV1AE+Z6DnQ==", + "requires": { + "base64-js": "^1.3.0", + "fast-text-encoding": "^1.0.0", + "gaxios": "^1.2.1", + "gcp-metadata": "^1.0.0", + "gtoken": "^2.3.2", + "https-proxy-agent": "^2.2.1", + "jws": "^3.1.5", + "lru-cache": "^5.0.0", + "semver": "^5.5.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.1.tgz", + "integrity": "sha512-VRUfmQO0rCd3hKwBymAn3kxYzBHr3I/wdVMywgG3HhXOwrCQgN84ZagpdTm2tZ4TNtwsSmyJWYO88mb5XvzGqQ==" }, "pify": { "version": "4.0.1", @@ -256,9 +305,9 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" }, "readable-stream": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", - "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -272,6 +321,11 @@ "requires": { "readable-stream": "2 || 3" } + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, @@ -1723,6 +1777,11 @@ "assert-plus": "^1.0.0" } }, + "date-and-time": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.6.3.tgz", + "integrity": "sha512-lcWy3AXDRJOD7MplwZMmNSRM//kZtJaLz4n6D1P5z9wEmZGBKhJRBIr1Xs9KNQJmdXPblvgffynYji4iylUTcA==" + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -3147,9 +3206,9 @@ } }, "gcs-resumable-upload": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-1.0.0.tgz", - "integrity": "sha512-InuVkmj7srAb64w/vSaCU162jk7p4UHmibvfFjT1opO1tiK8Yy88/BeEYn2bCVMv6LH0Sw29L70ejG6oPeq8Ig==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-1.1.0.tgz", + "integrity": "sha512-uBz7uHqp44xjSDzG3kLbOYZDjxxR/UAGbB47A0cC907W6yd2LkcyFDTHg+bjivkHMwiJlKv4guVWcjPCk2zScg==", "requires": { "abort-controller": "^2.0.2", "configstore": "^4.0.0", @@ -3173,14 +3232,24 @@ } }, "gaxios": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.2.tgz", - "integrity": "sha512-Mp6zmABg+0CxJA4b7DEWQ4ZWQzEaWxRNmHAcvCO+HU3dfoFTY925bdpZrTkLWPEtKjS9RBJKrJInzb+VtvAVYA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.3.tgz", + "integrity": "sha512-6Lc1P0NjbPNQ2FGgTRurz32P6FktNJbwLqXvrUNhfwzKb9iizcWuAJiHoSG2W186K9ZL0X6ST5xD9gJWhHI1sg==", "requires": { - "abort-controller": "^2.0.2", + "abort-controller": "^3.0.0", "extend": "^3.0.2", "https-proxy-agent": "^2.2.1", "node-fetch": "^2.3.0" + }, + "dependencies": { + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + } } } } @@ -5751,6 +5820,21 @@ "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=", "dev": true }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "requires": { + "mimic-fn": "^2.1.0" + }, + "dependencies": { + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + } + } + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", diff --git a/package.json b/package.json index c9dc7194..1ddf16f1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.0", - "@google-cloud/storage": "^2.4.3", + "@google-cloud/storage": "^2.5.0", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.5", "cookie-parser": "~1.4.4", From ede5ae3d076875b451c1f6873f134d61ed921ab4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sun, 7 Apr 2019 15:37:56 +0000 Subject: [PATCH 057/243] Bump mocha from 6.0.2 to 6.1.0 Bumps [mocha](https://github.com/mochajs/mocha) from 6.0.2 to 6.1.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.0.2...v6.1.0) Signed-off-by: dependabot[bot] --- package-lock.json | 210 +++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 97 insertions(+), 115 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0dfb7e3..8bb9a682 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1903,12 +1903,6 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", @@ -2063,6 +2057,12 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "enabled": { "version": "1.0.2", "resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", @@ -2240,15 +2240,6 @@ } } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "express": { "version": "4.16.3", "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", @@ -2496,29 +2487,6 @@ "locate-path": "^3.0.0" } }, - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -3329,30 +3297,6 @@ "ini": "^1.3.4" } }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, "google-auth-library": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.0.tgz", @@ -4077,15 +4021,6 @@ "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", @@ -4505,9 +4440,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", + "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -5169,9 +5104,9 @@ } }, "mocha": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", - "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.0.tgz", + "integrity": "sha512-cyKQPahVzaWsCgH86yWjKKxVgAKeN9MsyooMXmJtJa4nLbWxvXXjnPZU0cr9qRVOutirgfOVDzhVqorm8BBYKQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -5179,11 +5114,11 @@ "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "findup-sync": "2.0.0", + "find-up": "3.0.0", "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.12.0", + "js-yaml": "3.13.0", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", @@ -5194,8 +5129,8 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "12.0.5", - "yargs-parser": "11.1.1", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", "yargs-unparser": "1.5.0" }, "dependencies": { @@ -5205,6 +5140,12 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -5214,6 +5155,18 @@ "string-width": "^2.1.1", "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + } } }, "cross-spawn": { @@ -5253,6 +5206,12 @@ "strip-eof": "^1.0.0" } }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -5324,14 +5283,38 @@ "once": "^1.3.1" } }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "strip-ansi": { @@ -5361,24 +5344,39 @@ "isexe": "^2.0.0" } }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", "dev": true, "requires": { "cliui": "^4.0.0", - "decamelize": "^1.2.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + } + }, + "yargs-parser": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -5748,9 +5746,9 @@ } }, "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object-visit": { @@ -5924,12 +5922,6 @@ "semver": "^5.1.0" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -6446,16 +6438,6 @@ "semver": "^5.1.0" } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, "resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", diff --git a/package.json b/package.json index 1ddf16f1..4cb9676d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.0.2", + "mocha": "^6.1.0", "nodemon": "^1.18.10" } } From 36c29fa99a35ea781a0e97d86a6a5acde99eaaac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sun, 7 Apr 2019 22:44:55 +0000 Subject: [PATCH 058/243] Bump mocha from 6.1.0 to 6.1.1 Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.0 to 6.1.1. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.1.0...v6.1.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8bb9a682..84a207f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5104,9 +5104,9 @@ } }, "mocha": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.0.tgz", - "integrity": "sha512-cyKQPahVzaWsCgH86yWjKKxVgAKeN9MsyooMXmJtJa4nLbWxvXXjnPZU0cr9qRVOutirgfOVDzhVqorm8BBYKQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.1.tgz", + "integrity": "sha512-ayfr68s4kyDnCU0hjkTk5Z8J8dqr1iPUuVjmd+dLFgaGKOPlgx1XrOGn5k3H1LlXNnLBb8voZMYMKxchiA4Ujg==", "dev": true, "requires": { "ansi-colors": "3.2.3", diff --git a/package.json b/package.json index 4cb9676d..f2b711d3 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.1.0", + "mocha": "^6.1.1", "nodemon": "^1.18.10" } } From 245186cdbe129826efc4a61f381d9bb5d7990c64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Apr 2019 14:36:32 +0000 Subject: [PATCH 059/243] Bump mongoose from 5.4.22 to 5.4.23 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.22 to 5.4.23. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.22...5.4.23) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84a207f0..90300151 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5416,9 +5416,9 @@ } }, "mongoose": { - "version": "5.4.22", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.22.tgz", - "integrity": "sha512-rbtmFmXe5YJfBrVfOpSW2xeSAKFtnJ5RLQjl4ULzT1icmY/SUHtJ5b+mW4SMCEk7whm/w+2oHO9qMBr8UI1xIw==", + "version": "5.4.23", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.23.tgz", + "integrity": "sha512-23IfTiA9FRJ7yPBFBobpjw5L1OiXzwyAnslB5SI1uN/2nXdd4vqQuP8w0w2ZcrvQ/KP3Mqs02v6n7tc8KzYNMA==", "requires": { "async": "2.6.1", "bson": "~1.1.0", diff --git a/package.json b/package.json index f2b711d3..75495ecf 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.4.22", + "mongoose": "^5.4.23", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 2818023bca9c8b859a7b9b41afd3c3e058671e13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Apr 2019 16:39:25 +0000 Subject: [PATCH 060/243] Bump mongoose from 5.4.23 to 5.5.0 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.4.23 to 5.5.0. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.4.23...5.5.0) Signed-off-by: dependabot[bot] --- package-lock.json | 34 ++++++++++++++++++++-------------- package.json | 2 +- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90300151..b0a24af4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5382,11 +5382,11 @@ } }, "mongodb": { - "version": "3.1.13", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz", - "integrity": "sha512-sz2dhvBZQWf3LRNDhbd30KHVzdjZx9IKC0L+kSZ/gzYquCF5zPOgGqRz6sSCqYZtKP2ekB4nfLxhGtzGHnIKxA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.2.2.tgz", + "integrity": "sha512-xQ6apOOV+w7VFApdaJpWhYhzartpjIDFQjG0AwgJkLh7dBs7PTsq4A3Bia2QWpDohmAzTBIdQVLMqqLy0mwt3Q==", "requires": { - "mongodb-core": "3.1.11", + "mongodb-core": "3.2.2", "safe-buffer": "^5.1.2" }, "dependencies": { @@ -5398,11 +5398,11 @@ } }, "mongodb-core": { - "version": "3.1.11", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.11.tgz", - "integrity": "sha512-rD2US2s5qk/ckbiiGFHeu+yKYDXdJ1G87F6CG3YdaZpzdOm5zpoAZd/EKbPmFO6cQZ+XVXBXBJ660sSI0gc6qg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.2.2.tgz", + "integrity": "sha512-YRgC39MuzKL0uoGoRdTmV1e9m47NbMnYmuEx4IOkgWAGXPSEzRY7cwb3N0XMmrDMnD9vp7MysNyAriIIeGgIQg==", "requires": { - "bson": "^1.1.0", + "bson": "^1.1.1", "require_optional": "^1.0.1", "safe-buffer": "^5.1.2", "saslprep": "^1.0.0" @@ -5416,21 +5416,22 @@ } }, "mongoose": { - "version": "5.4.23", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.23.tgz", - "integrity": "sha512-23IfTiA9FRJ7yPBFBobpjw5L1OiXzwyAnslB5SI1uN/2nXdd4vqQuP8w0w2ZcrvQ/KP3Mqs02v6n7tc8KzYNMA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.5.0.tgz", + "integrity": "sha512-GZdhdbTXTgikInIgtxR7ODcF3+MoJTumTsKYinX3zxJcQgMVr+Y0jBuFoLJ9YtVdF2nq1ukLnhS6RHfta1ptgQ==", "requires": { "async": "2.6.1", - "bson": "~1.1.0", + "bson": "~1.1.1", "kareem": "2.3.0", - "mongodb": "3.1.13", - "mongodb-core": "3.1.11", + "mongodb": "3.2.2", + "mongodb-core": "3.2.2", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.5.1", "mquery": "3.2.0", "ms": "2.1.1", "regexp-clone": "0.0.1", "safe-buffer": "5.1.2", + "sift": "7.0.1", "sliced": "1.0.1" }, "dependencies": { @@ -6621,6 +6622,11 @@ "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", "dev": true }, + "sift": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", + "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", diff --git a/package.json b/package.json index 75495ecf..09ff4f42 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.4.23", + "mongoose": "^5.5.0", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 0340edc512448c43f538cb4a2461990811ca2236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Apr 2019 20:34:10 +0000 Subject: [PATCH 061/243] Bump mocha from 6.1.1 to 6.1.2 Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.1 to 6.1.2. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.1.1...v6.1.2) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0a24af4..7d2a372d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5104,9 +5104,9 @@ } }, "mocha": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.1.tgz", - "integrity": "sha512-ayfr68s4kyDnCU0hjkTk5Z8J8dqr1iPUuVjmd+dLFgaGKOPlgx1XrOGn5k3H1LlXNnLBb8voZMYMKxchiA4Ujg==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.2.tgz", + "integrity": "sha512-BgD2/RozoSC3uQK5R0isDcxjqaWw2n5HWdk8njYUyZf2NC79ErO5FtYVX52+rfqGoEgMfJf4fuG0IWh2TMzFoA==", "dev": true, "requires": { "ansi-colors": "3.2.3", diff --git a/package.json b/package.json index 09ff4f42..680d65ac 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.1.1", + "mocha": "^6.1.2", "nodemon": "^1.18.10" } } From f462b7b697b15381441925604f85a7a85f082028 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 8 Apr 2019 21:08:56 +0000 Subject: [PATCH 062/243] Bump nodemon from 1.18.10 to 1.18.11 Bumps [nodemon](https://github.com/remy/nodemon) from 1.18.10 to 1.18.11. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v1.18.10...v1.18.11) Signed-off-by: dependabot[bot] --- package-lock.json | 46 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d2a372d..42a1aaad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -937,9 +937,9 @@ } }, "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", + "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==", "dev": true }, "asynckit": { @@ -1059,9 +1059,9 @@ "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" }, "binary-extensions": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz", - "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, "bluebird": { @@ -1389,9 +1389,9 @@ "dev": true }, "chokidar": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.0.tgz", - "integrity": "sha512-5t6G2SH8eO6lCvYOoUpaRnF5Qfd//gd7qJAkwRUw9qlGVkiQ13uwQngqbWWaurOsaAm9+kUGbITADxt6H0XFNQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", + "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -1405,7 +1405,7 @@ "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", "readdirp": "^2.2.1", - "upath": "^1.1.0" + "upath": "^1.1.1" } }, "chownr": { @@ -4291,9 +4291,9 @@ } }, "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -5618,12 +5618,12 @@ } }, "nodemon": { - "version": "1.18.10", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.10.tgz", - "integrity": "sha512-we51yBb1TfEvZamFchRgcfLbVYgg0xlGbyXmOtbBzDwxwgewYS/YbZ5tnlnsH51+AoSTTsT3A2E/FloUbtH8cQ==", + "version": "1.18.11", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.11.tgz", + "integrity": "sha512-KdN3tm1zkarlqNo4+W9raU3ihM4H15MVMSE/f9rYDZmFgDHAfAJsomYrHhApAkuUemYjFyEeXlpCOQ2v5gtBEw==", "dev": true, "requires": { - "chokidar": "^2.1.0", + "chokidar": "^2.1.5", "debug": "^3.1.0", "ignore-by-default": "^1.0.1", "minimatch": "^3.0.4", @@ -6355,9 +6355,9 @@ "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" }, "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", "dev": true, "requires": { "rc": "^1.1.6", @@ -7339,9 +7339,9 @@ "dev": true }, "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", "dev": true }, "update-notifier": { diff --git a/package.json b/package.json index 680d65ac..cd81decf 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.1.2", - "nodemon": "^1.18.10" + "nodemon": "^1.18.11" } } From 949f3a8f5dc62b383d7e8b5b775eb575c29e76ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 9 Apr 2019 17:39:01 -0400 Subject: [PATCH 063/243] Bump dotenv from 6.2.0 to 7.0.0 (#408) Bumps [dotenv](https://github.com/motdotla/dotenv) from 6.2.0 to 7.0.0. - [Release notes](https://github.com/motdotla/dotenv/releases) - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v6.2.0...v7.0.0) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42a1aaad..6c4cfa6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2014,9 +2014,9 @@ } }, "dotenv": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", - "integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz", + "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==" }, "duplexer3": { "version": "0.1.4", diff --git a/package.json b/package.json index cd81decf..14d392da 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "cors": "^2.8.5", "cryptiles": "^4.1.3", "debug": "~4.1.1", - "dotenv": "^6.2.0", + "dotenv": "^7.0.0", "express": "~4.16.0", "express-validator": "^5.3.1", "express-winston": "^2.6.0", From d47ab40e9b903120f303709e55f6a57bcb255cb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 10 Apr 2019 16:55:17 +0000 Subject: [PATCH 064/243] Bump @google-cloud/logging-winston from 0.11.0 to 0.11.1 Bumps [@google-cloud/logging-winston](https://github.com/googleapis/nodejs-logging-winston) from 0.11.0 to 0.11.1. - [Release notes](https://github.com/googleapis/nodejs-logging-winston/releases) - [Changelog](https://github.com/googleapis/nodejs-logging-winston/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-logging-winston/compare/v0.11.0...v0.11.1) Signed-off-by: dependabot[bot] --- package-lock.json | 188 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 101 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c4cfa6e..7e908bc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,12 +5,12 @@ "requires": true, "dependencies": { "@google-cloud/common": { - "version": "0.30.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.30.2.tgz", - "integrity": "sha512-JLIaSpMhhUetiwS30iC2SwNP51mayuSbyhRVdagqFC6rDVcqMHHsN8QJwUhCjOoHyfQ04n9SinfMCQzJTR9Liw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.31.1.tgz", + "integrity": "sha512-MgaF8VmDaoyIqzZUXIbcohTb5sQn+PYlYmcpb0/E8psUpVe+kaBwLq/Z8pcFtACCr6PNT36n+a6s1kG35bAuCA==", "requires": { "@google-cloud/projectify": "^0.3.2", - "@google-cloud/promisify": "^0.3.0", + "@google-cloud/promisify": "^0.4.0", "@types/duplexify": "^3.5.0", "@types/request": "^2.47.0", "arrify": "^1.0.1", @@ -30,15 +30,15 @@ } }, "@google-cloud/common-grpc": { - "version": "0.10.0", - "resolved": "http://registry.npmjs.org/@google-cloud/common-grpc/-/common-grpc-0.10.0.tgz", - "integrity": "sha512-Q7IxoKrWPaDoVMuyRKGOT7Q2Q0V0TIhTOlsHUlnvv50ip2W8l3JKC1jeiJpgRWCsh9Pd3ABng/Zn2ECn0btFTw==", + "version": "0.10.1", + "resolved": "http://registry.npmjs.org/@google-cloud/common-grpc/-/common-grpc-0.10.1.tgz", + "integrity": "sha512-oV5mKRqPAqamPcjj8S61UKyB5cz2ugA0/9MPXUfu0CoYaG6AnhnrbPhHDOW6fQ4eci27ER5iakR00htvM9C+Xg==", "requires": { - "@google-cloud/common": "^0.30.0", + "@google-cloud/common": "^0.31.0", "@google-cloud/projectify": "^0.3.0", - "@google-cloud/promisify": "^0.3.0", + "@google-cloud/promisify": "^0.4.0", "@grpc/proto-loader": "^0.4.0", - "duplexify": "^3.6.0", + "duplexify": "^4.0.0", "extend": "^3.0.2", "grpc": "^1.15.1", "is": "^3.2.1", @@ -46,31 +46,51 @@ "through2": "^3.0.0" }, "dependencies": { + "duplexify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.0.0.tgz", + "integrity": "sha512-yY3mlX6uXXe53lt9TnyIIlPZD9WfBEl+OU/8YLiU+p0xxaNRMjLE+rIEURR5/F1H41z9iMHcmVRxRS89tKCUcQ==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "through2": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", - "integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", "requires": { - "readable-stream": "2 || 3", - "xtend": "~4.0.1" + "readable-stream": "2 || 3" } } } }, "@google-cloud/logging": { - "version": "4.4.0", - "resolved": "http://registry.npmjs.org/@google-cloud/logging/-/logging-4.4.0.tgz", - "integrity": "sha512-e2KVDOSexgpsf9ftHiHTGGhlzaIZNpZUI+cHWSsni/2T2Bfx0erd1rlXf2l5T1E9/3V699dDCsg5guDUykq8hA==", + "version": "4.5.1", + "resolved": "http://registry.npmjs.org/@google-cloud/logging/-/logging-4.5.1.tgz", + "integrity": "sha512-x6HUOGg78YL1XeFVUwUoVQPI5CU40hXjzu0crjLZZmMsqr4pX285BafNP5TLh45rSa6JJME7EVFWU2+duW3Qgw==", "requires": { "@google-cloud/common-grpc": "^0.10.0", - "@google-cloud/paginator": "^0.1.0", + "@google-cloud/paginator": "^0.2.0", "@google-cloud/projectify": "^0.3.0", - "@google-cloud/promisify": "^0.3.0", - "@opencensus/propagation-stackdriver": "0.0.8", + "@google-cloud/promisify": "^0.4.0", + "@opencensus/propagation-stackdriver": "0.0.9", "arrify": "^1.0.1", "eventid": "^0.1.2", "extend": "^3.0.2", - "gcp-metadata": "^0.9.0", + "gcp-metadata": "^1.0.0", "google-auth-library": "^3.0.0", "google-gax": "^0.25.0", "is": "^3.2.1", @@ -84,31 +104,40 @@ "through2": "^3.0.0" }, "dependencies": { + "gcp-metadata": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-1.0.0.tgz", + "integrity": "sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ==", + "requires": { + "gaxios": "^1.0.2", + "json-bigint": "^0.3.0" + } + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" }, "through2": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.0.tgz", - "integrity": "sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", "requires": { - "readable-stream": "2 || 3", - "xtend": "~4.0.1" + "readable-stream": "2 || 3" } } } }, "@google-cloud/logging-winston": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@google-cloud/logging-winston/-/logging-winston-0.11.0.tgz", - "integrity": "sha512-Z1G4YJ2pjS3DvMvUradBWfOZxoE6DUnY5Ex9Rbe9qyWSc+KoC87KQrWN2WKrvtsWAY3sXGbn7gLuamRz8gUs/A==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@google-cloud/logging-winston/-/logging-winston-0.11.1.tgz", + "integrity": "sha512-exTIriar6Ixuk65nveMlOoFRyTfgXltW7zc+VBSa7J1cD4X+8SHas/On3YtwvSzaynVHZAZX9ATelT5leitTyQ==", "requires": { "@google-cloud/logging": "^4.4.0", + "google-auth-library": "^3.1.0", "lodash.mapvalues": "^4.6.0", "logform": "^2.0.0", - "semver": "^5.5.1", + "semver": "^6.0.0", "winston-transport": "^4.2.0" }, "dependencies": { @@ -135,43 +164,32 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" } } }, "@google-cloud/paginator": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-0.1.2.tgz", - "integrity": "sha512-XL09cuPSEPyyNifavxWJRYkUFr5zCJ9njcFjqc1AqSQ2QIKycwdTxOP/zHsAWj0xN3rw1ApevA8o+8VAD4R6hw==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-0.2.0.tgz", + "integrity": "sha512-2ZSARojHDhkLvQ+CS32K+iUhBsWg3AEw+uxtqblA7xoCABDyhpj99FPp35xy6A+XlzMhOSrHHaxFE+t6ZTQq0w==", "requires": { "arrify": "^1.0.1", "extend": "^3.0.1", - "is": "^3.2.1", "split-array-stream": "^2.0.0", "stream-events": "^1.0.4" - }, - "dependencies": { - "split-array-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-2.0.0.tgz", - "integrity": "sha512-hmMswlVY91WvGMxs0k8MRgq8zb2mSen4FmDNc5AFiTWtrBpdZN6nwD6kROVe4vNL+ywrvbCKsWVCnEd4riELIg==", - "requires": { - "is-stream-ended": "^0.1.4" - } - } } }, "@google-cloud/projectify": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.2.tgz", - "integrity": "sha512-t1bs5gE105IpgikX7zPCJZzVyXM5xZ/1kJomUPim2E2pNp4OUUFNyvKm/T2aM6GBP2F30o8abCD+/wbOhHWYYA==" + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.3.tgz", + "integrity": "sha512-7522YHQ4IhaafgSunsFF15nG0TGVmxgXidy9cITMe+256RgqfcrfWphiMufW+Ou4kqagW/u3yxwbzVEW3dk2Uw==" }, "@google-cloud/promisify": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.3.1.tgz", - "integrity": "sha512-QzB0/IMvB0eFxFK7Eqh+bfC8NLv3E9ScjWQrPOk6GgfNroxcVITdTlT8NRsRrcp5+QQJVPLkRqKG0PUdaWXmHw==" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz", + "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { "version": "2.5.0", @@ -330,9 +348,9 @@ } }, "@grpc/grpc-js": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.5.tgz", - "integrity": "sha512-LAzNgWYr5FHIkn1XPVTOO5qt6an6sBz0dPSKGOjoBwm6eUgHCVGvyxc72DGXgRHwT8hBfT1VwBmhwGHwfdtjeA==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.6.tgz", + "integrity": "sha512-SmLNuPGlUur64bNS9aHZguqWDVQ8+Df1CGn+xsh7l6T2wiP5ArOMlywZ3TZo6z/rwKtGQgUJY9ZrPYUmHEXd/Q==", "requires": { "semver": "^5.5.0" } @@ -347,9 +365,9 @@ } }, "@opencensus/propagation-stackdriver": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.8.tgz", - "integrity": "sha512-wYI6YwB6qf6gcQARalxoKKXBW3WDuYiYXFF7lq/2PSnUv14NXRAogGv3qKTtDNhrrpVe0eD+RDbWi8onqRfABQ==", + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.9.tgz", + "integrity": "sha512-yOD0MYTVfvdh9mMJB7tSLxIuOvoL9z28kDojm96pE50DI6PGlL4O3icsiwQbOIJ74h8Vs3ESxspuxwXkegsSEw==", "requires": { "hex2dec": "^1.0.1", "uuid": "^3.2.1" @@ -3329,15 +3347,15 @@ } }, "google-gax": { - "version": "0.25.2", - "resolved": "http://registry.npmjs.org/google-gax/-/google-gax-0.25.2.tgz", - "integrity": "sha512-I1hgeywHG8AZ2d9EWqd0iZq2msoDlcGuGwXw4wJccXjMz6H9pw+TzB2aiYREjFPBqMe5dtimrwobD6LM9XrzOQ==", + "version": "0.25.6", + "resolved": "http://registry.npmjs.org/google-gax/-/google-gax-0.25.6.tgz", + "integrity": "sha512-+CVtOSLQt42mwVvJJirhBiAvWsp8zKeb9zW5Wy3wyvb3VG9OugHzZpwvYO9D4yNPPspe7L9CpIs80I5nUJlS8w==", "requires": { "@grpc/grpc-js": "^0.3.0", "@grpc/proto-loader": "^0.4.0", "duplexify": "^3.6.0", "google-auth-library": "^3.0.0", - "google-proto-files": "^0.18.0", + "google-proto-files": "^0.20.0", "grpc": "^1.16.0", "grpc-gcp": "^0.1.1", "is-stream-ended": "^0.1.4", @@ -3345,14 +3363,14 @@ "lodash.has": "^4.5.2", "protobufjs": "^6.8.8", "retry-request": "^4.0.0", - "semver": "^5.5.1", + "semver": "^6.0.0", "walkdir": "^0.3.2" }, "dependencies": { "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" } } }, @@ -3366,19 +3384,13 @@ } }, "google-proto-files": { - "version": "0.18.0", - "resolved": "http://registry.npmjs.org/google-proto-files/-/google-proto-files-0.18.0.tgz", - "integrity": "sha512-blJ5rA3TWEiZIw7Qm0GHNERDdZeezDj46wE4O5uGnOWpZI/STQjeI6rPbqiwjmxzG+b592Hrp2+GKYfbmKR+Lg==", + "version": "0.20.0", + "resolved": "http://registry.npmjs.org/google-proto-files/-/google-proto-files-0.20.0.tgz", + "integrity": "sha512-ORU+XhOeDv/UPtnCYLkO1ItmfhRCRPR3ZoeVQ7GfVzEs7PVitPIhsYlY5ZzG8XXnsdmtK27ENurfQ1jhAWpZHg==", "requires": { + "@google-cloud/promisify": "^0.4.0", "protobufjs": "^6.8.0", - "walkdir": "0.0.12" - }, - "dependencies": { - "walkdir": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.12.tgz", - "integrity": "sha512-HFhaD4mMWPzFSqhpyDG48KDdrjfn409YQuVW7ckZYhW4sE87mYtWifdB/+73RA7+p4s4K18n5Jfx1kHthE1gBw==" - } + "walkdir": "^0.3.0" } }, "got": { @@ -3412,9 +3424,9 @@ "dev": true }, "grpc": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.18.0.tgz", - "integrity": "sha512-M0K67Zhv2ZzCjrTbQvjWgYFPB929L+qAVnbNgXepbfO5kJxUYc30dP8m8vb+o8QdahLHAeYfIqRoIzZRcCB98Q==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.19.0.tgz", + "integrity": "sha512-xX+jZ1M3YXjngsRj/gTxB4EwM0WoWUr54DmyNq9xTeg1oSuVaTPD/PK9wnZKOJWTt1pkeFspXqwJPhddZNxHOA==", "requires": { "lodash.camelcase": "^4.3.0", "lodash.clone": "^4.5.0", @@ -4171,9 +4183,9 @@ "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" }, "is": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", - "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", + "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==" }, "is-accessor-descriptor": { "version": "0.1.6", @@ -6047,9 +6059,9 @@ }, "dependencies": { "@types/node": { - "version": "10.12.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.26.tgz", - "integrity": "sha512-nMRqS+mL1TOnIJrL6LKJcNZPB8V3eTfRo9FQA2b5gDvrHurC8XbSA86KNe0dShlEL7ReWJv/OU9NL7Z0dnqWTg==" + "version": "10.14.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", + "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==" } } }, diff --git a/package.json b/package.json index 14d392da..d1525349 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "docs": "apidoc -i ./routes -o ./docs/api/" }, "dependencies": { - "@google-cloud/logging-winston": "^0.11.0", + "@google-cloud/logging-winston": "^0.11.1", "@google-cloud/storage": "^2.5.0", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.5", From 8c3af1f4a46ef36150bd174bb77534f8f62625af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 11 Apr 2019 16:14:50 +0000 Subject: [PATCH 065/243] Bump mongoose from 5.5.0 to 5.5.1 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.5.0 to 5.5.1. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.5.0...5.5.1) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e908bc3..b1bde7d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5428,9 +5428,9 @@ } }, "mongoose": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.5.0.tgz", - "integrity": "sha512-GZdhdbTXTgikInIgtxR7ODcF3+MoJTumTsKYinX3zxJcQgMVr+Y0jBuFoLJ9YtVdF2nq1ukLnhS6RHfta1ptgQ==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.5.1.tgz", + "integrity": "sha512-sVDyzADl0RbNvoRWLL/zQDqoFGi1IaSo5+DpOwhvGgFs3pSsvmONPNW3JF1KvZerNkkkGFb8ZMuFBeKEiDqZLw==", "requires": { "async": "2.6.1", "bson": "~1.1.1", diff --git a/package.json b/package.json index d1525349..8bca523e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.5.0", + "mongoose": "^5.5.1", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 6ee13537defd3ac1be159f1839febab0962974d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 11 Apr 2019 16:40:59 +0000 Subject: [PATCH 066/243] Bump @types/mongodb from 3.1.22 to 3.1.23 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.22 to 3.1.23. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b1bde7d1..c37b55fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -586,9 +586,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.22", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.22.tgz", - "integrity": "sha512-hvNR0txBlJJAy1eZOeIDshW4dnQaC694COou4eHHaMdIcteCfoCQATD7sYNlXxNxfTc1iIbHUi7A8CAhQe08uA==", + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.23.tgz", + "integrity": "sha512-TNwS1HPh1nnaYorcQoWi+bH5kJ1Q/WqCjiD9XkU3oBeCZFYXXPafVUuFmoYFbzQ061ojhtsndRLzwNklRhU+4w==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 8bca523e..b6e071c2 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.22", + "@types/mongodb": "^3.1.23", "@types/mongoose": "^5.3.23", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From 913d9c4d3abded03fe5a7e63b81b5701a0d470f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 12 Apr 2019 00:07:48 +0000 Subject: [PATCH 067/243] Bump mocha from 6.1.2 to 6.1.3 Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.2 to 6.1.3. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.1.2...v6.1.3) Signed-off-by: dependabot[bot] --- package-lock.json | 25 +++++++++++++++++-------- package.json | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index c37b55fc..aeceef11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5116,9 +5116,9 @@ } }, "mocha": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.2.tgz", - "integrity": "sha512-BgD2/RozoSC3uQK5R0isDcxjqaWw2n5HWdk8njYUyZf2NC79ErO5FtYVX52+rfqGoEgMfJf4fuG0IWh2TMzFoA==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.3.tgz", + "integrity": "sha512-QdE/w//EPHrqgT5PNRUjRVHy6IJAzAf1R8n2O8W8K2RZ+NbPfOD5cBDp+PGa2Gptep37C/TdBiaNwakppEzEbg==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -5135,7 +5135,7 @@ "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1", - "node-environment-flags": "1.0.4", + "node-environment-flags": "1.0.5", "object.assign": "4.1.0", "strip-json-comments": "2.0.1", "supports-color": "6.0.0", @@ -5583,12 +5583,21 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-environment-flags": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", - "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3" + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "node-fetch": { diff --git a/package.json b/package.json index b6e071c2..f5525b5d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.1.2", + "mocha": "^6.1.3", "nodemon": "^1.18.11" } } From 55504837cbdd211d8117b65fea2d848994a66703 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sat, 13 Apr 2019 14:23:39 +0000 Subject: [PATCH 068/243] Bump handlebars from 4.1.1 to 4.1.2 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.1.2/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.1...v4.1.2) Signed-off-by: dependabot[bot] --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index aeceef11..7b04a199 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1574,9 +1574,9 @@ } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "optional": true }, "component-emitter": { @@ -3885,9 +3885,9 @@ } }, "handlebars": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz", - "integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", @@ -7222,12 +7222,12 @@ "dev": true }, "uglify-js": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", - "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.4.tgz", + "integrity": "sha512-GpKo28q/7Bm5BcX9vOu4S46FwisbPbAmkkqPnGIpKvKTM96I85N6XHQV+k4I6FA2wxgLhcsSyHoNhzucwCflvA==", "optional": true, "requires": { - "commander": "~2.19.0", + "commander": "~2.20.0", "source-map": "~0.6.1" }, "dependencies": { diff --git a/package.json b/package.json index f5525b5d..812c2e98 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.16.0", "express-validator": "^5.3.1", "express-winston": "^2.6.0", - "handlebars": "^4.1.1", + "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.5.1", From 6fdddd197839a64b14da5cb3f0d2f11e37a1496b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Sun, 14 Apr 2019 09:30:11 +0000 Subject: [PATCH 069/243] Bump bcrypt from 3.0.5 to 3.0.6 Bumps [bcrypt](https://github.com/kelektiv/node.bcrypt.js) from 3.0.5 to 3.0.6. - [Release notes](https://github.com/kelektiv/node.bcrypt.js/releases) - [Changelog](https://github.com/kelektiv/node.bcrypt.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/kelektiv/node.bcrypt.js/compare/v3.0.5...v3.0.6) Signed-off-by: dependabot[bot] --- package-lock.json | 32 +++++++++++--------------------- package.json | 2 +- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b04a199..3301d1f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1047,18 +1047,18 @@ "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" }, "bcrypt": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.5.tgz", - "integrity": "sha512-m4o91nB+Ce8696Ao4R3B/WtVWTc1Lszgd098/OIjU9D/URmdYwT3ooBs9uv1b97J5YhZweTq9lldPefTYZ0TwA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-3.0.6.tgz", + "integrity": "sha512-taA5bCTfXe7FUjKroKky9EXpdhkVvhE5owfxfLYodbrAR1Ul3juLmIQmIQBK4L9a5BuUcE6cqmwT+Da20lF9tg==", "requires": { - "nan": "2.13.1", + "nan": "2.13.2", "node-pre-gyp": "0.12.0" }, "dependencies": { "nan": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.1.tgz", - "integrity": "sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA==" + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" } } }, @@ -5548,23 +5548,13 @@ } }, "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } } }, "negotiator": { diff --git a/package.json b/package.json index 812c2e98..001946de 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@google-cloud/logging-winston": "^0.11.1", "@google-cloud/storage": "^2.5.0", "@sendgrid/mail": "^6.3.1", - "bcrypt": "^3.0.5", + "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", "cookie-session": "^2.0.0-beta.3", "cors": "^2.8.5", From ec7c05c4a5b63a0255d7d65f69c850fd31887c8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 16 Apr 2019 14:42:13 +0000 Subject: [PATCH 070/243] Bump mongoose from 5.5.1 to 5.5.2 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.5.1 to 5.5.2. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.5.1...5.5.2) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3301d1f0..71668b24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5428,9 +5428,9 @@ } }, "mongoose": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.5.1.tgz", - "integrity": "sha512-sVDyzADl0RbNvoRWLL/zQDqoFGi1IaSo5+DpOwhvGgFs3pSsvmONPNW3JF1KvZerNkkkGFb8ZMuFBeKEiDqZLw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.5.2.tgz", + "integrity": "sha512-GMSPlyy90vVSeNZbV8P4VAeKxgYhF5UgnO7wU5BCn/N6P7mSFp9+XPZyHTqJA8Uh2kO2gfwgm2QVPHrol/V6zA==", "requires": { "async": "2.6.1", "bson": "~1.1.1", diff --git a/package.json b/package.json index 001946de..0afb11ef 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.5.1", + "mongoose": "^5.5.2", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 05d1124e717ebf437c503c44df9db40d205ef7d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 18 Apr 2019 19:29:35 +0000 Subject: [PATCH 071/243] Bump mocha from 6.1.3 to 6.1.4 Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.3 to 6.1.4. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.1.3...v6.1.4) Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71668b24..1cbbcd0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4452,9 +4452,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -5116,9 +5116,9 @@ } }, "mocha": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.3.tgz", - "integrity": "sha512-QdE/w//EPHrqgT5PNRUjRVHy6IJAzAf1R8n2O8W8K2RZ+NbPfOD5cBDp+PGa2Gptep37C/TdBiaNwakppEzEbg==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", + "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -5130,7 +5130,7 @@ "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.0", + "js-yaml": "3.13.1", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", diff --git a/package.json b/package.json index 0afb11ef..e34b5988 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.2.1", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.1.3", + "mocha": "^6.1.4", "nodemon": "^1.18.11" } } From 41514de55ffedb9e8f0ce75a953c4ce29642e161 Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Mon, 6 May 2019 14:29:06 -0400 Subject: [PATCH 072/243] Add section for PRs, Code Review (#457) --- docs/standards.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/standards.md b/docs/standards.md index 6fd90a97..9699d078 100644 --- a/docs/standards.md +++ b/docs/standards.md @@ -6,6 +6,22 @@ Build off of develop. If you are working on a feature, make the branch name `fea We use github issues to track tasks, and projects to organize them. If you are working on a new issue that is not being tracked, please create one and file it into the proper project. +### Creating a PR + +Create the pull-request on the GitHub website. It should pre-populate with a pull request template. Fill out all of the relevant information, such as the issue number, and the checkboxes. Request at least one person to conduct a PR. All tests must pass before you can merge into `develop` or `master`. + +### Code Review + +During a code review, look for the following pieces of information: + +- Are the functions commented? +- Do the variable names make sense, and are in `camelCase`? +- Are the functions in the correct location? +- Does the logic make sense? +- Are there any unnecessary changes that should be removed? + +(Things to look for are not limited to the above). + ## Javascript We follow ES6, and use jshint to tell us when we're not writing good code. We use async / await, which is not supported by jshint (yet). From 0659569a954b353278f63fdb24bedb8f59a0bf35 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 21:55:58 +0000 Subject: [PATCH 073/243] [Security] Bump lodash.merge from 4.6.1 to 4.6.2 Bumps [lodash.merge](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2. **This update includes security fixes.** - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/commits) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1cbbcd0b..742b0422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4813,9 +4813,9 @@ "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=" }, "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lodash.once": { "version": "4.1.1", From c53be7cdb2bbd11c29aae23f5ab350581a8a5005 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 21:57:42 +0000 Subject: [PATCH 074/243] Bump nodemon from 1.18.11 to 1.19.1 Bumps [nodemon](https://github.com/remy/nodemon) from 1.18.11 to 1.19.1. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v1.18.11...v1.19.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 108 ++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 47 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index 742b0422..63086185 100644 --- a/package-lock.json +++ b/package-lock.json @@ -955,9 +955,9 @@ } }, "async-each": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", - "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, "asynckit": { @@ -1407,9 +1407,9 @@ "dev": true }, "chokidar": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", - "integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -2604,14 +2604,14 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { "abbrev": { @@ -2689,12 +2689,12 @@ "optional": true }, "debug": { - "version": "2.6.9", + "version": "4.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-extend": { @@ -2865,24 +2865,31 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", "bundled": true, "dev": true, "optional": true }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, "needle": { - "version": "2.2.4", + "version": "2.3.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.10.3", + "version": "0.12.0", "bundled": true, "dev": true, "optional": true, @@ -2910,13 +2917,13 @@ } }, "npm-bundled": { - "version": "1.0.5", + "version": "1.0.6", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.2.0", + "version": "1.4.1", "bundled": true, "dev": true, "optional": true, @@ -3055,7 +3062,7 @@ "optional": true }, "semver": { - "version": "5.6.0", + "version": "5.7.0", "bundled": true, "dev": true, "optional": true @@ -5087,9 +5094,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -5629,9 +5636,9 @@ } }, "nodemon": { - "version": "1.18.11", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.18.11.tgz", - "integrity": "sha512-KdN3tm1zkarlqNo4+W9raU3ihM4H15MVMSE/f9rYDZmFgDHAfAJsomYrHhApAkuUemYjFyEeXlpCOQ2v5gtBEw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.1.tgz", + "integrity": "sha512-/DXLzd/GhiaDXXbGId5BzxP1GlsqtMGM9zTmkWrgXtSqjKmGSbLicM/oAy4FR0YWm14jCHRwnR31AHS2dYFHrg==", "dev": true, "requires": { "chokidar": "^2.1.5", @@ -5656,9 +5663,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } @@ -6080,9 +6087,9 @@ "dev": true }, "pstree.remy": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.6.tgz", - "integrity": "sha512-NdF35+QsqD7EgNEI5mkI/X+UwaxVEbQaz9f4IooEmMUv6ZPmlTQYGjBPJGgrlzNdjSvIy4MWMg6Q6vCgBO2K+w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.7.tgz", + "integrity": "sha512-xsMgrUwRpuGskEzBFkH8NmTimbZ5PcPup0LA8JJkHIm2IMUbQcpo3yeLNWVrufEYjh8YwtSVh0xz6UeWc5Oh5A==", "dev": true }, "pump": { @@ -6587,9 +6594,9 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -7250,38 +7257,15 @@ } }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unique-string": { diff --git a/package.json b/package.json index e34b5988..b0921a1b 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.1.4", - "nodemon": "^1.18.11" + "nodemon": "^1.19.1" } } From 8505fbf1392e0fa9a172713f2b9dd4163f5f3c04 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 21:59:27 +0000 Subject: [PATCH 075/243] Bump chai-http from 4.2.1 to 4.3.0 Bumps [chai-http](https://github.com/chaijs/chai-http) from 4.2.1 to 4.3.0. - [Release notes](https://github.com/chaijs/chai-http/releases) - [Changelog](https://github.com/chaijs/chai-http/blob/master/History.md) - [Commits](https://github.com/chaijs/chai-http/compare/4.2.1...4.3.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63086185..f03fc9d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -515,9 +515,9 @@ } }, "@types/cookiejar": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.0.tgz", - "integrity": "sha512-EIjmpvnHj+T4nMcKwHwxZKUfDmphIKJc2qnEMhSoOvr1lYEQpuRKRz8orWr//krYIIArS/KGGLfL2YGVUYXmIA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", + "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", "dev": true }, "@types/duplexify": { @@ -647,9 +647,9 @@ } }, "@types/superagent": { - "version": "3.8.6", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-3.8.6.tgz", - "integrity": "sha512-YQjdsk27MLb6uyXjjywGyYeuqavwV3CirHt6btBz00HkKJyowdB8gjjB1zIZxrOybDRqO8FLjTZeEtmtC2hqxA==", + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-3.8.7.tgz", + "integrity": "sha512-9KhCkyXv268A2nZ1Wvu7rQWM+BmdYUVkycFeNnYrUL5Zwu7o8wPQ3wBfW59dDP+wuoxw0ww8YKgTNv8j/cgscA==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -1369,9 +1369,9 @@ } }, "chai-http": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/chai-http/-/chai-http-4.2.1.tgz", - "integrity": "sha512-S2Ezy5uSVuOYleeXppfUKtTU/xbHCZyKkwjheNJ/76SGFTUPDpDkkpVdPNgC3sAO1Ap5J5LJ+/rXdLG8EGhCDA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/chai-http/-/chai-http-4.3.0.tgz", + "integrity": "sha512-zFTxlN7HLMv+7+SPXZdkd5wUlK+KxH6Q7bIEMiEx0FK3zuuMqL7cwICAQ0V1+yYRozBburYuxN1qZstgHpFZQg==", "dev": true, "requires": { "@types/chai": "4", @@ -7005,9 +7005,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } diff --git a/package.json b/package.json index b0921a1b..37cab8e0 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", - "chai-http": "^4.2.1", + "chai-http": "^4.3.0", "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.1.4", From e5c6fd963b9c58897f2a2c2e9e582c7358cf9a35 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 22:01:09 +0000 Subject: [PATCH 076/243] Bump @types/mongodb from 3.1.23 to 3.1.28 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.23 to 3.1.28. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f03fc9d3..3c597f54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -586,9 +586,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.23", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.23.tgz", - "integrity": "sha512-TNwS1HPh1nnaYorcQoWi+bH5kJ1Q/WqCjiD9XkU3oBeCZFYXXPafVUuFmoYFbzQ061ojhtsndRLzwNklRhU+4w==", + "version": "3.1.28", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.28.tgz", + "integrity": "sha512-tG+QqJ/hir2p0069ee28t2O9tlGRJKDq1WFZC2QYMlU47LGdldLL8tepfTq6aFLvP58OpwSoxaJ/qjW93ob1NQ==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 37cab8e0..4b47ae8f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.16.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.23", + "@types/mongodb": "^3.1.28", "@types/mongoose": "^5.3.23", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From fc9e6c90e86de6ba19df6e2f2e77aee7ee137c7f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 22:00:12 +0000 Subject: [PATCH 077/243] Bump @types/express from 4.16.1 to 4.17.0 Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.16.1 to 4.17.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 25 +++++++++---------------- package.json | 2 +- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c597f54..93c89b6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -528,16 +528,10 @@ "@types/node": "*" } }, - "@types/events": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", - "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==", - "dev": true - }, "@types/express": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.1.tgz", - "integrity": "sha512-V0clmJow23WeyblmACoxbHBu2JKlE5TiIme6Lem14FnPW9gsttyHtk6wq7njcdIWH1njAaFgR8gW09lgY98gQg==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.0.tgz", + "integrity": "sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw==", "dev": true, "requires": { "@types/body-parser": "*", @@ -546,12 +540,11 @@ } }, "@types/express-serve-static-core": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz", - "integrity": "sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w==", + "version": "4.16.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.7.tgz", + "integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==", "dev": true, "requires": { - "@types/events": "*", "@types/node": "*", "@types/range-parser": "*" } @@ -580,9 +573,9 @@ "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" }, "@types/mime": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", - "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", + "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==", "dev": true }, "@types/mongodb": { diff --git a/package.json b/package.json index 4b47ae8f..865345a2 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "winston": "^2.4.4" }, "devDependencies": { - "@types/express": "^4.16.1", + "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.28", "@types/mongoose": "^5.3.23", From 2ae27b9a7ee45c13f12a3daf6a55421c46557848 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 22:02:05 +0000 Subject: [PATCH 078/243] Bump qrcode from 1.3.3 to 1.4.0 Bumps [qrcode](https://github.com/soldair/node-qrcode) from 1.3.3 to 1.4.0. - [Release notes](https://github.com/soldair/node-qrcode/releases) - [Changelog](https://github.com/soldair/node-qrcode/blob/master/CHANGELOG.md) - [Commits](https://github.com/soldair/node-qrcode/compare/v1.3.3...v1.4.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 157 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 93 insertions(+), 66 deletions(-) diff --git a/package-lock.json b/package-lock.json index 93c89b6e..1c6bbe83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1328,14 +1328,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" }, - "can-promise": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/can-promise/-/can-promise-0.0.1.tgz", - "integrity": "sha512-gzVrHyyrvgt0YpDm7pn04MQt8gjh0ZAhN4ZDyCRtGl6YnuuK6b4aiUTD7G52r9l4YNmxfTtEscb92vxtAlL6XQ==", - "requires": { - "window-or-global": "^1.0.1" - } - }, "capture-stack-trace": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", @@ -2071,8 +2063,7 @@ "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "enabled": { "version": "1.0.2", @@ -2493,7 +2484,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, "requires": { "locate-path": "^3.0.0" } @@ -3243,7 +3233,8 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true }, "get-func-name": { "version": "2.0.0", @@ -6016,9 +6007,9 @@ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, "pngjs": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.3.3.tgz", - "integrity": "sha512-1n3Z4p3IOxArEs1VRXnZ/RXdfEniAUS9jb68g58FIXMNkPJeZd+Qh4Uq7/e0LVxAQGos1eIUrqrt4FpjdnEd+Q==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", + "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==" }, "posix-character-classes": { "version": "0.1.1", @@ -6115,30 +6106,42 @@ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, "qrcode": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.3.3.tgz", - "integrity": "sha512-SH7V13AcJusH3GT8bMNOGz4w0L+LjcpNOU/NiOgtBhT/5DoWeZE6D5ntMJnJ84AMkoaM4kjJJoHoh9g++8lWFg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.4.0.tgz", + "integrity": "sha512-18u+bdSosXO0+wx6F1UUFzJz01VRfMBcb/wbBw/tKYRD0A2Vho5WQ4xz30pHwhh4IE/qhObqIs5yNO0mGdHKkA==", "requires": { - "can-promise": "0.0.1", "dijkstrajs": "^1.0.1", "isarray": "^2.0.1", "pngjs": "^3.3.0", - "yargs": "^12.0.5" + "yargs": "^13.2.4" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, "cross-spawn": { @@ -6167,13 +6170,10 @@ "strip-eof": "^1.0.0" } }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "requires": { - "locate-path": "^3.0.0" - } + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-stream": { "version": "4.1.0", @@ -6194,9 +6194,9 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "isarray": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", - "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "lcid": { "version": "2.0.0", @@ -6225,40 +6225,69 @@ "once": "^1.3.1" } }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -6439,7 +6468,8 @@ "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true }, "require_optional": { "version": "1.0.1", @@ -7496,11 +7526,6 @@ } } }, - "window-or-global": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/window-or-global/-/window-or-global-1.0.1.tgz", - "integrity": "sha1-2+RboqKRqrxW1iz2bEW3+jIpRt4=" - }, "window-size": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", @@ -7603,6 +7628,7 @@ "version": "11.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -7611,7 +7637,8 @@ "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true } } }, diff --git a/package.json b/package.json index 865345a2..6e2b8fa0 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "passport": "^0.4.0", "passport-local": "^1.0.0", "q": "^1.5.1", - "qrcode": "^1.3.3", + "qrcode": "^1.4.0", "winston": "^2.4.4" }, "devDependencies": { From 5b99ff07e7a93fcee868ea0880d7a1b6df9751e6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 22:20:22 +0000 Subject: [PATCH 079/243] [Security] Bump lodash from 4.17.11 to 4.17.14 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14. **This update includes security fixes.** - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c6bbe83..4bf0eff9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4744,9 +4744,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" }, "lodash.at": { "version": "4.6.0", From 7446f9c850dd7064f300c8e24a1fa42731ddcc23 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 22:43:11 +0000 Subject: [PATCH 080/243] Bump @types/mongoose from 5.3.23 to 5.5.8 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.3.23 to 5.5.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4bf0eff9..1689bf1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -589,9 +589,9 @@ } }, "@types/mongoose": { - "version": "5.3.23", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.3.23.tgz", - "integrity": "sha512-UZJOkFe/ShSt3iYFBiadwwCu2Y8qm/RZyAoCQI2uf88wr3NfDBpbqqoIyrchBy1y2XtvAAyktEPzvvR7up6/TQ==", + "version": "5.5.8", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.8.tgz", + "integrity": "sha512-PtKUS5IC72F/5dwaUaCleYlXuaXXLDUL2wUGSnteq7ifUDQRqNji/vEpK8KQR+uHiRih1l90g4doOAZOc9veUg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 6e2b8fa0..18f90bc5 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.28", - "@types/mongoose": "^5.3.23", + "@types/mongoose": "^5.5.8", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From 125a35f1f5559422a6a492122de585dd0e04eb8c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 23:28:32 +0000 Subject: [PATCH 081/243] Bump express from 4.16.3 to 4.17.1 Bumps [express](https://github.com/expressjs/express) from 4.16.3 to 4.17.1. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.16.3...4.17.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 331 +++++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 223 insertions(+), 110 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1689bf1f..7885eae6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -668,12 +668,27 @@ } }, "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "dependencies": { + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + } } }, "agent-base": { @@ -1081,20 +1096,20 @@ "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" }, "body-parser": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "requires": { - "bytes": "3.0.0", + "bytes": "3.1.0", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.1", - "http-errors": "~1.6.2", - "iconv-lite": "0.4.19", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.5.1", - "raw-body": "2.3.2", - "type-is": "~1.6.15" + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" }, "dependencies": { "debug": { @@ -1104,6 +1119,41 @@ "requires": { "ms": "2.0.0" } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } } } }, @@ -1302,9 +1352,9 @@ } }, "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, "cache-base": { "version": "1.0.1", @@ -1630,9 +1680,19 @@ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } }, "content-type": { "version": "1.0.4", @@ -2243,42 +2303,47 @@ } }, "express": { - "version": "4.16.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", - "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "requires": { - "accepts": "~1.3.5", + "accepts": "~1.3.7", "array-flatten": "1.1.1", - "body-parser": "1.18.2", - "content-disposition": "0.5.2", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", "content-type": "~1.0.4", - "cookie": "0.3.1", + "cookie": "0.4.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.1.1", + "finalhandler": "~1.1.2", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", + "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.3", - "qs": "6.5.1", - "range-parser": "~1.2.0", - "safe-buffer": "5.1.1", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "dependencies": { + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2286,6 +2351,38 @@ "requires": { "ms": "2.0.0" } + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } } } }, @@ -2457,16 +2554,16 @@ } }, "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", "unpipe": "~1.0.0" }, "dependencies": { @@ -4064,14 +4161,15 @@ } }, "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "requires": { "depd": "~1.1.2", "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" } }, "http-signature": { @@ -4169,9 +4267,9 @@ "dev": true }, "ipaddr.js": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", - "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, "is": { "version": "3.3.0", @@ -5015,7 +5113,8 @@ "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "dev": true }, "mime-db": { "version": "1.33.0", @@ -5549,9 +5648,9 @@ } }, "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, "neo-async": { "version": "2.6.0", @@ -5926,9 +6025,9 @@ } }, "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "pascalcase": { "version": "0.1.1", @@ -6056,12 +6155,12 @@ } }, "proxy-addr": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", - "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.6.0" + "ipaddr.js": "1.9.0" } }, "pseudomap": { @@ -6298,41 +6397,28 @@ "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" }, "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raw-body": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, "dependencies": { - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": ">= 1.3.1 < 2" + "safer-buffer": ">= 2.1.2 < 3" } - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" } } }, @@ -6542,6 +6628,11 @@ "ret": "~0.1.10" } }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "saslprep": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.2.tgz", @@ -6571,9 +6662,9 @@ } }, "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "requires": { "debug": "2.6.9", "depd": "~1.1.2", @@ -6582,12 +6673,12 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" + "range-parser": "~1.2.1", + "statuses": "~1.5.0" }, "dependencies": { "debug": { @@ -6596,19 +6687,36 @@ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" + "parseurl": "~1.3.3", + "send": "0.17.1" } }, "set-blocking": { @@ -6640,9 +6748,9 @@ } }, "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, "shebang-command": { "version": "1.2.0", @@ -6932,9 +7040,9 @@ } }, "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, "stream-events": { "version": "1.0.4", @@ -7179,6 +7287,11 @@ "to-no-case": "^1.0.0" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", diff --git a/package.json b/package.json index 18f90bc5..13fc07f9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "cryptiles": "^4.1.3", "debug": "~4.1.1", "dotenv": "^7.0.0", - "express": "~4.16.0", + "express": "~4.17.1", "express-validator": "^5.3.1", "express-winston": "^2.6.0", "handlebars": "^4.1.2", From 99c3bec1cd80157e958479b34b24aab7ae756368 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 05:46:14 +0000 Subject: [PATCH 082/243] Bump express-validator from 5.3.1 to 6.1.1 Bumps [express-validator](https://github.com/express-validator/express-validator) from 5.3.1 to 6.1.1. - [Release notes](https://github.com/express-validator/express-validator/releases) - [Commits](https://github.com/express-validator/express-validator/compare/v5.3.1...v6.1.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7885eae6..20ba955c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2387,12 +2387,12 @@ } }, "express-validator": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-5.3.1.tgz", - "integrity": "sha512-g8xkipBF6VxHbO1+ksC7nxUU7+pWif0+OZXjZTybKJ/V0aTVhuCoHbyhIPgSYVldwQLocGExPtB2pE0DqK4jsw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.1.1.tgz", + "integrity": "sha512-AF6YOhdDiCU7tUOO/OHp2W++I3qpYX7EInMmEEcRGOjs+qoubwgc5s6Wo3OQgxwsWRGCxXlrF73SIDEmY4y3wg==", "requires": { - "lodash": "^4.17.10", - "validator": "^10.4.0" + "lodash": "^4.17.11", + "validator": "^11.0.0" } }, "express-winston": { @@ -7552,9 +7552,9 @@ "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" }, "validator": { - "version": "10.10.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-10.10.0.tgz", - "integrity": "sha512-DyZyLJlMXM3CGdVaVHE/EDzCagMRoPI3mmGdxxNQbqkGqh56+M3d1i0ZAWd69En8U21DHbPTn12aOdhO+hfm5w==" + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-11.1.0.tgz", + "integrity": "sha512-qiQ5ktdO7CD6C/5/mYV4jku/7qnqzjrxb3C/Q5wR3vGGinHTgJZN/TdFT3ZX4vXhX2R1PXx42fB1cn5W+uJ4lg==" }, "vary": { "version": "1.1.2", diff --git a/package.json b/package.json index 13fc07f9..64de38e3 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "debug": "~4.1.1", "dotenv": "^7.0.0", "express": "~4.17.1", - "express-validator": "^5.3.1", + "express-validator": "^6.1.1", "express-winston": "^2.6.0", "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", From 778a6cb35b9dc302c7f5bd711191d85d22adb8d4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 06:13:28 +0000 Subject: [PATCH 083/243] Bump dotenv from 7.0.0 to 8.0.0 Bumps [dotenv](https://github.com/motdotla/dotenv) from 7.0.0 to 8.0.0. - [Release notes](https://github.com/motdotla/dotenv/releases) - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v7.0.0...v8.0.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20ba955c..036db36a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2077,9 +2077,9 @@ } }, "dotenv": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz", - "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==" + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.0.0.tgz", + "integrity": "sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg==" }, "duplexer3": { "version": "0.1.4", diff --git a/package.json b/package.json index 64de38e3..47ff60bb 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "cors": "^2.8.5", "cryptiles": "^4.1.3", "debug": "~4.1.1", - "dotenv": "^7.0.0", + "dotenv": "^8.0.0", "express": "~4.17.1", "express-validator": "^6.1.1", "express-winston": "^2.6.0", From 65a9ef6d6a8f8cd077ac9f69b5ffb14082ea5553 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 00:08:29 -0700 Subject: [PATCH 084/243] Bump @google-cloud/storage from 2.5.0 to 3.0.2 (#471) Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 2.5.0 to 3.0.2. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v2.5.0...v3.0.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 400 ++++++++++++++++++++++++++++++++++------------ package.json | 2 +- 2 files changed, 295 insertions(+), 107 deletions(-) diff --git a/package-lock.json b/package-lock.json index 036db36a..fe3d05b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,82 +192,87 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-2.5.0.tgz", - "integrity": "sha512-q1mwB6RUebIahbA3eriRs8DbG2Ij81Ynb9k8hMqTPkmbd8/S6Z0d6hVvfPmnyvX9Ej13IcmEYIbymuq/RBLghA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.0.2.tgz", + "integrity": "sha512-vIKaTSEpZJkWXUWhAN4wrEisL0JJ6SYjuwWMZKGSit/nRbhAxC8IA82Yrhbm/jI6R9VdBpB+oyHbhQLcMiNJvQ==", "requires": { - "@google-cloud/common": "^0.32.0", - "@google-cloud/paginator": "^0.2.0", - "@google-cloud/promisify": "^0.4.0", - "arrify": "^1.0.0", - "async": "^2.0.1", + "@google-cloud/common": "^2.0.0", + "@google-cloud/paginator": "^1.0.0", + "@google-cloud/promisify": "^1.0.0", + "arrify": "^2.0.0", "compressible": "^2.0.12", "concat-stream": "^2.0.0", - "date-and-time": "^0.6.3", + "date-and-time": "^0.7.0", "duplexify": "^3.5.0", "extend": "^3.0.0", - "gcs-resumable-upload": "^1.0.0", + "gaxios": "^2.0.1", + "gcs-resumable-upload": "^2.0.0", "hash-stream-validation": "^0.2.1", "mime": "^2.2.0", "mime-types": "^2.0.8", "onetime": "^5.1.0", + "p-limit": "^2.2.0", "pumpify": "^1.5.1", "snakeize": "^0.1.0", "stream-events": "^1.0.1", - "teeny-request": "^3.11.3", "through2": "^3.0.0", - "xdg-basedir": "^3.0.0" + "xdg-basedir": "^4.0.0" }, "dependencies": { "@google-cloud/common": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.32.0.tgz", - "integrity": "sha512-MkSeoL7p4kApZ2t0GTq4gJxBXW3Qds9d0HQLwd1fFsDUuL0meS7Q/MaSSPEoEXv0JrXo2omV7TvMRzGLth7OUA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.0.4.tgz", + "integrity": "sha512-Q2QN2KL+6w8Idl2mAI01Q72ZizJdQ+aPJUYQ+COwnUR7njskjdtHHU/Jh14ilNIzOMw+OIdIF4ebwOdsqh23QQ==", "requires": { - "@google-cloud/projectify": "^0.3.3", - "@google-cloud/promisify": "^0.4.0", + "@google-cloud/projectify": "^1.0.0", + "@google-cloud/promisify": "^1.0.0", "@types/request": "^2.48.1", - "arrify": "^1.0.1", + "arrify": "^2.0.0", "duplexify": "^3.6.0", "ent": "^2.2.0", "extend": "^3.0.2", - "google-auth-library": "^3.1.1", - "pify": "^4.0.1", - "retry-request": "^4.0.0" + "google-auth-library": "^4.0.0", + "retry-request": "^4.0.0", + "teeny-request": "^4.0.0" } }, "@google-cloud/paginator": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-0.2.0.tgz", - "integrity": "sha512-2ZSARojHDhkLvQ+CS32K+iUhBsWg3AEw+uxtqblA7xoCABDyhpj99FPp35xy6A+XlzMhOSrHHaxFE+t6ZTQq0w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-1.0.2.tgz", + "integrity": "sha512-mUqsRAJ/OT/Zo/Qh2v+kEeWsEgKZtK4vs2skSiVeudPLwjLSVng+fYZYtLK4kx05OSnm16MqurcPqW14g1/TgQ==", "requires": { - "arrify": "^1.0.1", + "arrify": "^2.0.0", "extend": "^3.0.1", "split-array-stream": "^2.0.0", "stream-events": "^1.0.4" } }, "@google-cloud/projectify": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-0.3.3.tgz", - "integrity": "sha512-7522YHQ4IhaafgSunsFF15nG0TGVmxgXidy9cITMe+256RgqfcrfWphiMufW+Ou4kqagW/u3yxwbzVEW3dk2Uw==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-1.0.1.tgz", + "integrity": "sha512-xknDOmsMgOYHksKc1GPbwDLsdej8aRNIA17SlSZgQdyrcC0lx0OGo4VZgYfwoEU1YS8oUxF9Y+6EzDOb0eB7Xg==" }, "@google-cloud/promisify": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz", - "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.2.tgz", + "integrity": "sha512-7WfV4R/3YV5T30WRZW0lqmvZy9hE2/p9MvpI34WuKa2Wz62mLu5XplGTFEMK6uTbJCLWUxTcZ4J4IyClKucE5g==" }, "@types/request": { - "version": "2.48.1", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", - "integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", + "version": "2.48.2", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.2.tgz", + "integrity": "sha512-gP+PSFXAXMrd5PcD7SqHeUjdGshAI8vKQ3+AvpQr3ht9iQea+59LOKvKITcQI+Lg+1EIkDP6AFSBUJPWG8GDyA==", "requires": { "@types/caseless": "*", - "@types/form-data": "*", "@types/node": "*", - "@types/tough-cookie": "*" + "@types/tough-cookie": "*", + "form-data": "^2.5.0" } }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, "concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", @@ -279,29 +284,68 @@ "typedarray": "^0.0.6" } }, + "form-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.0.tgz", + "integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "gaxios": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.0.1.tgz", + "integrity": "sha512-c1NXovTxkgRJTIgB2FrFmOFg4YIV6N/bAa4f/FZ4jIw13Ql9ya/82x69CswvotJhbV3DiGnlTZwoq2NVXk2Irg==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^2.2.1", + "node-fetch": "^2.3.0" + } + }, "gcp-metadata": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-1.0.0.tgz", - "integrity": "sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.1.tgz", + "integrity": "sha512-nrbLj5O1MurvpLC/doFwzdTfKnmYGDYXlY/v7eQ4tJNVIvQXbOK672J9UFbradbtmuTkyHzjpzD8HD0Djz0LWw==", "requires": { - "gaxios": "^1.0.2", + "gaxios": "^2.0.0", "json-bigint": "^0.3.0" } }, "google-auth-library": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.2.tgz", - "integrity": "sha512-cDQMzTotwyWMrg5jRO7q0A4TL/3GWBgO7I7q5xGKNiiFf9SmGY/OJ1YsLMgI2MVHHsEGyrqYnbnmV1AE+Z6DnQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-4.2.5.tgz", + "integrity": "sha512-Vfsr82M1KTdT0H0wjawwp0LHsT6mPKSolRp21ZpJ7Ydq63zRe8DbGKjRCCrhsRZHg+p17DuuSCMEznwk3CJRdw==", "requires": { + "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", - "gaxios": "^1.2.1", - "gcp-metadata": "^1.0.0", - "gtoken": "^2.3.2", - "https-proxy-agent": "^2.2.1", + "gaxios": "^2.0.0", + "gcp-metadata": "^2.0.0", + "gtoken": "^3.0.0", + "jws": "^3.1.5", + "lru-cache": "^5.0.0" + } + }, + "google-p12-pem": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.1.tgz", + "integrity": "sha512-6h6x+eBX3k+IDSe/c8dVYmn8Mzr1mUcmKC9MdUSwaBkFAXlqBEnwFWmSFgGC+tcqtsLn73BDP/vUNWEehf1Rww==", + "requires": { + "node-forge": "^0.8.0" + } + }, + "gtoken": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-3.0.2.tgz", + "integrity": "sha512-BOBi6Zz31JfxhSHRZBIDdbwIbOPyux10WxJHdx8wz/FMP1zyN1xFrsAWsgcLe5ww5v/OZu/MePUEZAjgJXSauA==", + "requires": { + "gaxios": "^2.0.0", + "google-p12-pem": "^2.0.0", "jws": "^3.1.5", - "lru-cache": "^5.0.0", - "semver": "^5.5.0" + "mime": "^2.2.0" } }, "lru-cache": { @@ -313,19 +357,27 @@ } }, "mime": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.1.tgz", - "integrity": "sha512-VRUfmQO0rCd3hKwBymAn3kxYzBHr3I/wdVMywgG3HhXOwrCQgN84ZagpdTm2tZ4TNtwsSmyJWYO88mb5XvzGqQ==" + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + "node-forge": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.5.tgz", + "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "requires": { + "p-try": "^2.0.0" + } }, "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -340,6 +392,11 @@ "readable-stream": "2 || 3" } }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" + }, "yallist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", @@ -660,9 +717,9 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "abort-controller": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-2.0.3.tgz", - "integrity": "sha512-EPSq5wr2aFyAZ1PejJB32IX9Qd4Nwus+adnp7STYFM5/23nLPBazqZ1oor6ZqbH+4otaaGXTlC8RN5hq3C8w9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "requires": { "event-target-shim": "^5.0.0" } @@ -1621,17 +1678,17 @@ "dev": true }, "compressible": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.16.tgz", - "integrity": "sha512-JQfEOdnI7dASwCuSPWIeVYwc/zMsu/+tRhoUvEfXz2gxOA2DNjmG5vhtFdBlhWPPGo+RdT9S3tgc/uH5qgDiiA==", + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", + "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", "requires": { - "mime-db": ">= 1.38.0 < 2" + "mime-db": ">= 1.40.0 < 2" }, "dependencies": { "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" } } }, @@ -1820,7 +1877,8 @@ "crypto-random-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", + "dev": true }, "cycle": { "version": "1.0.3", @@ -1841,9 +1899,9 @@ } }, "date-and-time": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.6.3.tgz", - "integrity": "sha512-lcWy3AXDRJOD7MplwZMmNSRM//kZtJaLz4n6D1P5z9wEmZGBKhJRBIr1Xs9KNQJmdXPblvgffynYji4iylUTcA==" + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.7.0.tgz", + "integrity": "sha512-qPHBPG0AQqbjP7wVf7vLv25/0bZRjYPiJiJtE0t6RqTswJR/6ExCXQLDnL5w4986j7i6470TMtalJxC8/UHrww==" }, "date-now": { "version": "0.1.4", @@ -2072,6 +2130,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, "requires": { "is-obj": "^1.0.0" } @@ -3279,51 +3338,167 @@ } }, "gcs-resumable-upload": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-1.1.0.tgz", - "integrity": "sha512-uBz7uHqp44xjSDzG3kLbOYZDjxxR/UAGbB47A0cC907W6yd2LkcyFDTHg+bjivkHMwiJlKv4guVWcjPCk2zScg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.0.tgz", + "integrity": "sha512-yI7TL4XM2P4pm27FsrhSnEWoF3twP16f81jNTkFbajmg4mRnNq4dKSuZPcyWSV7aT5DsUJIGq0m1iKdIYGIskg==", "requires": { - "abort-controller": "^2.0.2", - "configstore": "^4.0.0", - "gaxios": "^1.5.0", - "google-auth-library": "^3.0.0", + "abort-controller": "^3.0.0", + "configstore": "^5.0.0", + "gaxios": "^2.0.0", + "google-auth-library": "^4.0.0", "pumpify": "^1.5.1", "stream-events": "^1.0.4" }, "dependencies": { + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, "configstore": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", - "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.0.tgz", + "integrity": "sha512-eE/hvMs7qw7DlcB5JPRnthmrITuHMmACUJAp89v6PT6iOqzoLS7HRWhBtuHMlhNHo2AhUSA/3Dh1bKNJHcublQ==", "requires": { - "dot-prop": "^4.1.0", + "dot-prop": "^5.1.0", "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" + }, + "dot-prop": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.1.0.tgz", + "integrity": "sha512-n1oC6NBF+KM9oVXtjmen4Yo7HyAVWV2UUl50dCYJdw2924K6dX9bf9TTTWaKtYlRn0FEtxG27KS80ayVLixxJA==", + "requires": { + "is-obj": "^2.0.0" } }, "gaxios": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.3.tgz", - "integrity": "sha512-6Lc1P0NjbPNQ2FGgTRurz32P6FktNJbwLqXvrUNhfwzKb9iizcWuAJiHoSG2W186K9ZL0X6ST5xD9gJWhHI1sg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.0.1.tgz", + "integrity": "sha512-c1NXovTxkgRJTIgB2FrFmOFg4YIV6N/bAa4f/FZ4jIw13Ql9ya/82x69CswvotJhbV3DiGnlTZwoq2NVXk2Irg==", "requires": { "abort-controller": "^3.0.0", "extend": "^3.0.2", "https-proxy-agent": "^2.2.1", "node-fetch": "^2.3.0" - }, - "dependencies": { - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } - } } + }, + "gcp-metadata": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.1.tgz", + "integrity": "sha512-nrbLj5O1MurvpLC/doFwzdTfKnmYGDYXlY/v7eQ4tJNVIvQXbOK672J9UFbradbtmuTkyHzjpzD8HD0Djz0LWw==", + "requires": { + "gaxios": "^2.0.0", + "json-bigint": "^0.3.0" + } + }, + "google-auth-library": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-4.2.5.tgz", + "integrity": "sha512-Vfsr82M1KTdT0H0wjawwp0LHsT6mPKSolRp21ZpJ7Ydq63zRe8DbGKjRCCrhsRZHg+p17DuuSCMEznwk3CJRdw==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "fast-text-encoding": "^1.0.0", + "gaxios": "^2.0.0", + "gcp-metadata": "^2.0.0", + "gtoken": "^3.0.0", + "jws": "^3.1.5", + "lru-cache": "^5.0.0" + } + }, + "google-p12-pem": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.1.tgz", + "integrity": "sha512-6h6x+eBX3k+IDSe/c8dVYmn8Mzr1mUcmKC9MdUSwaBkFAXlqBEnwFWmSFgGC+tcqtsLn73BDP/vUNWEehf1Rww==", + "requires": { + "node-forge": "^0.8.0" + } + }, + "gtoken": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-3.0.2.tgz", + "integrity": "sha512-BOBi6Zz31JfxhSHRZBIDdbwIbOPyux10WxJHdx8wz/FMP1zyN1xFrsAWsgcLe5ww5v/OZu/MePUEZAjgJXSauA==", + "requires": { + "gaxios": "^2.0.0", + "google-p12-pem": "^2.0.0", + "jws": "^3.1.5", + "mime": "^2.2.0" + } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "requires": { + "semver": "^6.0.0" + } + }, + "mime": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" + }, + "node-forge": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.5.tgz", + "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" + }, + "semver": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==" + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "write-file-atomic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.0.tgz", + "integrity": "sha512-EIgkf60l2oWsffja2Sf2AL384dx328c0B+cIYPTQq5q2rOYuDV00/iPFBOUiDKKwKMOhkymH8AidPaRvzfxY+Q==", + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, @@ -4448,7 +4623,8 @@ "is-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true }, "is-path-inside": { "version": "1.0.1", @@ -4994,6 +5170,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "dev": true, "requires": { "pify": "^3.0.0" } @@ -7178,9 +7355,9 @@ } }, "teeny-request": { - "version": "3.11.3", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", - "integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-4.0.0.tgz", + "integrity": "sha512-Kk87eePsBQZsn5rOIwupObYV7doBMedW3fUOmu3LFVRGEJQ7oeClwWkGFS3nkFs9TFL36qf08vGJd34swMorHQ==", "requires": { "https-proxy-agent": "^2.2.1", "node-fetch": "^2.2.0", @@ -7348,6 +7525,14 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "requires": { + "is-typedarray": "^1.0.0" + } + }, "uc.micro": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz", @@ -7408,6 +7593,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "dev": true, "requires": { "crypto-random-string": "^1.0.0" } @@ -7696,6 +7882,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, "requires": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", @@ -7705,7 +7892,8 @@ "xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "dev": true }, "xtend": { "version": "4.0.1", diff --git a/package.json b/package.json index 47ff60bb..fdf307e9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^2.5.0", + "@google-cloud/storage": "^3.0.2", "@sendgrid/mail": "^6.3.1", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From cdc80ea501163df04e4d46893979322b8cfcad27 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 07:10:15 +0000 Subject: [PATCH 085/243] Bump @sendgrid/mail from 6.3.1 to 6.4.0 Bumps [@sendgrid/mail](https://github.com/sendgrid/sendgrid-nodejs) from 6.3.1 to 6.4.0. - [Release notes](https://github.com/sendgrid/sendgrid-nodejs/releases) - [Changelog](https://github.com/sendgrid/sendgrid-nodejs/blob/master/CHANGELOG.md) - [Commits](https://github.com/sendgrid/sendgrid-nodejs/compare/v6.3.1...v6.4.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 279 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 135 insertions(+), 146 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe3d05b7..3f839482 100644 --- a/package-lock.json +++ b/package-lock.json @@ -485,19 +485,19 @@ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, "@sendgrid/client": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@sendgrid/client/-/client-6.3.0.tgz", - "integrity": "sha512-fTy8vRpA9Whtf8ULQr/0vkSZaQvGQ97rY5N5PrevKRtugJMsJqFMKO0pwzEWeqITSg71aMMTj57QTgw3SjZvnQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@sendgrid/client/-/client-6.4.0.tgz", + "integrity": "sha512-GcO+hKXMQiwN0xMGfPITArlj4Nab1vZsrsRLmsJlcXGZV1V1zQC6XuAWJv6MGDd0hr/jKaXmCJ1XMYkxIRQHFw==", "requires": { - "@sendgrid/helpers": "^6.3.0", + "@sendgrid/helpers": "^6.4.0", "@types/request": "^2.0.3", - "request": "^2.81.0" + "request": "^2.88.0" } }, "@sendgrid/helpers": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@sendgrid/helpers/-/helpers-6.3.0.tgz", - "integrity": "sha512-uTFcmhCDFg/2Uhz+z/cLwyLHH0UsblG49hKwdR7nKbWsGKWv4js7W32FlPdXqy2C/plTJ20vcPLgKM1m3F/MjQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@sendgrid/helpers/-/helpers-6.4.0.tgz", + "integrity": "sha512-1dDDXauArHyxwTKFFfWvQpsijmwalyLgwoQJ3FRCssFq1RfqYDgFhRg0Xs3v/IXS2jkKWePSWiPORSR4Sysdpw==", "requires": { "chalk": "^2.0.1", "deepmerge": "^2.1.1" @@ -512,9 +512,9 @@ } }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -524,12 +524,12 @@ } }, "@sendgrid/mail": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@sendgrid/mail/-/mail-6.3.1.tgz", - "integrity": "sha512-5zIeAV9iU+0hQkrOQ/D4RB2MfpK+lNbOortIfQdCh95aMDF/TRc9WB8FGNhmQrx9YMuJTms5eiBklF0Fi/dbVg==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@sendgrid/mail/-/mail-6.4.0.tgz", + "integrity": "sha512-pVzbqbxhZ4FUN6iSIksRLtyXRPurrcee1i0noPDStDCLlHVwUR+TofeeKIFWGpIvbbk5UR6S6iV/U5ie8Kdblw==", "requires": { - "@sendgrid/client": "^6.3.0", - "@sendgrid/helpers": "^6.3.0" + "@sendgrid/client": "^6.4.0", + "@sendgrid/helpers": "^6.4.0" } }, "@types/body-parser": { @@ -757,14 +757,14 @@ } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ansi-align": { @@ -990,9 +990,12 @@ } }, "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } }, "assert-plus": { "version": "1.0.0", @@ -1042,9 +1045,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, "balanced-match": { "version": "1.0.0", @@ -1128,10 +1131,9 @@ } }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "optional": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { "tweetnacl": "^0.14.3" } @@ -1214,14 +1216,6 @@ } } }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.x.x" - } - }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", @@ -1578,11 +1572,6 @@ "wrap-ansi": "^2.0.0" } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -1950,9 +1939,9 @@ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, "deepmerge": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.1.1.tgz", - "integrity": "sha512-urQxA1smbLZ2cBbXbaYObM1dJ82aJ2H57A1C/Kklfh/ZN1bgH4G/n5KWhdNfOK11W98gqZfyYj7W4frJJRwA2w==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", + "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==" }, "define-properties": { "version": "1.1.3", @@ -2158,12 +2147,12 @@ } }, "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "jsbn": "~0.1.0" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ecdsa-sig-formatter": { @@ -2565,9 +2554,9 @@ "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, "fast-json-stable-stringify": { "version": "2.0.0", @@ -4171,11 +4160,11 @@ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "requires": { - "ajv": "^5.1.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, @@ -4249,37 +4238,6 @@ "through2": "^2.0.0" } }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.x.x", - "cryptiles": "3.x.x", - "hoek": "4.x.x", - "sntp": "2.x.x" - }, - "dependencies": { - "cryptiles": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.4.tgz", - "integrity": "sha512-8I1sgZHfVwcSOY6mSGpVU3lw/GSIZvusg8dD2+OGehCJpOhQRLNcH0qb9upQnOH4XhgxxFJSg6E2kx95deb1Tw==", - "requires": { - "boom": "5.x.x" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.x.x" - } - } - } - } - } - }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -4291,11 +4249,6 @@ "resolved": "https://registry.npmjs.org/hex2dec/-/hex2dec-1.1.2.tgz", "integrity": "sha512-Yu+q/XWr2fFQ11tHxPq4p4EiNkb2y+lAacJNhAdRXVfRIcDH6gi7htWFnnlIzvqHMHoWeIsfXlNAjZInpAOJDA==" }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" - }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", @@ -4729,8 +4682,7 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "jshint": { "version": "2.10.2", @@ -4835,9 +4787,9 @@ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stringify-safe": { "version": "5.0.1", @@ -5984,9 +5936,9 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, "object-assign": { "version": "4.1.1", @@ -6346,6 +6298,11 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "psl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz", + "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==" + }, "pstree.remy": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.7.tgz", @@ -6372,9 +6329,9 @@ } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "q": { "version": "1.5.1", @@ -6571,7 +6528,8 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true }, "range-parser": { "version": "1.2.1", @@ -6695,32 +6653,60 @@ "dev": true }, "request": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "requires": { "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", + "aws4": "^1.8.0", "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "hawk": "~6.0.2", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "stringstream": "~0.0.5", - "tough-cookie": "~2.3.3", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" + "uuid": "^3.3.2" + }, + "dependencies": { + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + } } }, "require-directory": { @@ -7110,14 +7096,6 @@ } } }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "requires": { - "hoek": "4.x.x" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -7176,9 +7154,9 @@ "dev": true }, "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -7187,6 +7165,7 @@ "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" } }, @@ -7257,11 +7236,6 @@ "safe-buffer": "~5.1.0" } }, - "stringstream": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", - "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==" - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -7479,11 +7453,19 @@ } }, "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "requires": { + "psl": "^1.1.24", "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } } }, "triple-beam": { @@ -7502,8 +7484,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type-detect": { "version": "4.0.8", @@ -7701,6 +7682,14 @@ } } }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", diff --git a/package.json b/package.json index fdf307e9..9b35960c 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": { "@google-cloud/logging-winston": "^0.11.1", "@google-cloud/storage": "^3.0.2", - "@sendgrid/mail": "^6.3.1", + "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", "cookie-session": "^2.0.0-beta.3", From 8199312831d67f03403893f28a449c89bc609a57 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 07:43:14 +0000 Subject: [PATCH 086/243] Bump mongoose from 5.5.2 to 5.6.4 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.5.2 to 5.6.4. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.5.2...5.6.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 87 ++++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f839482..66d3fbd7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1018,6 +1018,7 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, "requires": { "lodash": "^4.17.10" } @@ -5613,25 +5614,25 @@ } }, "mongodb": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.2.2.tgz", - "integrity": "sha512-xQ6apOOV+w7VFApdaJpWhYhzartpjIDFQjG0AwgJkLh7dBs7PTsq4A3Bia2QWpDohmAzTBIdQVLMqqLy0mwt3Q==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.2.7.tgz", + "integrity": "sha512-2YdWrdf1PJgxcCrT1tWoL6nHuk6hCxhddAAaEh8QJL231ci4+P9FLyqopbTm2Z2sAU6mhCri+wd9r1hOcHdoMw==", "requires": { - "mongodb-core": "3.2.2", + "mongodb-core": "3.2.7", "safe-buffer": "^5.1.2" }, "dependencies": { "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, "mongodb-core": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.2.2.tgz", - "integrity": "sha512-YRgC39MuzKL0uoGoRdTmV1e9m47NbMnYmuEx4IOkgWAGXPSEzRY7cwb3N0XMmrDMnD9vp7MysNyAriIIeGgIQg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.2.7.tgz", + "integrity": "sha512-WypKdLxFNPOH/Jy6i9z47IjG2wIldA54iDZBmHMINcgKOUcWJh8og+Wix76oGd7EyYkHJKssQ2FAOw5Su/n4XQ==", "requires": { "bson": "^1.1.1", "require_optional": "^1.0.1", @@ -5640,36 +5641,44 @@ }, "dependencies": { "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, "mongoose": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.5.2.tgz", - "integrity": "sha512-GMSPlyy90vVSeNZbV8P4VAeKxgYhF5UgnO7wU5BCn/N6P7mSFp9+XPZyHTqJA8Uh2kO2gfwgm2QVPHrol/V6zA==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.4.tgz", + "integrity": "sha512-mwMpa82uGvxSmkwTbxCmXb8/Nn9+2e+X61DiGFV9ZeenTsJKcdjc0QMGwDyDEkLcnYwQ5VrQbiB9548RZbFgVw==", "requires": { - "async": "2.6.1", + "async": "2.6.2", "bson": "~1.1.1", "kareem": "2.3.0", - "mongodb": "3.2.2", - "mongodb-core": "3.2.2", + "mongodb": "3.2.7", + "mongodb-core": "3.2.7", "mongoose-legacy-pluralize": "1.0.2", - "mpath": "0.5.1", - "mquery": "3.2.0", - "ms": "2.1.1", - "regexp-clone": "0.0.1", + "mpath": "0.6.0", + "mquery": "3.2.1", + "ms": "2.1.2", + "regexp-clone": "1.0.0", "safe-buffer": "5.1.2", "sift": "7.0.1", "sliced": "1.0.1" }, "dependencies": { + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "requires": { + "lodash": "^4.17.11" + } + }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "safe-buffer": { "version": "5.1.2", @@ -5684,18 +5693,18 @@ "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" }, "mpath": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.5.1.tgz", - "integrity": "sha512-H8OVQ+QEz82sch4wbODFOz+3YQ61FYz/z3eJ5pIdbMEaUzDqA268Wd+Vt4Paw9TJfvDgVKaayC0gBzMIw2jhsg==" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.6.0.tgz", + "integrity": "sha512-i75qh79MJ5Xo/sbhxrDrPSEG0H/mr1kcZXJ8dH6URU5jD/knFxCVqVC/gVSW7GIXL/9hHWlT9haLbCXWOll3qw==" }, "mquery": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.0.tgz", - "integrity": "sha512-qPJcdK/yqcbQiKoemAt62Y0BAc0fTEKo1IThodBD+O5meQRJT/2HSe5QpBNwaa4CjskoGrYWsEyjkqgiE0qjhg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.1.tgz", + "integrity": "sha512-kY/K8QToZWTTocm0U+r8rqcJCp5PRl6e8tPmoDs5OeSO3DInZE2rAL6AYH+V406JTo8305LdASOQcxRDqHojyw==", "requires": { "bluebird": "3.5.1", "debug": "3.1.0", - "regexp-clone": "0.0.1", + "regexp-clone": "^1.0.0", "safe-buffer": "5.1.2", "sliced": "1.0.1" }, @@ -6611,9 +6620,9 @@ } }, "regexp-clone": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", - "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", + "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" }, "registry-auth-token": { "version": "3.4.0", @@ -6797,9 +6806,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "saslprep": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.2.tgz", - "integrity": "sha512-4cDsYuAjXssUSjxHKRe4DTZC0agDwsCqcMqtJAQPzC74nJ7LfAJflAtC1Zed5hMzEQKj82d3tuzqdGNRsLJ4Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", + "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", "optional": true, "requires": { "sparse-bitfield": "^3.0.3" diff --git a/package.json b/package.json index 9b35960c..0c351c4a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.5.2", + "mongoose": "^5.6.4", "multer": "^1.3.1", "passport": "^0.4.0", "passport-local": "^1.0.0", From 95e9d9b066c1258687cf0abdf6f0a37286310223 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 10:29:09 +0000 Subject: [PATCH 087/243] Bump multer from 1.3.1 to 1.4.2 Bumps [multer](https://github.com/expressjs/multer) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/expressjs/multer/releases) - [Changelog](https://github.com/expressjs/multer/blob/master/CHANGELOG.md) - [Commits](https://github.com/expressjs/multer/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 46 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66d3fbd7..21dea6c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -919,9 +919,9 @@ } }, "append-field": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-0.1.0.tgz", - "integrity": "sha1-bdxY+gg8e8VF08WZWygwzCNm1Eo=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" }, "aproba": { "version": "1.2.0", @@ -5730,25 +5730,18 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multer": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.3.1.tgz", - "integrity": "sha512-JHdEoxkA/5NgZRo91RNn4UT+HdcJV9XUo01DTkKC7vo1erNIngtuaw9Y0WI8RdTlyi+wMIbunflhghzVLuGJyw==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.2.tgz", + "integrity": "sha512-xY8pX7V+ybyUpbYMxtjM9KAiD9ixtg5/JkeKUTD6xilfDv0vzzOFcCp4Ljb1UU3tSOM3VTZtKo63OmzOrGi3Cg==", "requires": { - "append-field": "^0.1.0", + "append-field": "^1.0.0", "busboy": "^0.2.11", "concat-stream": "^1.5.2", "mkdirp": "^0.5.1", - "object-assign": "^3.0.0", + "object-assign": "^4.1.1", "on-finished": "^2.3.0", "type-is": "^1.6.4", "xtend": "^4.0.0" - }, - "dependencies": { - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" - } } }, "nan": { @@ -7502,12 +7495,27 @@ "dev": true }, "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "requires": { "media-typer": "0.3.0", - "mime-types": "~2.1.18" + "mime-types": "~2.1.24" + }, + "dependencies": { + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + } } }, "typedarray": { diff --git a/package.json b/package.json index 0c351c4a..2c20d9cc 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.6.4", - "multer": "^1.3.1", + "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", "q": "^1.5.1", From 3c1dacd0651741401518aa372dd7cee3f36173d4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2019 10:30:52 +0000 Subject: [PATCH 088/243] Bump @google-cloud/storage from 3.0.2 to 3.0.3 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.0.2...v3.0.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21dea6c8..739a24e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.0.2.tgz", - "integrity": "sha512-vIKaTSEpZJkWXUWhAN4wrEisL0JJ6SYjuwWMZKGSit/nRbhAxC8IA82Yrhbm/jI6R9VdBpB+oyHbhQLcMiNJvQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.0.3.tgz", + "integrity": "sha512-62N6qRCnY9zi5bK1O+IX/wQEU8NL2D4Tuo3DrrgY5Fk5n8lHlTLJLHZi730k/v2Vr1p1+fG0trfB8eNIUjkW/A==", "requires": { "@google-cloud/common": "^2.0.0", "@google-cloud/paginator": "^1.0.0", diff --git a/package.json b/package.json index 2c20d9cc..82295bb7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.0.2", + "@google-cloud/storage": "^3.0.3", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 3d9e1c428c4bbbcb173b35f5e534d1a0d8daad3d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2019 15:39:08 +0000 Subject: [PATCH 089/243] Bump mocha from 6.1.4 to 6.2.0 Bumps [mocha](https://github.com/mochajs/mocha) from 6.1.4 to 6.2.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.1.4...v6.2.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 86 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 739a24e3..1a4fdb74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3493,9 +3493,9 @@ } }, "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-func-name": { @@ -5336,9 +5336,9 @@ } }, "mocha": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", - "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -5372,12 +5372,6 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -5438,12 +5432,6 @@ "strip-eof": "^1.0.0" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -5515,12 +5503,6 @@ "once": "^1.3.1" } }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -5600,16 +5582,6 @@ "y18n": "^4.0.0", "yargs-parser": "^13.0.0" } - }, - "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, @@ -6717,9 +6689,9 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "require_optional": { @@ -7932,9 +7904,9 @@ } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -7942,9 +7914,9 @@ }, "dependencies": { "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true } } @@ -7966,6 +7938,12 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -8005,6 +7983,12 @@ "strip-eof": "^1.0.0" } }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -8056,6 +8040,12 @@ "once": "^1.3.1" } }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -8094,6 +8084,16 @@ "y18n": "^3.2.1 || ^4.0.0", "yargs-parser": "^11.1.1" } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } } diff --git a/package.json b/package.json index 82295bb7..30d6ddd6 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.3.0", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.1.4", + "mocha": "^6.2.0", "nodemon": "^1.19.1" } } From 93cba8cd98a0edcf8bf3a054007d49b74251e82d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2019 15:40:23 +0000 Subject: [PATCH 090/243] Bump mongoose from 5.6.4 to 5.6.5 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.4 to 5.6.5. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.4...5.6.5) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a4fdb74..681826de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5620,9 +5620,9 @@ } }, "mongoose": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.4.tgz", - "integrity": "sha512-mwMpa82uGvxSmkwTbxCmXb8/Nn9+2e+X61DiGFV9ZeenTsJKcdjc0QMGwDyDEkLcnYwQ5VrQbiB9548RZbFgVw==", + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.5.tgz", + "integrity": "sha512-c8bIo8mxbf1ybwo9jgPKcJRICQBlIMKwDWt2A+M7h0AutroQ5EqzRAYOK1vrHwwwq00EcJyVwjVBW2wv8E9Wfw==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 30d6ddd6..89effabc 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.4", + "mongoose": "^5.6.5", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 742ea7766cefd2fd35238e52182ce769ffb9685c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2019 15:39:49 +0000 Subject: [PATCH 091/243] Bump qrcode from 1.4.0 to 1.4.1 Bumps [qrcode](https://github.com/soldair/node-qrcode) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/soldair/node-qrcode/releases) - [Changelog](https://github.com/soldair/node-qrcode/blob/master/CHANGELOG.md) - [Commits](https://github.com/soldair/node-qrcode/compare/v1.4.0...v1.4.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 116 +++++++++++++--------------------------------- package.json | 2 +- 2 files changed, 33 insertions(+), 85 deletions(-) diff --git a/package-lock.json b/package-lock.json index 681826de..8e6529d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4622,7 +4622,8 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true }, "is-stream-ended": { "version": "0.1.4", @@ -4657,7 +4658,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", @@ -5132,6 +5134,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, "requires": { "p-defer": "^1.0.0" } @@ -5192,6 +5195,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "dev": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", @@ -5262,7 +5266,8 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true }, "minimatch": { "version": "3.0.4", @@ -5763,7 +5768,8 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true }, "node-environment-flags": { "version": "1.0.5", @@ -5889,6 +5895,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, "requires": { "path-key": "^2.0.0" } @@ -6082,17 +6089,20 @@ "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true }, "p-is-promise": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", + "dev": true }, "p-limit": { "version": "2.1.0", @@ -6180,7 +6190,8 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "path-to-regexp": { "version": "0.1.7", @@ -6313,9 +6324,9 @@ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, "qrcode": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.4.0.tgz", - "integrity": "sha512-18u+bdSosXO0+wx6F1UUFzJz01VRfMBcb/wbBw/tKYRD0A2Vho5WQ4xz30pHwhh4IE/qhObqIs5yNO0mGdHKkA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.4.1.tgz", + "integrity": "sha512-3JhHQJkKqJL4PfoM6t+B40f0GWv9eNJAJmuNx2X/sHEOLvMyvEPN8GfbdN1qmr19O8N2nLraOzeWjXocHz1S4w==", "requires": { "dijkstrajs": "^1.0.1", "isarray": "^2.0.1", @@ -6351,50 +6362,11 @@ "wrap-ansi": "^5.1.0" } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -6405,33 +6377,6 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "requires": { - "invert-kv": "^2.0.0" - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -6471,21 +6416,20 @@ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, "yargs": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.0" + "yargs-parser": "^13.1.1" } }, "yargs-parser": { @@ -6893,6 +6837,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -6900,7 +6845,8 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true }, "shelljs": { "version": "0.3.0", @@ -7221,7 +7167,8 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true }, "strip-json-comments": { "version": "2.0.1", @@ -7744,6 +7691,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index 89effabc..9dc39240 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "passport": "^0.4.0", "passport-local": "^1.0.0", "q": "^1.5.1", - "qrcode": "^1.4.0", + "qrcode": "^1.4.1", "winston": "^2.4.4" }, "devDependencies": { From 1c09b17b94c1ef8e2d7c2cb1d11f131da0024caa Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2019 15:13:36 +0000 Subject: [PATCH 092/243] Bump @types/mongodb from 3.1.28 to 3.1.29 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.28 to 3.1.29. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8e6529d5..3b771fad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -636,9 +636,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.28", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.28.tgz", - "integrity": "sha512-tG+QqJ/hir2p0069ee28t2O9tlGRJKDq1WFZC2QYMlU47LGdldLL8tepfTq6aFLvP58OpwSoxaJ/qjW93ob1NQ==", + "version": "3.1.29", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.29.tgz", + "integrity": "sha512-X74BBsFQruQXVJif2oJ08uceUfAVSkb2gl6Zm07fgqKQHnTdxIW3vknHNpQahogezX42EPQv9A+dYG0+CFY8aA==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 9dc39240..d961b354 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.28", + "@types/mongodb": "^3.1.29", "@types/mongoose": "^5.5.8", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From 8faa3e4d47828e049c5efc458f2045c26094acb8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2019 15:37:41 +0000 Subject: [PATCH 093/243] Bump @types/mongoose from 5.5.8 to 5.5.9 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.8 to 5.5.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b771fad..da7906ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -646,9 +646,9 @@ } }, "@types/mongoose": { - "version": "5.5.8", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.8.tgz", - "integrity": "sha512-PtKUS5IC72F/5dwaUaCleYlXuaXXLDUL2wUGSnteq7ifUDQRqNji/vEpK8KQR+uHiRih1l90g4doOAZOc9veUg==", + "version": "5.5.9", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.9.tgz", + "integrity": "sha512-KVM8yWVGPc2XD8iov+VzMq/3vyzJ3kqQuiZOJOe3VTVW+U7R4bk5lDfRFvqnnPpQ/pvMPSn6xVVnuYaMUKhZSg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index d961b354..e5f7856c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.29", - "@types/mongoose": "^5.5.8", + "@types/mongoose": "^5.5.9", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From 5484505906ab13df4ac7292cd8978018aeada762 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2019 15:37:28 +0000 Subject: [PATCH 094/243] Bump mongoose from 5.6.5 to 5.6.6 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.5 to 5.6.6. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.5...5.6.6) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index da7906ba..d1b960a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5625,9 +5625,9 @@ } }, "mongoose": { - "version": "5.6.5", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.5.tgz", - "integrity": "sha512-c8bIo8mxbf1ybwo9jgPKcJRICQBlIMKwDWt2A+M7h0AutroQ5EqzRAYOK1vrHwwwq00EcJyVwjVBW2wv8E9Wfw==", + "version": "5.6.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.6.tgz", + "integrity": "sha512-5uecJSyl2TwbGM9vJteP4C54zsQL6qllq1qe/JPGO3oqIWcK/PnzCL91E0gfPH5VVpvWGX+6PafNYmU3NK8S7w==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index e5f7856c..488a6d4b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.5", + "mongoose": "^5.6.6", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 7c0488824bdde7d6a1f129950607950ec66543bc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2019 15:05:37 +0000 Subject: [PATCH 095/243] Bump @types/mongodb from 3.1.29 to 3.1.30 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.29 to 3.1.30. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1b960a5..bf898876 100644 --- a/package-lock.json +++ b/package-lock.json @@ -636,9 +636,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.29", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.29.tgz", - "integrity": "sha512-X74BBsFQruQXVJif2oJ08uceUfAVSkb2gl6Zm07fgqKQHnTdxIW3vknHNpQahogezX42EPQv9A+dYG0+CFY8aA==", + "version": "3.1.30", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.30.tgz", + "integrity": "sha512-o8NLZRp+zEILEMj628cCTT2bSWH/Zst+vjSNgaSoKwGeHqJXiGPBSHb0RuidPrllBEyQ+uSW/qNPv0b5mzh+SA==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 488a6d4b..8bdb7209 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.29", + "@types/mongodb": "^3.1.30", "@types/mongoose": "^5.5.9", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From 0e8ac0f2a06f406108e7161005e1af4c60a1d027 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2019 18:28:08 +0000 Subject: [PATCH 096/243] Bump @types/mongoose from 5.5.9 to 5.5.11 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.9 to 5.5.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf898876..3a209436 100644 --- a/package-lock.json +++ b/package-lock.json @@ -646,9 +646,9 @@ } }, "@types/mongoose": { - "version": "5.5.9", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.9.tgz", - "integrity": "sha512-KVM8yWVGPc2XD8iov+VzMq/3vyzJ3kqQuiZOJOe3VTVW+U7R4bk5lDfRFvqnnPpQ/pvMPSn6xVVnuYaMUKhZSg==", + "version": "5.5.11", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.11.tgz", + "integrity": "sha512-Z1W2V3zrB+SeDGI6G1G5XR3JJkkMl4ni7a2Kmq10abdY0wapbaTtUT2/31N+UTPEzhB0KPXUgtQExeKxrc+hxQ==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 8bdb7209..737dc106 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.30", - "@types/mongoose": "^5.5.9", + "@types/mongoose": "^5.5.11", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From 0a8702e9894a2779f9c89d15c67936edc43c46be Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2019 10:43:37 +0000 Subject: [PATCH 097/243] Bump mongoose from 5.6.6 to 5.6.7 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.6 to 5.6.7. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.6...5.6.7) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a209436..2a3639dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5625,9 +5625,9 @@ } }, "mongoose": { - "version": "5.6.6", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.6.tgz", - "integrity": "sha512-5uecJSyl2TwbGM9vJteP4C54zsQL6qllq1qe/JPGO3oqIWcK/PnzCL91E0gfPH5VVpvWGX+6PafNYmU3NK8S7w==", + "version": "5.6.7", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.7.tgz", + "integrity": "sha512-42rbdZ9HLBbGjLvRSB4voqemgFkJTIyqSLLcJARKs1zdQzEJ3O77dWRllIy2bSo35GcY17ihEdoJX27pDqu3Mg==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 737dc106..313f1b6a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.6", + "mongoose": "^5.6.7", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From a4db28e73428cf7eba3d428868f8b3ca05b1b488 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2019 10:09:18 +0000 Subject: [PATCH 098/243] Bump @types/mongodb from 3.1.30 to 3.1.31 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.30 to 3.1.31. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a3639dd..ba0283f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -636,9 +636,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.30", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.30.tgz", - "integrity": "sha512-o8NLZRp+zEILEMj628cCTT2bSWH/Zst+vjSNgaSoKwGeHqJXiGPBSHb0RuidPrllBEyQ+uSW/qNPv0b5mzh+SA==", + "version": "3.1.31", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.31.tgz", + "integrity": "sha512-0l6z2ARkyAkgdtzF/Hqx3cRoADDQK/7VHvESikhLXjanSpIo1EJt2JL4NpM+jIqLWzn5P1IxRBSIIOqs5ZKBOQ==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 313f1b6a..25dfc74e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.30", + "@types/mongodb": "^3.1.31", "@types/mongoose": "^5.5.11", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From db9d7916a38e0ffaf74ed09769ff5733debb07ef Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2019 08:25:28 +0000 Subject: [PATCH 099/243] Bump @google-cloud/storage from 3.0.3 to 3.0.4 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.0.3 to 3.0.4. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.0.3...v3.0.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 116 +++++++++++++++++++++++++++++++++++++--------- package.json | 2 +- 2 files changed, 95 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba0283f2..b00c483e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.0.3.tgz", - "integrity": "sha512-62N6qRCnY9zi5bK1O+IX/wQEU8NL2D4Tuo3DrrgY5Fk5n8lHlTLJLHZi730k/v2Vr1p1+fG0trfB8eNIUjkW/A==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.0.4.tgz", + "integrity": "sha512-d/4ph98ljx+iovUvGV6ch545Fvn0t8r7NKdAXGNbR4F2KtD+OfX16rgYgWKffKzpTkd4aFB+hm8NVnzYwqcqXg==", "requires": { "@google-cloud/common": "^2.0.0", "@google-cloud/paginator": "^1.0.0", @@ -212,7 +212,7 @@ "mime-types": "^2.0.8", "onetime": "^5.1.0", "p-limit": "^2.2.0", - "pumpify": "^1.5.1", + "pumpify": "^2.0.0", "snakeize": "^0.1.0", "stream-events": "^1.0.1", "through2": "^3.0.0", @@ -220,9 +220,9 @@ }, "dependencies": { "@google-cloud/common": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.0.4.tgz", - "integrity": "sha512-Q2QN2KL+6w8Idl2mAI01Q72ZizJdQ+aPJUYQ+COwnUR7njskjdtHHU/Jh14ilNIzOMw+OIdIF4ebwOdsqh23QQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.0.5.tgz", + "integrity": "sha512-xnhyFQDmX9qM6j3VgP9URSdMnv/d5hi/LJljtEj31CVS+IMCSDj2jj7p4t99vTshteIyCVQ2Q/dhr1dOLYpAkw==", "requires": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", @@ -231,7 +231,7 @@ "duplexify": "^3.6.0", "ent": "^2.2.0", "extend": "^3.0.2", - "google-auth-library": "^4.0.0", + "google-auth-library": "^5.0.0", "retry-request": "^4.0.0", "teeny-request": "^4.0.0" } @@ -315,9 +315,9 @@ } }, "google-auth-library": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-4.2.5.tgz", - "integrity": "sha512-Vfsr82M1KTdT0H0wjawwp0LHsT6mPKSolRp21ZpJ7Ydq63zRe8DbGKjRCCrhsRZHg+p17DuuSCMEznwk3CJRdw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.1.1.tgz", + "integrity": "sha512-Au/lHG0Nvafprs8O66xu9qzfj/uEXWR+jmrhE2zHd9rh7mA+4b5H21rMP3xgQwmHXZHOOVN1GEuCEwlUut3gvg==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", @@ -374,6 +374,38 @@ "p-try": "^2.0.0" } }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.0.tgz", + "integrity": "sha512-ieN9HmpFPt4J4U4qnjN4BxrnqpPPXJyp3qFErxfwBtFOec6ewpIHdS2eu3TkmGW6S+RzFGEOGpm5ih/X/onRPQ==", + "requires": { + "duplexify": "^4.1.1", + "inherits": "^2.0.3", + "pump": "^3.0.0" + }, + "dependencies": { + "duplexify": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz", + "integrity": "sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + } + } + }, "readable-stream": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", @@ -3328,15 +3360,15 @@ } }, "gcs-resumable-upload": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.0.tgz", - "integrity": "sha512-yI7TL4XM2P4pm27FsrhSnEWoF3twP16f81jNTkFbajmg4mRnNq4dKSuZPcyWSV7aT5DsUJIGq0m1iKdIYGIskg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.3.tgz", + "integrity": "sha512-LNmrW+Yel0gbqZ5NZMMXJTH74SS6nGUP9Uca4pPY9bRIYDHJ5/TFAAaHsxCWf8+tid/4eIdNevrv9PDjPTPTeg==", "requires": { "abort-controller": "^3.0.0", "configstore": "^5.0.0", "gaxios": "^2.0.0", - "google-auth-library": "^4.0.0", - "pumpify": "^1.5.1", + "google-auth-library": "^5.0.0", + "pumpify": "^2.0.0", "stream-events": "^1.0.4" }, "dependencies": { @@ -3371,6 +3403,17 @@ "is-obj": "^2.0.0" } }, + "duplexify": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz", + "integrity": "sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, "gaxios": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.0.1.tgz", @@ -3392,9 +3435,9 @@ } }, "google-auth-library": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-4.2.5.tgz", - "integrity": "sha512-Vfsr82M1KTdT0H0wjawwp0LHsT6mPKSolRp21ZpJ7Ydq63zRe8DbGKjRCCrhsRZHg+p17DuuSCMEznwk3CJRdw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.1.1.tgz", + "integrity": "sha512-Au/lHG0Nvafprs8O66xu9qzfj/uEXWR+jmrhE2zHd9rh7mA+4b5H21rMP3xgQwmHXZHOOVN1GEuCEwlUut3gvg==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", @@ -3456,10 +3499,39 @@ "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.5.tgz", "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.0.tgz", + "integrity": "sha512-ieN9HmpFPt4J4U4qnjN4BxrnqpPPXJyp3qFErxfwBtFOec6ewpIHdS2eu3TkmGW6S+RzFGEOGpm5ih/X/onRPQ==", + "requires": { + "duplexify": "^4.1.1", + "inherits": "^2.0.3", + "pump": "^3.0.0" + } + }, + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "semver": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", - "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "unique-string": { "version": "2.0.0", diff --git a/package.json b/package.json index 25dfc74e..adefd5fc 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.0.3", + "@google-cloud/storage": "^3.0.4", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 34c2724220a27409cbeb314c2fbd8c18642305a3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2019 09:35:40 +0000 Subject: [PATCH 100/243] Bump mongoose from 5.6.7 to 5.6.8 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.7 to 5.6.8. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.7...5.6.8) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b00c483e..cb2934bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5697,9 +5697,9 @@ } }, "mongoose": { - "version": "5.6.7", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.7.tgz", - "integrity": "sha512-42rbdZ9HLBbGjLvRSB4voqemgFkJTIyqSLLcJARKs1zdQzEJ3O77dWRllIy2bSo35GcY17ihEdoJX27pDqu3Mg==", + "version": "5.6.8", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.8.tgz", + "integrity": "sha512-BhgGU/KvnVX8WbamcWgtG/45rp+xZnaF9MhNbzESIIYxK7g5QurXYcaGGCm/JFiIdIxkVUgBycWG7UzRUEzvDg==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index adefd5fc..b2936940 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.7", + "mongoose": "^5.6.8", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From fe3313905da4010159c8ccf214d792d8c0e212ae Mon Sep 17 00:00:00 2001 From: Tyrone Wong Date: Mon, 24 Jun 2019 15:23:47 -0400 Subject: [PATCH 101/243] Fix #286 put idValidator before authorization --- routes/api/account.js | 34 +++++----- routes/api/auth.js | 92 +++++++++++++------------- routes/api/hacker.js | 142 +++++++++++++++++++++------------------- routes/api/sponsor.js | 12 ++-- routes/api/team.js | 49 +++++++------- routes/api/volunteer.js | 10 +-- 6 files changed, 174 insertions(+), 165 deletions(-) diff --git a/routes/api/account.js b/routes/api/account.js index c973ef5a..f394e43b 100644 --- a/routes/api/account.js +++ b/routes/api/account.js @@ -17,11 +17,11 @@ const Middleware = { Auth: require("../../middlewares/auth.middleware") }; const Services = { - Account: require("../../services/account.service"), + Account: require("../../services/account.service") }; module.exports = { - activate: function (apiRouter) { + activate: function(apiRouter) { const accountRouter = express.Router(); /** @@ -135,7 +135,7 @@ module.exports = { Middleware.Account.addAccount, Middleware.Auth.addCreationRoleBindings, - // middleware to create a hacker token + // middleware to create a hacker token // and send a confirmation message Middleware.Auth.sendConfirmAccountEmailMiddleware, // should return status in this function @@ -170,12 +170,12 @@ module.exports = { } */ accountRouter.route("/invite").post( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Account.inviteAccountValidator, - Middleware.parseBody.middleware, - Middleware.Account.inviteAccount, - Controllers.Account.invitedAccount + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Validator.Account.inviteAccountValidator, + Middleware.parseBody.middleware, + Middleware.Account.inviteAccount, + Controllers.Account.invitedAccount ); /** * @api {get} /account/invite Get all of the invites. @@ -193,11 +193,11 @@ module.exports = { } */ accountRouter.route("/invite").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.parseBody.middleware, - Middleware.Account.getInvites, - Controllers.Account.gotInvites + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.parseBody.middleware, + Middleware.Account.getInvites, + Controllers.Account.gotInvites ); /** @@ -243,10 +243,10 @@ module.exports = { * {"message": "Error while updating account", "data": {}} */ accountRouter.route("/:id").patch( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Account.findById]), // validators - Middleware.Validator.RouteParam.idValidator, Middleware.Validator.Account.updateAccountValidator, Middleware.parseBody.middleware, @@ -290,10 +290,10 @@ module.exports = { * {"message": "Account not found", "data": {}} */ accountRouter.route("/:id").get( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Account.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Account.getById, @@ -302,4 +302,4 @@ module.exports = { apiRouter.use("/account", accountRouter); } -}; \ No newline at end of file +}; diff --git a/routes/api/auth.js b/routes/api/auth.js index 72fb8cd6..957f31cb 100644 --- a/routes/api/auth.js +++ b/routes/api/auth.js @@ -20,7 +20,7 @@ const Controllers = { }; module.exports = { - activate: function (apiRouter) { + activate: function(apiRouter) { passport.serializeUser(Services.Auth.serializeUser); passport.deserializeUser(Services.Auth.deserializeUser); const authRouter = express.Router(); @@ -55,34 +55,32 @@ module.exports = { * @apiName logout * @apiGroup Authentication * @apiVersion 0.0.8 - * + * * @apiSuccess {string} message Success message * @apiSuccess {object} data empty - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * {"message": "Successfully logged out", "data": {}} - * + * * @apiPermission: public */ - authRouter.route("/logout").get( - Controllers.Auth.logout - ); + authRouter.route("/logout").get(Controllers.Auth.logout); /** * @api {post} /auth/password/forgot forgot password route * @apiName forgotPassword * @apiGroup Authentication * @apiVersion 0.0.8 - * + * * @apiParam {String} email the email address of the account - * + * * @apiParamExample {json} Request-Example: * { "email": "myemail@mchacks.ca" } - * + * * @apiSuccess {string} message Success message * @apiSuccess {object} data empty - * @apiSuccessExample {json} Success-Response: + * @apiSuccessExample {json} Success-Response: * {"message": "Sent reset email", "data": {}} - * + * * @apiPermission: public */ authRouter.route("/password/forgot").post( @@ -102,21 +100,21 @@ module.exports = { * @apiName changePassword * @apiGroup Authentication * @apiVersion 0.0.8 - * + * * @apiParam {String} oldPassword The current password of the user * @apiParam {String} newPassword The new password of the user - * + * * @apiParamExample {json} Request-Example: - * { + * { * "oldPassword": "password12345", * "newPassword": "password123456" * } - * + * * @apiSuccess {string} message Success message * @apiSuccess {object} data empty - * @apiSuccessExample {json} Success-Response: + * @apiSuccessExample {json} Success-Response: * {"message": "Successfully reset password", "data": {}} - * + * * @apiPermission: Must be logged in */ authRouter.route("/password/change").patch( @@ -135,22 +133,22 @@ module.exports = { * @apiName resetPassword * @apiGroup Authentication * @apiVersion 0.0.8 - * + * * @apiParam {String} password the password of the account * @apiHeader {String} Authentication the token that was provided in the reset password email * @apiHeaderExample {json} Header-Example: * { * "X-Reset-Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" * } - * + * * @apiParamExample {json} Request-Example: * { "password": "hunter2" } - * + * * @apiSuccess {string} message Success message * @apiSuccess {object} data empty - * @apiSuccessExample {json} Success-Response: + * @apiSuccessExample {json} Success-Response: * {"message": "Successfully reset password", "data": {}} - * + * * @apiPermission: must have authentication token */ authRouter.route("/password/reset").post( @@ -184,19 +182,19 @@ module.exports = { * @apiSuccess {object} data empty * @apiSuccessExample {json} Success-Response: * {"message": "Successfully confirmed account", "data": {}} - * + * * @apiError {string} message Error message * @apiError {object} data empty - * @apiErrorExample {object} Error-Response: + * @apiErrorExample {object} Error-Response: * {"message": "Invalid token for confirming account, "data": {}} - * + * */ authRouter.route("/confirm/:token").post( - Middleware.Validator.Auth.accountConfirmationValidator, - Middleware.parseBody.middleware, - Middleware.Auth.parseAccountConfirmationToken, - Middleware.Auth.validateConfirmationToken, - Controllers.Auth.confirmAccount + Middleware.Validator.Auth.accountConfirmationValidator, + Middleware.parseBody.middleware, + Middleware.Auth.parseAccountConfirmationToken, + Middleware.Auth.validateConfirmationToken, + Controllers.Auth.confirmAccount ); /** @@ -242,12 +240,12 @@ module.exports = { * */ authRouter.route("/rolebindings/:id").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Account.findById]), - Middleware.Validator.RouteParam.idValidator, - Middleware.parseBody.middleware, - Middleware.Auth.retrieveRoleBindings, - Controllers.Auth.retrieveRoleBindings + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Account.findById]), + Middleware.parseBody.middleware, + Middleware.Auth.retrieveRoleBindings, + Controllers.Auth.retrieveRoleBindings ); /** @@ -260,24 +258,24 @@ module.exports = { * @apiSuccess {object} data empty * @apiSuccessExample {json} Success-Response: * {"message": "Successfully resent confirmation email", "data": {}} - * + * * @apiError {string} message Error message * @apiError {object} data empty * @apiErrorExample {json} Error-Response: * HTTP/1.1 422 * {"message": "Account already confirmed", "data": {}} - * + * * @apiError {string} message Error message * @apiError {object} data empty * @apiErrorExample {json} Error-Response: * HTTP/1.1 428 * {"message": "Account confirmation token does not exist", "data": {}} - * + * */ authRouter.route("/confirm/resend").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.resendConfirmAccountEmail, - Controllers.Auth.sentConfirmationEmail + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.resendConfirmAccountEmail, + Controllers.Auth.sentConfirmationEmail ); /** @@ -294,13 +292,13 @@ module.exports = { * [{name: "GodStaff", routes: Array(27), id: "5bee20ef3ca9dd4754382880"}, * {name: "Hacker", routes: Array(10), id: "5bee20ef3ca9dd4754382881"}, * {name: "Volunteer", routes: Array(4), id: "5bee20ef3ca9dd4754382882"}] - * + * */ authRouter.route("/roles").get( - Middleware.Auth.retrieveRoles, - Controllers.Auth.retrievedRoles + Middleware.Auth.retrieveRoles, + Controllers.Auth.retrievedRoles ); apiRouter.use("/auth", authRouter); } -}; \ No newline at end of file +}; diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 2ce81ad9..b0289e35 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -7,7 +7,7 @@ const Middleware = { Validator: { /* Insert the require statement to the validator file here */ Hacker: require("../../middlewares/validators/hacker.validator"), - RouteParam: require("../../middlewares/validators/routeParam.validator"), + RouteParam: require("../../middlewares/validators/routeParam.validator") }, /* Insert all of ther middleware require statements here */ parseBody: require("../../middlewares/parse-body.middleware"), @@ -18,12 +18,12 @@ const Middleware = { }; const Services = { Hacker: require("../../services/hacker.service"), - Account: require("../../services/account.service"), -} + Account: require("../../services/account.service") +}; const CONSTANTS = require("../../constants/general.constant"); module.exports = { - activate: function (apiRouter) { + activate: function(apiRouter) { const hackerRouter = express.Router(); /** @@ -205,15 +205,15 @@ module.exports = { * */ hackerRouter.route("/stats").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.statsValidator, - Middleware.parseBody.middleware, - Middleware.Search.setExpandTrue, - Middleware.Search.parseQuery, - Middleware.Search.executeQuery, - Middleware.Hacker.getStats, - Controllers.Hacker.gotStats + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Validator.Hacker.statsValidator, + Middleware.parseBody.middleware, + Middleware.Search.setExpandTrue, + Middleware.Search.parseQuery, + Middleware.Search.executeQuery, + Middleware.Hacker.getStats, + Controllers.Hacker.gotStats ); /** @@ -221,13 +221,13 @@ module.exports = { * @apiName patchHackerStatus * @apiGroup Hacker * @apiVersion 0.0.9 - * + * * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in") * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Changed hacker information", + * "message": "Changed hacker information", * "data": { * "status": "Accepted" * } @@ -235,15 +235,15 @@ module.exports = { * @apiPermission Administrator */ hackerRouter.route("/status/:id").patch( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, - Middleware.Validator.Hacker.updateStatusValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, - Middleware.Hacker.updateHacker, - Middleware.Hacker.sendStatusUpdateEmail, - Controllers.Hacker.updatedHacker + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + Middleware.Validator.Hacker.updateStatusValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, + Middleware.Hacker.updateHacker, + Middleware.Hacker.sendStatusUpdateEmail, + Controllers.Hacker.updatedHacker ); /** @@ -254,9 +254,9 @@ module.exports = { * @apiParam (body) {string} [status] Check-in status. "Checked-in" * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Changed hacker information", + * "message": "Changed hacker information", * "data": { * "status": "Checked-in" * } @@ -265,14 +265,17 @@ module.exports = { * @apiPermission Volunteer */ hackerRouter.route("/checkin/:id").patch( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Hacker.parsePatch, - Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED]), + Middleware.Hacker.checkStatus([ + CONSTANTS.HACKER_STATUS_ACCEPTED, + CONSTANTS.HACKER_STATUS_CONFIRMED + ]), Middleware.Hacker.parseCheckIn, Middleware.Hacker.updateHacker, @@ -347,10 +350,10 @@ module.exports = { * {"message": "Error while updating hacker", "data": {}} */ hackerRouter.route("/:id").patch( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.Validator.Hacker.updateHackerValidator, Middleware.parseBody.middleware, @@ -408,10 +411,10 @@ module.exports = { * {"message": "Hacker not found", "data": {}} */ hackerRouter.route("/:id").get( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Hacker.findById, @@ -482,21 +485,21 @@ module.exports = { * @apiGroup Hacker * @apiVersion 0.0.8 * @apiDescription NOTE: This must be sent via multipart/form-data POST request - * + * * @apiParam (param) {ObjectId} id Hacker id * @apiParam (body) {File} resume The uploaded file. - * + * * @apiSuccess {String} message Success message * @apiSuccess {Object} data Location in the bucket that the file was stored. - * @apiSuccessExample {json} Success-Response: + * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * { - * message: "Uploaded resume", + * message: "Uploaded resume", * data: { * filename: "resumes/1535032624768-507f191e810c19729de860ea" * } * } - * + * * @apiPermission Must be logged in, and the account id must be linked to the hacker. */ .post( @@ -509,7 +512,7 @@ module.exports = { Middleware.Util.Multer.single("resume"), //upload resume to storage and update hacker profile Middleware.Hacker.uploadResume, - //controller response + //controller response Controllers.Hacker.uploadedResume ) /** @@ -517,25 +520,25 @@ module.exports = { * @apiName getHackerResume * @apiGroup Hacker * @apiVersion 0.0.8 - * + * * @apiParam (param) {ObjectId} id Hacker id - * + * * @apiSuccess {String} message Success message * @apiSuccessExample {json} Success-Response: - * HTTP/1.1 200 OK - * { - * message: "Downloaded resume", - * data: { - * id: "507f191e810c19729de860ea", - * resume: [Buffer] - * } + * HTTP/1.1 200 OK + * { + * message: "Downloaded resume", + * data: { + * id: "507f191e810c19729de860ea", + * resume: [Buffer] + * } * } * @apiError {String} message "Resume does not exist" * @apiErrorExample {json} Error-Response: - * HTTP/1.1 404 - * { - * message: "Resume not found", - * data: {} + * HTTP/1.1 404 + * { + * message: "Resume not found", + * data: {} * } * @apiSampleRequest off * @apiPermission Must be logged in, and the account id must be linked to the hacker. @@ -554,13 +557,13 @@ module.exports = { * @apiName patchHackerConfirmed * @apiGroup Hacker * @apiVersion 0.0.9 - * + * * @apiParam (body) {string} [status] The new status of the hacker. "Accepted", "Confirmed", or "Cancelled" * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Changed hacker information", + * "message": "Changed hacker information", * "data": { * "status": "Confirmed" * } @@ -569,15 +572,19 @@ module.exports = { * @apiPermission Hacker */ hackerRouter.route("/confirmation/:id").patch( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.Validator.Hacker.updateConfirmationValidator, Middleware.parseBody.middleware, Middleware.Hacker.parsePatch, - Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CANCELLED]), + Middleware.Hacker.checkStatus([ + CONSTANTS.HACKER_STATUS_ACCEPTED, + CONSTANTS.HACKER_STATUS_CONFIRMED, + CONSTANTS.HACKER_STATUS_CANCELLED + ]), Middleware.Hacker.parseConfirmation, Middleware.Hacker.updateHacker, @@ -592,28 +599,31 @@ module.exports = { * @apiName postHackerSendWeekOfEmail * @apiGroup Hacker * @apiVersion 0.0.9 - * + * * @apiParam (param) {string} [status] The hacker ID * @apiSuccess {string} message Success message * @apiSuccess {object} data empty - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Hacker week-of email sent.", + * "message": "Hacker week-of email sent.", * "data": {} * } * @apiPermission Administrator */ hackerRouter.route("/email/weekOf/:id").post( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Hacker.findById, - Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CHECKED_IN]), + Middleware.Hacker.checkStatus([ + CONSTANTS.HACKER_STATUS_CONFIRMED, + CONSTANTS.HACKER_STATUS_CHECKED_IN + ]), Middleware.Hacker.sendWeekOfEmail, Controllers.Hacker.sentWeekOfEmail - ) + ); /** * @api {post} /hacker/email/weekOf/:id @@ -621,22 +631,22 @@ module.exports = { * @apiName postHackerSendWeekOfEmail * @apiGroup Hacker * @apiVersion 0.0.9 - * + * * @apiParam (param) {string} [status] The hacker ID * @apiSuccess {string} message Success message * @apiSuccess {object} data empty - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Hacker week-of email sent.", + * "message": "Hacker week-of email sent.", * "data": {} * } * @apiPermission Administrator */ hackerRouter.route("/email/dayOf/:id").post( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Hacker.findById, Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CHECKED_IN]), @@ -646,4 +656,4 @@ module.exports = { apiRouter.use("/hacker", hackerRouter); } -}; \ No newline at end of file +}; diff --git a/routes/api/sponsor.js b/routes/api/sponsor.js index 91d8379c..41fac841 100644 --- a/routes/api/sponsor.js +++ b/routes/api/sponsor.js @@ -14,15 +14,15 @@ const Middleware = { /* Insert all of ther middleware require statements here */ parseBody: require("../../middlewares/parse-body.middleware"), Sponsor: require("../../middlewares/sponsor.middleware"), - Auth: require("../../middlewares/auth.middleware"), + Auth: require("../../middlewares/auth.middleware") }; const Services = { - Sponsor: require("../../services/sponsor.service"), + Sponsor: require("../../services/sponsor.service") }; const CONSTANTS = require("../../constants/general.constant"); module.exports = { - activate: function (apiRouter) { + activate: function(apiRouter) { const sponsorRouter = new express.Router(); /** @@ -89,10 +89,10 @@ module.exports = { * {"message": "Sponsor not found", "data": {}} */ sponsorRouter.route("/:id").get( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Sponsor.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Sponsor.findById, @@ -171,10 +171,10 @@ module.exports = { * {"message": "Error while updating sponsor", "data": {}} */ sponsorRouter.route("/:id").patch( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Sponsor.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.Validator.Sponsor.updateSponsorValidator, Middleware.parseBody.middleware, @@ -186,4 +186,4 @@ module.exports = { apiRouter.use("/sponsor", sponsorRouter); } -}; \ No newline at end of file +}; diff --git a/routes/api/team.js b/routes/api/team.js index 1a0b872f..63b1ffc0 100644 --- a/routes/api/team.js +++ b/routes/api/team.js @@ -9,19 +9,19 @@ const Middleware = { Validator: { /* Insert the require statement to the validator file here */ Team: require("../../middlewares/validators/team.validator"), - RouteParam: require("../../middlewares/validators/routeParam.validator"), + RouteParam: require("../../middlewares/validators/routeParam.validator") }, /* Insert all of ther middleware require statements here */ parseBody: require("../../middlewares/parse-body.middleware"), Team: require("../../middlewares/team.middleware"), - Auth: require("../../middlewares/auth.middleware"), + Auth: require("../../middlewares/auth.middleware") }; const Services = { - Hacker: require("../../services/hacker.service"), + Hacker: require("../../services/hacker.service") }; module.exports = { - activate: function (apiRouter) { + activate: function(apiRouter) { const teamRouter = new express.Router(); /** @@ -66,13 +66,13 @@ module.exports = { * @apiName patchJoinTeam * @apiGroup Team * @apiVersion 1.1.1 - * + * * @apiParam (body) {string} [name] Name of the team to join * @apiSuccess {string} message Success message * @apiSuccess {object} data {} - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Team join successful.", + * "message": "Team join successful.", * "data": {} * } */ @@ -94,21 +94,21 @@ module.exports = { * @apiName deleteSelfFromTeam * @apiGroup Team * @apiVersion 1.1.1 - * + * * @apiSuccess {string} message Success message * @apiSuccess {object} data {} - * @apiSuccessExample {object} Success-Response: + * @apiSuccessExample {object} Success-Response: * { - * "message": "Removal from team successful.", + * "message": "Removal from team successful.", * "data": {} * } */ teamRouter.route("/leave").patch( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Team.deleteUserFromTeam, - Controllers.Team.leftTeam - ); + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Team.deleteUserFromTeam, + Controllers.Team.leftTeam + ); /** * @api {get} /team/:id get a team's information @@ -147,18 +147,20 @@ module.exports = { * {"message": "Team not found", "data": {}} */ teamRouter.route("/:id").get( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), // get is available for all teams, or no teams. No authorization is done on the :id parameter. // However, a function is needed, so the identity function is put here. In reality, the route // is /api/team/:all, so the id is not checked. The returned object places the id inside accountId // to be consistent with other findById functions - Middleware.Auth.ensureAuthorized([(id) => { - return { - accountId: id - }; - }]), + Middleware.Auth.ensureAuthorized([ + id => { + return { + accountId: id + }; + } + ]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Team.populateMemberAccountsById, @@ -195,11 +197,10 @@ module.exports = { */ teamRouter.route("/:hackerId").patch( Middleware.Auth.ensureAuthenticated(), - + Middleware.Validator.RouteParam.hackeridValidator, Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), Middleware.Validator.Team.patchTeamValidator, - Middleware.Validator.RouteParam.hackeridValidator, Middleware.parseBody.middleware, Middleware.Team.parsePatch, @@ -211,4 +212,4 @@ module.exports = { apiRouter.use("/team", teamRouter); } -}; \ No newline at end of file +}; diff --git a/routes/api/volunteer.js b/routes/api/volunteer.js index c8ee237c..8bf065e0 100644 --- a/routes/api/volunteer.js +++ b/routes/api/volunteer.js @@ -8,12 +8,12 @@ const Middleware = { Validator: { /* Insert the require statement to the validator file here */ Volunteer: require("../../middlewares/validators/volunteer.validator"), - RouteParam: require("../../middlewares/validators/routeParam.validator"), + RouteParam: require("../../middlewares/validators/routeParam.validator") }, /* Insert all of ther middleware require statements here */ parseBody: require("../../middlewares/parse-body.middleware"), Volunteer: require("../../middlewares/volunteer.middleware"), - Auth: require("../../middlewares/auth.middleware"), + Auth: require("../../middlewares/auth.middleware") }; const Services = { Volunteer: require("../../services/volunteer.service") @@ -22,7 +22,7 @@ const Services = { const CONSTANTS = require("../../constants/general.constant"); module.exports = { - activate: function (apiRouter) { + activate: function(apiRouter) { const volunteerRouter = express.Router(); /** @@ -47,10 +47,10 @@ module.exports = { * {"message": "Volunteer not found", "data": {}} */ volunteerRouter.route("/:id").get( + Middleware.Validator.RouteParam.idValidator, Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Volunteer.findById]), - Middleware.Validator.RouteParam.idValidator, Middleware.parseBody.middleware, Middleware.Volunteer.findById, @@ -101,4 +101,4 @@ module.exports = { apiRouter.use("/volunteer", volunteerRouter); } -}; \ No newline at end of file +}; From b55bffdd2833108961ddacd5a6bf110563d866a2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2019 08:53:12 +0000 Subject: [PATCH 102/243] Bump @types/mongoose from 5.5.11 to 5.5.12 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.11 to 5.5.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index cb2934bc..398ebd3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -678,9 +678,9 @@ } }, "@types/mongoose": { - "version": "5.5.11", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.11.tgz", - "integrity": "sha512-Z1W2V3zrB+SeDGI6G1G5XR3JJkkMl4ni7a2Kmq10abdY0wapbaTtUT2/31N+UTPEzhB0KPXUgtQExeKxrc+hxQ==", + "version": "5.5.12", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.12.tgz", + "integrity": "sha512-41TDORylr6M9Kytli/Qry28cQjD919+w+jHNR9rca95xH1/joNLUkLg9okKJ1I4mIR6Af28ESjBssed7RKElVA==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index b2936940..dd9ec0cd 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.31", - "@types/mongoose": "^5.5.11", + "@types/mongoose": "^5.5.12", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", "chai": "^4.2.0", From 4eff31504b92735c68e8b1c0454b419a407f30af Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2019 05:26:49 +0000 Subject: [PATCH 103/243] Bump @types/mongodb from 3.1.31 to 3.1.32 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.31 to 3.1.32. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 398ebd3b..a3ad0c02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -668,9 +668,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.31", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.31.tgz", - "integrity": "sha512-0l6z2ARkyAkgdtzF/Hqx3cRoADDQK/7VHvESikhLXjanSpIo1EJt2JL4NpM+jIqLWzn5P1IxRBSIIOqs5ZKBOQ==", + "version": "3.1.32", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.32.tgz", + "integrity": "sha512-4epw+XB6XbpeTeK4dvsBO0hGwKOA+1QJF2Dt2Dl0HCOjqgAKx8/9ohuiWLi14TjXtBjo4hO7ibXbnbkQepVyeA==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index dd9ec0cd..479a1398 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.31", + "@types/mongodb": "^3.1.32", "@types/mongoose": "^5.5.12", "@types/multer": "^1.3.7", "apidoc": "^0.17.7", From b48d67659f4e1ffebeb58dfcb36a7d1c0a895aea Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2019 05:50:40 +0000 Subject: [PATCH 104/243] Bump @types/multer from 1.3.7 to 1.3.8 Bumps [@types/multer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/multer) from 1.3.7 to 1.3.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/multer) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3ad0c02..7da59697 100644 --- a/package-lock.json +++ b/package-lock.json @@ -688,9 +688,9 @@ } }, "@types/multer": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.3.7.tgz", - "integrity": "sha512-Lx4rNtGajRGtcVwJe1sKPAkAuBBWq8TOuimKJfOfK7ayY1Jc+18Lx00GjagLeIwaH2+OvFJvCv8tz+pvbt3OoA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.3.8.tgz", + "integrity": "sha512-q6y8wkcsKTCxaJBvVmL9hdtQ8p3uAex1pP0zi8CKa8uYDzrKzNn2j5/uaOiaIuMDqDZBhNg1rbiF9MyVMbwQ+w==", "dev": true, "requires": { "@types/express": "*" diff --git a/package.json b/package.json index 479a1398..26f1cac2 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.1.32", "@types/mongoose": "^5.5.12", - "@types/multer": "^1.3.7", + "@types/multer": "^1.3.8", "apidoc": "^0.17.7", "chai": "^4.2.0", "chai-http": "^4.3.0", From 9dc713f449a0d4acd428c6e1cd9240dcb774b937 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2019 18:26:19 +0000 Subject: [PATCH 105/243] Bump mongoose from 5.6.8 to 5.6.9 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.8 to 5.6.9. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.8...5.6.9) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7da59697..452075be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5697,9 +5697,9 @@ } }, "mongoose": { - "version": "5.6.8", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.8.tgz", - "integrity": "sha512-BhgGU/KvnVX8WbamcWgtG/45rp+xZnaF9MhNbzESIIYxK7g5QurXYcaGGCm/JFiIdIxkVUgBycWG7UzRUEzvDg==", + "version": "5.6.9", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.9.tgz", + "integrity": "sha512-NRW5UJSmwyJxK+MRHmq+dQKgZqMZCpW1aPkpBZESqrrgF2J15Flo/4K3RYkSSQY7oKhfbgqZTPo+J1snJ3hJ3w==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 26f1cac2..5f0a8977 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.8", + "mongoose": "^5.6.9", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 9a234db2f2c584404b51b08c08af42dbe1c8c924 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2019 10:50:51 +0000 Subject: [PATCH 106/243] Bump @google-cloud/storage from 3.0.4 to 3.1.0 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.0.4 to 3.1.0. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.0.4...v3.1.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 94 ++++++++++++++++++----------------------------- package.json | 2 +- 2 files changed, 36 insertions(+), 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index 452075be..e38ec886 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,19 +192,19 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.0.4.tgz", - "integrity": "sha512-d/4ph98ljx+iovUvGV6ch545Fvn0t8r7NKdAXGNbR4F2KtD+OfX16rgYgWKffKzpTkd4aFB+hm8NVnzYwqcqXg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.1.0.tgz", + "integrity": "sha512-dKKcMtWpu6Haoh7ricAM+QLAeQSA+ci4AfpRXQZXk8yD0JItYhmTx59ht88cSB+9qIYrfXCnpshsvyF0PJ5N/w==", "requires": { - "@google-cloud/common": "^2.0.0", - "@google-cloud/paginator": "^1.0.0", + "@google-cloud/common": "^2.1.0", + "@google-cloud/paginator": "^2.0.0", "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "compressible": "^2.0.12", "concat-stream": "^2.0.0", - "date-and-time": "^0.7.0", + "date-and-time": "^0.8.0", "duplexify": "^3.5.0", - "extend": "^3.0.0", + "extend": "^3.0.2", "gaxios": "^2.0.1", "gcs-resumable-upload": "^2.0.0", "hash-stream-validation": "^0.2.1", @@ -220,31 +220,28 @@ }, "dependencies": { "@google-cloud/common": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.0.5.tgz", - "integrity": "sha512-xnhyFQDmX9qM6j3VgP9URSdMnv/d5hi/LJljtEj31CVS+IMCSDj2jj7p4t99vTshteIyCVQ2Q/dhr1dOLYpAkw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.1.0.tgz", + "integrity": "sha512-ynTowaTPL36CYywI86EqAspNzVttTCxT7ft8W65/EUR8aFdKUhgZaSJUIhYLt7lnkAg5uL7iE/CYa457m1wTRQ==", "requires": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", - "@types/request": "^2.48.1", "arrify": "^2.0.0", "duplexify": "^3.6.0", "ent": "^2.2.0", "extend": "^3.0.2", "google-auth-library": "^5.0.0", "retry-request": "^4.0.0", - "teeny-request": "^4.0.0" + "teeny-request": "^5.1.1" } }, "@google-cloud/paginator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-1.0.2.tgz", - "integrity": "sha512-mUqsRAJ/OT/Zo/Qh2v+kEeWsEgKZtK4vs2skSiVeudPLwjLSVng+fYZYtLK4kx05OSnm16MqurcPqW14g1/TgQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.0.tgz", + "integrity": "sha512-droVsitvSUGSoMV7Hbk2B5dCFkZIz9YNu3D1AxgFh+hmbSEWJ9SgB/M3WrU8CUx3pseH7IbLuq8jgs3HEFzeHw==", "requires": { "arrify": "^2.0.0", - "extend": "^3.0.1", - "split-array-stream": "^2.0.0", - "stream-events": "^1.0.4" + "extend": "^3.0.1" } }, "@google-cloud/projectify": { @@ -257,17 +254,6 @@ "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.2.tgz", "integrity": "sha512-7WfV4R/3YV5T30WRZW0lqmvZy9hE2/p9MvpI34WuKa2Wz62mLu5XplGTFEMK6uTbJCLWUxTcZ4J4IyClKucE5g==" }, - "@types/request": { - "version": "2.48.2", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.2.tgz", - "integrity": "sha512-gP+PSFXAXMrd5PcD7SqHeUjdGshAI8vKQ3+AvpQr3ht9iQea+59LOKvKITcQI+Lg+1EIkDP6AFSBUJPWG8GDyA==", - "requires": { - "@types/caseless": "*", - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.0" - } - }, "arrify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", @@ -284,16 +270,6 @@ "typedarray": "^0.0.6" } }, - "form-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.0.tgz", - "integrity": "sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "gaxios": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.0.1.tgz", @@ -315,16 +291,16 @@ } }, "google-auth-library": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.1.1.tgz", - "integrity": "sha512-Au/lHG0Nvafprs8O66xu9qzfj/uEXWR+jmrhE2zHd9rh7mA+4b5H21rMP3xgQwmHXZHOOVN1GEuCEwlUut3gvg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.0.tgz", + "integrity": "sha512-I2726rgOedQ06HgTvoNvBeRCzy5iFe6z3khwj6ugfRd1b0VHwnTYKl/3t2ytOTo7kKc6KivYIBsCIdZf2ep67g==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", "gcp-metadata": "^2.0.0", - "gtoken": "^3.0.0", + "gtoken": "^4.0.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" } @@ -338,9 +314,9 @@ } }, "gtoken": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-3.0.2.tgz", - "integrity": "sha512-BOBi6Zz31JfxhSHRZBIDdbwIbOPyux10WxJHdx8wz/FMP1zyN1xFrsAWsgcLe5ww5v/OZu/MePUEZAjgJXSauA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.0.0.tgz", + "integrity": "sha512-XaRCfHJxhj06LmnWNBzVTAr85NfAErq0W1oabkdqwbq3uL/QTB1kyvGog361Uu2FMG/8e3115sIy/97Rnd4GjQ==", "requires": { "gaxios": "^2.0.0", "google-p12-pem": "^2.0.0", @@ -1921,9 +1897,9 @@ } }, "date-and-time": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.7.0.tgz", - "integrity": "sha512-qPHBPG0AQqbjP7wVf7vLv25/0bZRjYPiJiJtE0t6RqTswJR/6ExCXQLDnL5w4986j7i6470TMtalJxC8/UHrww==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.8.1.tgz", + "integrity": "sha512-p1d0c3HE7bJK4m3/TcNx7EFZcq0Jyvl05TWeESfC5FsJQVRlUrYAL7rB7NEPogx9C3rKsOZJn9PELYo9jVT7mw==" }, "date-now": { "version": "0.1.4", @@ -3435,16 +3411,16 @@ } }, "google-auth-library": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.1.1.tgz", - "integrity": "sha512-Au/lHG0Nvafprs8O66xu9qzfj/uEXWR+jmrhE2zHd9rh7mA+4b5H21rMP3xgQwmHXZHOOVN1GEuCEwlUut3gvg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.0.tgz", + "integrity": "sha512-I2726rgOedQ06HgTvoNvBeRCzy5iFe6z3khwj6ugfRd1b0VHwnTYKl/3t2ytOTo7kKc6KivYIBsCIdZf2ep67g==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", "gcp-metadata": "^2.0.0", - "gtoken": "^3.0.0", + "gtoken": "^4.0.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" } @@ -3458,9 +3434,9 @@ } }, "gtoken": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-3.0.2.tgz", - "integrity": "sha512-BOBi6Zz31JfxhSHRZBIDdbwIbOPyux10WxJHdx8wz/FMP1zyN1xFrsAWsgcLe5ww5v/OZu/MePUEZAjgJXSauA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.0.0.tgz", + "integrity": "sha512-XaRCfHJxhj06LmnWNBzVTAr85NfAErq0W1oabkdqwbq3uL/QTB1kyvGog361Uu2FMG/8e3115sIy/97Rnd4GjQ==", "requires": { "gaxios": "^2.0.0", "google-p12-pem": "^2.0.0", @@ -7322,9 +7298,9 @@ } }, "teeny-request": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-4.0.0.tgz", - "integrity": "sha512-Kk87eePsBQZsn5rOIwupObYV7doBMedW3fUOmu3LFVRGEJQ7oeClwWkGFS3nkFs9TFL36qf08vGJd34swMorHQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.1.3.tgz", + "integrity": "sha512-9bQzdndkpo4aga33bq/MGWAMJswFw02V2969hoe9PqgJUthOmOcZxtGiIPZXyaJEuNQ1aeVQyYO2Htm2CoDrkA==", "requires": { "https-proxy-agent": "^2.2.1", "node-fetch": "^2.2.0", diff --git a/package.json b/package.json index 5f0a8977..da507803 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.0.4", + "@google-cloud/storage": "^3.1.0", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 950db39f51d11ad2214aaf126af8dbed805d69ee Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Mon, 12 Aug 2019 20:06:08 -0400 Subject: [PATCH 107/243] Fix for duplicate rolebindings --- services/roleBinding.service.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/roleBinding.service.js b/services/roleBinding.service.js index 7a44b573..efcc9efc 100644 --- a/services/roleBinding.service.js +++ b/services/roleBinding.service.js @@ -24,7 +24,7 @@ async function createRoleBinding(accountId, roleId = undefined) { return newRb.save(); } else { return RoleBinding.findByIdAndUpdate(roleBindingModel._id, { - $push: { + $addToSet: { roles: roleId } }, logger.queryCallbackFactory(TAG, "roleBinding", query)); @@ -63,8 +63,8 @@ async function removeRoleBinding(accountId, roleId) { * @function getRoleBindingForAcct * @param {string} accountId The id of the account that you want the role bindings for. * @returns {Promise} - * @description - * Gets the roleBinding for a given account. Populates the role array as well with the Roles. + * @description + * Gets the roleBinding for a given account. Populates the role array as well with the Roles. */ async function getRoleBindingForAcct(accountId) { const TAG = "[RoleBinding Service # getRoleBindings]:"; @@ -83,7 +83,7 @@ async function getRoleBindingForAcct(accountId) { * @async * @function getById * @param {ObjectId} id The rolebinding id - * @description + * @description * Returns the roleBinding specified by the id. */ async function getById(id) { @@ -102,4 +102,4 @@ module.exports = { createRoleBinding: createRoleBinding, createRoleBindingByRoleName: createRoleBindingByRoleName, removeRoleBinding: removeRoleBinding -}; \ No newline at end of file +}; From aa90568c7c1c6c753b730ff60ab3985120b3b480 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2019 07:52:07 +0000 Subject: [PATCH 108/243] Bump @types/mongodb from 3.1.32 to 3.2.1 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.1.32 to 3.2.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e38ec886..097272c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -644,9 +644,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.1.32", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.1.32.tgz", - "integrity": "sha512-4epw+XB6XbpeTeK4dvsBO0hGwKOA+1QJF2Dt2Dl0HCOjqgAKx8/9ohuiWLi14TjXtBjo4hO7ibXbnbkQepVyeA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.2.1.tgz", + "integrity": "sha512-y8ZPXQbzJg+MJC+NdBEzireByJhhdEqcXBlllFKcFe0JWS/i1txenjv7LGGzO5hyCyJ8fil8EPB+E9UIuXvoiQ==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index da507803..a8d96897 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.1.32", + "@types/mongodb": "^3.2.1", "@types/mongoose": "^5.5.12", "@types/multer": "^1.3.8", "apidoc": "^0.17.7", From 15ec11ac24e581096623f296ccdb982b24976ad8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2019 08:42:40 +0000 Subject: [PATCH 109/243] Bump @types/mongodb from 3.2.1 to 3.2.2 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 097272c5..3b028fd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -644,9 +644,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.2.1.tgz", - "integrity": "sha512-y8ZPXQbzJg+MJC+NdBEzireByJhhdEqcXBlllFKcFe0JWS/i1txenjv7LGGzO5hyCyJ8fil8EPB+E9UIuXvoiQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.2.2.tgz", + "integrity": "sha512-0XBUoXM2yQxagOSIWCczsGmSpZomqWWgM/mH7Xgvr6hkVONflaEuC+OJwIgZm4A5wD6s56n9Re+oXK5Wy3mXMg==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index a8d96897..a3108ea6 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.2.1", + "@types/mongodb": "^3.2.2", "@types/mongoose": "^5.5.12", "@types/multer": "^1.3.8", "apidoc": "^0.17.7", From 907529ad2edf4f3d96d3b25ff0b340d49f2ac5c6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 13:51:56 +0000 Subject: [PATCH 110/243] Bump @types/mongodb from 3.2.2 to 3.2.3 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.2.2 to 3.2.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b028fd0..f23dcaa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -644,9 +644,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.2.2.tgz", - "integrity": "sha512-0XBUoXM2yQxagOSIWCczsGmSpZomqWWgM/mH7Xgvr6hkVONflaEuC+OJwIgZm4A5wD6s56n9Re+oXK5Wy3mXMg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.2.3.tgz", + "integrity": "sha512-46ai7KWL5/Ls/x+gzU908hhpkXzB2SlrAh/07wHkMkGUdpRwYjbjxb8/Yq2WEZ33Sn5s/o9BCO+OkBTCS6Cfmw==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index a3108ea6..7ae176f2 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.0", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.2.2", + "@types/mongodb": "^3.2.3", "@types/mongoose": "^5.5.12", "@types/multer": "^1.3.8", "apidoc": "^0.17.7", From 41d93842f93b008d7903643bf5dd731bc010bef0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 14:34:37 +0000 Subject: [PATCH 111/243] Bump dotenv from 8.0.0 to 8.1.0 Bumps [dotenv](https://github.com/motdotla/dotenv) from 8.0.0 to 8.1.0. - [Release notes](https://github.com/motdotla/dotenv/releases) - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v8.0.0...v8.1.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f23dcaa0..def9f313 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2134,9 +2134,9 @@ } }, "dotenv": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.0.0.tgz", - "integrity": "sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg==" + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz", + "integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==" }, "duplexer3": { "version": "0.1.4", diff --git a/package.json b/package.json index 7ae176f2..cffd6461 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "cors": "^2.8.5", "cryptiles": "^4.1.3", "debug": "~4.1.1", - "dotenv": "^8.0.0", + "dotenv": "^8.1.0", "express": "~4.17.1", "express-validator": "^6.1.1", "express-winston": "^2.6.0", From 1b70bd8bc8636f2c7d4fd97fa132cc9395335bc6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 14:42:22 +0000 Subject: [PATCH 112/243] Bump @types/multer from 1.3.8 to 1.3.9 Bumps [@types/multer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/multer) from 1.3.8 to 1.3.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/multer) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index def9f313..d1563a69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -664,9 +664,9 @@ } }, "@types/multer": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.3.8.tgz", - "integrity": "sha512-q6y8wkcsKTCxaJBvVmL9hdtQ8p3uAex1pP0zi8CKa8uYDzrKzNn2j5/uaOiaIuMDqDZBhNg1rbiF9MyVMbwQ+w==", + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.3.9.tgz", + "integrity": "sha512-aKUwxl4yH87G8b3wgmruBVdOWiG9qqmc4Epjt5Uz3mqaMZwx3dkMm4tHn5nnwBk2NT+X4t5yADJiEv/NfMFQIg==", "dev": true, "requires": { "@types/express": "*" diff --git a/package.json b/package.json index cffd6461..6bb1a9b7 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.2.3", "@types/mongoose": "^5.5.12", - "@types/multer": "^1.3.8", + "@types/multer": "^1.3.9", "apidoc": "^0.17.7", "chai": "^4.2.0", "chai-http": "^4.3.0", From 36277c1bc7fe7125a2682357c87b02404de0d981 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2019 15:07:25 +0000 Subject: [PATCH 113/243] Bump @types/express from 4.17.0 to 4.17.1 Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.0 to 4.17.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1563a69..f0c729b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -541,9 +541,9 @@ } }, "@types/body-parser": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", - "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz", + "integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==", "dev": true, "requires": { "@types/connect": "*", @@ -594,9 +594,9 @@ } }, "@types/express": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.0.tgz", - "integrity": "sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.1.tgz", + "integrity": "sha512-VfH/XCP0QbQk5B5puLqTLEeFgR8lfCJHZJKkInZ9mkYd+u8byX0kztXEQxEk4wZXJs8HI+7km2ALXjn4YKcX9w==", "dev": true, "requires": { "@types/body-parser": "*", @@ -605,9 +605,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.16.7", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.7.tgz", - "integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==", + "version": "4.16.9", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.9.tgz", + "integrity": "sha512-GqpaVWR0DM8FnRUJYKlWgyARoBUAVfRIeVDZQKOttLFp5SmhhF9YFIYeTPwMd/AXfxlP7xVO2dj1fGu0Q+krKQ==", "dev": true, "requires": { "@types/node": "*", @@ -695,9 +695,9 @@ } }, "@types/serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz", + "integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==", "dev": true, "requires": { "@types/express-serve-static-core": "*", diff --git a/package.json b/package.json index 6bb1a9b7..620b1df8 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "winston": "^2.4.4" }, "devDependencies": { - "@types/express": "^4.17.0", + "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.2.3", "@types/mongoose": "^5.5.12", From 5593b7fa40161590677a6b5102c9f91624c1b983 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2019 09:52:53 +0000 Subject: [PATCH 114/243] Bump @types/mongoose from 5.5.12 to 5.5.13 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.12 to 5.5.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0c729b8..33e339b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -654,9 +654,9 @@ } }, "@types/mongoose": { - "version": "5.5.12", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.12.tgz", - "integrity": "sha512-41TDORylr6M9Kytli/Qry28cQjD919+w+jHNR9rca95xH1/joNLUkLg9okKJ1I4mIR6Af28ESjBssed7RKElVA==", + "version": "5.5.13", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.13.tgz", + "integrity": "sha512-k7Kxk5gugsZhkl7euWH1p6lmIdh9W8AsQgX0cO7kaihBie/P3ywU8LFMqo9ey6frdHBlGVaNICTeFZ/pZ6s5Lg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 620b1df8..bdb25e2c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.2.3", - "@types/mongoose": "^5.5.12", + "@types/mongoose": "^5.5.13", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", "chai": "^4.2.0", From f1622ec1783385b96bce558488002c8b70709633 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2019 10:35:44 +0000 Subject: [PATCH 115/243] Bump @types/mongodb from 3.2.3 to 3.3.0 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.2.3 to 3.3.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 33e339b1..88af8d5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -644,9 +644,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.2.3.tgz", - "integrity": "sha512-46ai7KWL5/Ls/x+gzU908hhpkXzB2SlrAh/07wHkMkGUdpRwYjbjxb8/Yq2WEZ33Sn5s/o9BCO+OkBTCS6Cfmw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.0.tgz", + "integrity": "sha512-YMrve0uBOqFDEiezQk3AfWV73g871/rQTAEb8Y2CSlbySnV/2OyerI1DAOUUJQaIqGEWWaYF6GMPO6wTErLUuw==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index bdb25e2c..015e4deb 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.2.3", + "@types/mongodb": "^3.3.0", "@types/mongoose": "^5.5.13", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", From 950fd0c4784ab150d9f5e5d265f62f3217bcadc2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2019 11:00:07 +0000 Subject: [PATCH 116/243] Bump mongoose from 5.6.9 to 5.6.10 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.9 to 5.6.10. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.9...5.6.10) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88af8d5e..035ef498 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5673,9 +5673,9 @@ } }, "mongoose": { - "version": "5.6.9", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.9.tgz", - "integrity": "sha512-NRW5UJSmwyJxK+MRHmq+dQKgZqMZCpW1aPkpBZESqrrgF2J15Flo/4K3RYkSSQY7oKhfbgqZTPo+J1snJ3hJ3w==", + "version": "5.6.10", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.10.tgz", + "integrity": "sha512-lxWvF4Vl2118K2nZTj+QAEEmNBCbmUAcmF/roe8d+68Np4RXKEQvmpqm1c3aIlE9AVMp//eKB8IfXr38ZHe0Zw==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 015e4deb..9d0bbc0e 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.9", + "mongoose": "^5.6.10", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From f449adf807ce292141c3259bc15f87ddc61034a4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2019 19:57:42 +0000 Subject: [PATCH 117/243] Bump @google-cloud/storage from 3.1.0 to 3.2.0 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.1.0...v3.2.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 77 ++++++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 035ef498..663b1167 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,17 +192,17 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.1.0.tgz", - "integrity": "sha512-dKKcMtWpu6Haoh7ricAM+QLAeQSA+ci4AfpRXQZXk8yD0JItYhmTx59ht88cSB+9qIYrfXCnpshsvyF0PJ5N/w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.2.0.tgz", + "integrity": "sha512-vV8MUb9WinJqeX4s+OaZk3PjpB3L8Z5SH7j9rQFtOyMMUiiwrvqtT8AgG2/Egmobbfg5cyXhO/OJrILM17HOGg==", "requires": { - "@google-cloud/common": "^2.1.0", + "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", "@google-cloud/promisify": "^1.0.0", "arrify": "^2.0.0", "compressible": "^2.0.12", "concat-stream": "^2.0.0", - "date-and-time": "^0.8.0", + "date-and-time": "^0.9.0", "duplexify": "^3.5.0", "extend": "^3.0.2", "gaxios": "^2.0.1", @@ -220,9 +220,9 @@ }, "dependencies": { "@google-cloud/common": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.1.0.tgz", - "integrity": "sha512-ynTowaTPL36CYywI86EqAspNzVttTCxT7ft8W65/EUR8aFdKUhgZaSJUIhYLt7lnkAg5uL7iE/CYa457m1wTRQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.1.2.tgz", + "integrity": "sha512-VAjWRrTEgcGujj/MgTTAtjjzeDoQqs/FDT6DG7004QFZoJsSwBmx2vGpI5TJmCuxLWvhEc0Xs5AMOvhgt7FLSw==", "requires": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", @@ -232,7 +232,7 @@ "extend": "^3.0.2", "google-auth-library": "^5.0.0", "retry-request": "^4.0.0", - "teeny-request": "^5.1.1" + "teeny-request": "^5.2.1" } }, "@google-cloud/paginator": { @@ -343,9 +343,9 @@ "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "requires": { "p-try": "^2.0.0" } @@ -1897,9 +1897,9 @@ } }, "date-and-time": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.8.1.tgz", - "integrity": "sha512-p1d0c3HE7bJK4m3/TcNx7EFZcq0Jyvl05TWeESfC5FsJQVRlUrYAL7rB7NEPogx9C3rKsOZJn9PELYo9jVT7mw==" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.9.0.tgz", + "integrity": "sha512-4JybB6PbR+EebpFx/KyR5Ybl+TcdXMLIJkyYsCx3P4M4CWGMuDyFF19yh6TyasMAIF5lrsgIxiSHBXh2FFc7Fg==" }, "date-now": { "version": "0.1.4", @@ -3336,9 +3336,9 @@ } }, "gcs-resumable-upload": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.3.tgz", - "integrity": "sha512-LNmrW+Yel0gbqZ5NZMMXJTH74SS6nGUP9Uca4pPY9bRIYDHJ5/TFAAaHsxCWf8+tid/4eIdNevrv9PDjPTPTeg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.4.tgz", + "integrity": "sha512-UqoGRLImof+6DRv/7QnMGP3ot+RKhsIS2dVziGFe+ajFDW0cnit7xYyViFA99utDQB0RD+fSqKBkYwNXX3Y42w==", "requires": { "abort-controller": "^3.0.0", "configstore": "^5.0.0", @@ -4349,6 +4349,25 @@ "toidentifier": "1.0.0" } }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "requires": { + "agent-base": "4", + "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -7298,19 +7317,29 @@ } }, "teeny-request": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.1.3.tgz", - "integrity": "sha512-9bQzdndkpo4aga33bq/MGWAMJswFw02V2969hoe9PqgJUthOmOcZxtGiIPZXyaJEuNQ1aeVQyYO2Htm2CoDrkA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.2.1.tgz", + "integrity": "sha512-gCVm5EV3z0p/yZOKyeBOFOpSXuxdIs3foeWDWb/foKMBejK18w40L0k0UMd/ZrGkOH+gxodjqpL8KK6x3haYCQ==", "requires": { + "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.1", "node-fetch": "^2.2.0", + "stream-events": "^1.0.5", "uuid": "^3.3.2" }, "dependencies": { + "stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "requires": { + "stubs": "^3.0.0" + } + }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" } } }, diff --git a/package.json b/package.json index 9d0bbc0e..8859cb40 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.1.0", + "@google-cloud/storage": "^3.2.0", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From f37759aa11d5b904d70436d34eba14e40ff02dc1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2019 12:36:03 +0000 Subject: [PATCH 118/243] Bump mongoose from 5.6.10 to 5.6.11 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.10 to 5.6.11. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.10...5.6.11) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 663b1167..b4d7e951 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4964,9 +4964,9 @@ } }, "kareem": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz", - "integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz", + "integrity": "sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw==" }, "keygrip": { "version": "1.0.2", @@ -5692,13 +5692,13 @@ } }, "mongoose": { - "version": "5.6.10", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.10.tgz", - "integrity": "sha512-lxWvF4Vl2118K2nZTj+QAEEmNBCbmUAcmF/roe8d+68Np4RXKEQvmpqm1c3aIlE9AVMp//eKB8IfXr38ZHe0Zw==", + "version": "5.6.11", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.11.tgz", + "integrity": "sha512-+Mxfmu2Jcspmdqk1111BLUj5mzSLHWKVovImkjzO9GMymTwkHshsuSFmUN7ou4dWy2WR8DPSJcwU52HhnnNk8Q==", "requires": { "async": "2.6.2", "bson": "~1.1.1", - "kareem": "2.3.0", + "kareem": "2.3.1", "mongodb": "3.2.7", "mongodb-core": "3.2.7", "mongoose-legacy-pluralize": "1.0.2", diff --git a/package.json b/package.json index 8859cb40..6ad6a4c0 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.10", + "mongoose": "^5.6.11", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 6137159d9d255a3c2bf11eafd512dde61aa85896 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2019 18:15:47 +0000 Subject: [PATCH 119/243] Bump @types/mongodb from 3.3.0 to 3.3.1 Bumps [@types/mongodb](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongodb) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongodb) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b4d7e951..9fad9c7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -644,9 +644,9 @@ "dev": true }, "@types/mongodb": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.0.tgz", - "integrity": "sha512-YMrve0uBOqFDEiezQk3AfWV73g871/rQTAEb8Y2CSlbySnV/2OyerI1DAOUUJQaIqGEWWaYF6GMPO6wTErLUuw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.3.1.tgz", + "integrity": "sha512-Va7o1fN3zeabmIJSQ6yuAWkqPvrT38HSTIi4YbVOb2UL7FJ4diXrWt+OUuuEFWAVPtF9VZV5h+7LDYdzgXWgQA==", "dev": true, "requires": { "@types/bson": "*", diff --git a/package.json b/package.json index 6ad6a4c0..f24d7924 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.3.0", + "@types/mongodb": "^3.3.1", "@types/mongoose": "^5.5.13", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", From af8ab8eaaadface524cfcd3e7fa1e690072e30f7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2019 23:20:03 +0000 Subject: [PATCH 120/243] Bump @types/mongoose from 5.5.13 to 5.5.14 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.13 to 5.5.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9fad9c7d..9e387397 100644 --- a/package-lock.json +++ b/package-lock.json @@ -654,9 +654,9 @@ } }, "@types/mongoose": { - "version": "5.5.13", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.13.tgz", - "integrity": "sha512-k7Kxk5gugsZhkl7euWH1p6lmIdh9W8AsQgX0cO7kaihBie/P3ywU8LFMqo9ey6frdHBlGVaNICTeFZ/pZ6s5Lg==", + "version": "5.5.14", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.14.tgz", + "integrity": "sha512-3oGUzBL73wfPvJ2HYm8lbjKkv9kKkVCZT5Dsg3rbjPRB8nI1xbXyOZfZDBE0a7Ib4sqYuhHx6diQe++Rs6UJRg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index f24d7924..cff86df3 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.13", + "@types/mongoose": "^5.5.14", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", "chai": "^4.2.0", From f09dcf9163bb730fe67eb2cf4a4c14835119e693 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2019 16:58:23 +0000 Subject: [PATCH 121/243] Bump @google-cloud/storage from 3.2.0 to 3.2.1 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.2.0...v3.2.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 30 +++++++++++++++--------------- package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e387397..b881f29d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.2.0.tgz", - "integrity": "sha512-vV8MUb9WinJqeX4s+OaZk3PjpB3L8Z5SH7j9rQFtOyMMUiiwrvqtT8AgG2/Egmobbfg5cyXhO/OJrILM17HOGg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.2.1.tgz", + "integrity": "sha512-129EwPGej6bXzY1u5nja2aeMDew6DIHaJn7ZV6nteQ74LQQSNv2jKrqTlyhndBsAwpuwQAxeghPTCoFT/H8Frg==", "requires": { "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", @@ -236,12 +236,12 @@ } }, "@google-cloud/paginator": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.0.tgz", - "integrity": "sha512-droVsitvSUGSoMV7Hbk2B5dCFkZIz9YNu3D1AxgFh+hmbSEWJ9SgB/M3WrU8CUx3pseH7IbLuq8jgs3HEFzeHw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.1.tgz", + "integrity": "sha512-HZ6UTGY/gHGNriD7OCikYWL/Eu0sTEur2qqse2w6OVsz+57se3nTkqH14JIPxtf0vlEJ8IJN5w3BdZ22pjCB8g==", "requires": { "arrify": "^2.0.0", - "extend": "^3.0.1" + "extend": "^3.0.2" } }, "@google-cloud/projectify": { @@ -282,11 +282,11 @@ } }, "gcp-metadata": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.1.tgz", - "integrity": "sha512-nrbLj5O1MurvpLC/doFwzdTfKnmYGDYXlY/v7eQ4tJNVIvQXbOK672J9UFbradbtmuTkyHzjpzD8HD0Djz0LWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.2.tgz", + "integrity": "sha512-dxPXBvjyfz5qFEBXzEwNmuZXwsGYfuASGYeg3CKZDaQRXdiWti9J3/Ezmtyon1OrCNpDO2YekyoSjEqMtsrcXw==", "requires": { - "gaxios": "^2.0.0", + "gaxios": "^2.0.1", "json-bigint": "^0.3.0" } }, @@ -3402,11 +3402,11 @@ } }, "gcp-metadata": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.1.tgz", - "integrity": "sha512-nrbLj5O1MurvpLC/doFwzdTfKnmYGDYXlY/v7eQ4tJNVIvQXbOK672J9UFbradbtmuTkyHzjpzD8HD0Djz0LWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.2.tgz", + "integrity": "sha512-dxPXBvjyfz5qFEBXzEwNmuZXwsGYfuASGYeg3CKZDaQRXdiWti9J3/Ezmtyon1OrCNpDO2YekyoSjEqMtsrcXw==", "requires": { - "gaxios": "^2.0.0", + "gaxios": "^2.0.1", "json-bigint": "^0.3.0" } }, diff --git a/package.json b/package.json index cff86df3..2946c81b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.2.0", + "@google-cloud/storage": "^3.2.1", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 0070f552a44d893a0f6b817d7287f84ee0280ca2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2019 17:22:17 +0000 Subject: [PATCH 122/243] Bump @types/mongoose from 5.5.13 to 5.5.15 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.13 to 5.5.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b881f29d..d460f141 100644 --- a/package-lock.json +++ b/package-lock.json @@ -654,9 +654,9 @@ } }, "@types/mongoose": { - "version": "5.5.14", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.14.tgz", - "integrity": "sha512-3oGUzBL73wfPvJ2HYm8lbjKkv9kKkVCZT5Dsg3rbjPRB8nI1xbXyOZfZDBE0a7Ib4sqYuhHx6diQe++Rs6UJRg==", + "version": "5.5.15", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.15.tgz", + "integrity": "sha512-LgUHpGl6mmcyzjZR/afUZ7mDPjDd38mA0HCf8vL11otVKiNGyu7ug8z3ePx2QAqcPrxbtfaJVgirdBeNXYG54Q==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 2946c81b..249e0120 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.14", + "@types/mongoose": "^5.5.15", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", "chai": "^4.2.0", From e2100158b352eec6726e427b616d04ae73d5f0ec Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2019 13:58:27 +0000 Subject: [PATCH 123/243] Bump express-validator from 6.1.1 to 6.2.0 Bumps [express-validator](https://github.com/express-validator/express-validator) from 6.1.1 to 6.2.0. - [Release notes](https://github.com/express-validator/express-validator/releases) - [Commits](https://github.com/express-validator/express-validator/compare/v6.1.1...v6.2.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 17 ++++++++++++----- package.json | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d460f141..85ccaf91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2444,12 +2444,19 @@ } }, "express-validator": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.1.1.tgz", - "integrity": "sha512-AF6YOhdDiCU7tUOO/OHp2W++I3qpYX7EInMmEEcRGOjs+qoubwgc5s6Wo3OQgxwsWRGCxXlrF73SIDEmY4y3wg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.2.0.tgz", + "integrity": "sha512-892cPistoSPzMuoG2p1W+2ZxBi0bAvPaaYgXK1E1C8/QncLo2d1HbiDDWkXUtTthjGEzEmwiELLJHu1Ez2hOEg==", "requires": { - "lodash": "^4.17.11", - "validator": "^11.0.0" + "lodash": "^4.17.15", + "validator": "^11.1.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + } } }, "express-winston": { diff --git a/package.json b/package.json index 249e0120..8711b8fd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "debug": "~4.1.1", "dotenv": "^8.1.0", "express": "~4.17.1", - "express-validator": "^6.1.1", + "express-validator": "^6.2.0", "express-winston": "^2.6.0", "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", From 774037e8be216bcdebf8e806fedd8ceac8e0f0e5 Mon Sep 17 00:00:00 2001 From: Tyrone Wong Date: Fri, 21 Jun 2019 01:42:35 -0400 Subject: [PATCH 124/243] Created service for parse patch to address #280 --- services/parsePatch.service.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 services/parsePatch.service.js diff --git a/services/parsePatch.service.js b/services/parsePatch.service.js new file mode 100644 index 00000000..838e87f2 --- /dev/null +++ b/services/parsePatch.service.js @@ -0,0 +1,18 @@ +"use strict"; +const mongoose = require("mongoose"); + +function parsePatch(req, res, next, model) { + let modelDetails = {}; + for (const val in req.body) { + if (model.schema.paths.hasOwnProperty(val)) { + modelDetails[val] = req.body[val]; + delete req.body[val]; + } + } + req.body.modelDetails = modelDetails; + return next(); +} + +module.exports = { + parsePatch: parsePatch +}; From b7a6e3473ef9cc672953c1b0489c22637b91aa4a Mon Sep 17 00:00:00 2001 From: Tyrone Wong Date: Sun, 1 Sep 2019 23:28:19 -0400 Subject: [PATCH 125/243] Added closures to the parsePatch service --- services/parsePatch.service.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/services/parsePatch.service.js b/services/parsePatch.service.js index 838e87f2..b4ae1bc5 100644 --- a/services/parsePatch.service.js +++ b/services/parsePatch.service.js @@ -1,18 +1,21 @@ "use strict"; const mongoose = require("mongoose"); -function parsePatch(req, res, next, model) { - let modelDetails = {}; - for (const val in req.body) { - if (model.schema.paths.hasOwnProperty(val)) { - modelDetails[val] = req.body[val]; - delete req.body[val]; - } - } - req.body.modelDetails = modelDetails; - return next(); -} - module.exports = { - parsePatch: parsePatch + parsePatch: function(req, model, done) { + setMatchingAttributes(model).then(() => { + done(); + }); + } }; + +async function setMatchingAttributes(model) { + let modelDetails = {}; + for (const val in req.body) { + if (model.schema.paths.hasOwnProperty(val)) { + modelDetails[val] = req.body[val]; + delete req.body[val]; + } + } + req.body.modelDetails = modelDetails; +} From 095784446cbb4ee1e1e58687d42e300126c1a5ff Mon Sep 17 00:00:00 2001 From: Tyrone Wong Date: Mon, 2 Sep 2019 00:00:28 -0400 Subject: [PATCH 126/243] Revert "Bump express-validator from 6.1.1 to 6.2.0" This reverts commit e2100158b352eec6726e427b616d04ae73d5f0ec. --- package-lock.json | 17 +++++------------ package.json | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85ccaf91..d460f141 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2444,19 +2444,12 @@ } }, "express-validator": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.2.0.tgz", - "integrity": "sha512-892cPistoSPzMuoG2p1W+2ZxBi0bAvPaaYgXK1E1C8/QncLo2d1HbiDDWkXUtTthjGEzEmwiELLJHu1Ez2hOEg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.1.1.tgz", + "integrity": "sha512-AF6YOhdDiCU7tUOO/OHp2W++I3qpYX7EInMmEEcRGOjs+qoubwgc5s6Wo3OQgxwsWRGCxXlrF73SIDEmY4y3wg==", "requires": { - "lodash": "^4.17.15", - "validator": "^11.1.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - } + "lodash": "^4.17.11", + "validator": "^11.0.0" } }, "express-winston": { diff --git a/package.json b/package.json index 8711b8fd..249e0120 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "debug": "~4.1.1", "dotenv": "^8.1.0", "express": "~4.17.1", - "express-validator": "^6.2.0", + "express-validator": "^6.1.1", "express-winston": "^2.6.0", "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", From bd2bf9069c5c6b079dcbc3d561194af7b5e593cc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2019 12:44:25 +0000 Subject: [PATCH 127/243] Bump express-validator from 6.1.1 to 6.2.0 Bumps [express-validator](https://github.com/express-validator/express-validator) from 6.1.1 to 6.2.0. - [Release notes](https://github.com/express-validator/express-validator/releases) - [Commits](https://github.com/express-validator/express-validator/compare/v6.1.1...v6.2.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 17 ++++++++++++----- package.json | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d460f141..85ccaf91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2444,12 +2444,19 @@ } }, "express-validator": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.1.1.tgz", - "integrity": "sha512-AF6YOhdDiCU7tUOO/OHp2W++I3qpYX7EInMmEEcRGOjs+qoubwgc5s6Wo3OQgxwsWRGCxXlrF73SIDEmY4y3wg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/express-validator/-/express-validator-6.2.0.tgz", + "integrity": "sha512-892cPistoSPzMuoG2p1W+2ZxBi0bAvPaaYgXK1E1C8/QncLo2d1HbiDDWkXUtTthjGEzEmwiELLJHu1Ez2hOEg==", "requires": { - "lodash": "^4.17.11", - "validator": "^11.0.0" + "lodash": "^4.17.15", + "validator": "^11.1.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + } } }, "express-winston": { diff --git a/package.json b/package.json index 249e0120..8711b8fd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "debug": "~4.1.1", "dotenv": "^8.1.0", "express": "~4.17.1", - "express-validator": "^6.1.1", + "express-validator": "^6.2.0", "express-winston": "^2.6.0", "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", From a49f879cecc2a0d12b50c3a54affac0fb75a18de Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2019 11:37:18 +0000 Subject: [PATCH 128/243] Bump nodemon from 1.19.1 to 1.19.2 Bumps [nodemon](https://github.com/remy/nodemon) from 1.19.1 to 1.19.2. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v1.19.1...v1.19.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 30 +++++++++++++++--------------- package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85ccaf91..9641f934 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1502,9 +1502,9 @@ "dev": true }, "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -5196,9 +5196,9 @@ } }, "make-dir": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", - "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "^3.0.0" @@ -5902,9 +5902,9 @@ } }, "nodemon": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.1.tgz", - "integrity": "sha512-/DXLzd/GhiaDXXbGId5BzxP1GlsqtMGM9zTmkWrgXtSqjKmGSbLicM/oAy4FR0YWm14jCHRwnR31AHS2dYFHrg==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.2.tgz", + "integrity": "sha512-hRLYaw5Ihyw9zK7NF+9EUzVyS6Cvgc14yh8CAYr38tPxJa6UrOxwAQ351GwrgoanHCF0FalQFn6w5eoX/LGdJw==", "dev": true, "requires": { "chokidar": "^2.1.5", @@ -7657,9 +7657,9 @@ "dev": true }, "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, "update-notifier": { @@ -7889,9 +7889,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "dev": true, "requires": { "graceful-fs": "^4.1.11", diff --git a/package.json b/package.json index 8711b8fd..6159db84 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.2.0", - "nodemon": "^1.19.1" + "nodemon": "^1.19.2" } } From c567306fa92248bcc8e45cc711f51f2b1ad93ff5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2019 18:44:46 +0000 Subject: [PATCH 129/243] Bump mongoose from 5.6.11 to 5.6.12 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.11 to 5.6.12. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.11...5.6.12) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9641f934..2bd4430a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5699,9 +5699,9 @@ } }, "mongoose": { - "version": "5.6.11", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.11.tgz", - "integrity": "sha512-+Mxfmu2Jcspmdqk1111BLUj5mzSLHWKVovImkjzO9GMymTwkHshsuSFmUN7ou4dWy2WR8DPSJcwU52HhnnNk8Q==", + "version": "5.6.12", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.12.tgz", + "integrity": "sha512-1E/wEGw1widyblhrLUBEOatm1COS0jyks0tKBiuvjPoncty4Msbk0X1EZWUxFtkZuhlbXeILJPYlKBDzxFmPfg==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 6159db84..85882c55 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.1.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.11", + "mongoose": "^5.6.12", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 1f37219501bb6b26c04aabf981323b9d15ae8d4e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2019 20:03:50 +0000 Subject: [PATCH 130/243] Bump handlebars from 4.1.2 to 4.2.0 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.2.0. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.2.0/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.2.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2bd4430a..ebd463b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.0.tgz", + "integrity": "sha512-Kb4xn5Qh1cxAKvQnzNWZ512DhABzyFNmsaJf3OAkWNa4NkaqWcNI8Tao8Tasi0/F4JD9oyG0YxuFyvyR57d+Gw==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", @@ -5835,9 +5835,9 @@ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" }, "nice-try": { "version": "1.0.5", @@ -7541,9 +7541,9 @@ "dev": true }, "uglify-js": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.4.tgz", - "integrity": "sha512-GpKo28q/7Bm5BcX9vOu4S46FwisbPbAmkkqPnGIpKvKTM96I85N6XHQV+k4I6FA2wxgLhcsSyHoNhzucwCflvA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "optional": true, "requires": { "commander": "~2.20.0", diff --git a/package.json b/package.json index 85882c55..28973ac1 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.1.2", + "handlebars": "^4.2.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.6.12", From eb7878a1f448bba03529bea060b540cd02774bd2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2019 13:43:26 +0000 Subject: [PATCH 131/243] Bump @types/mongoose from 5.5.15 to 5.5.17 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.15 to 5.5.17. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ebd463b3..c675b80e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -654,9 +654,9 @@ } }, "@types/mongoose": { - "version": "5.5.15", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.15.tgz", - "integrity": "sha512-LgUHpGl6mmcyzjZR/afUZ7mDPjDd38mA0HCf8vL11otVKiNGyu7ug8z3ePx2QAqcPrxbtfaJVgirdBeNXYG54Q==", + "version": "5.5.17", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.17.tgz", + "integrity": "sha512-Nv7Fmun31np7YpNw9s2Aib+bqErDeO2QQZgtl4zUJSwY4Fyp+UDYV/nWANEbKMFU0fkQ3aNbnkODziL1YtSdbg==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 28973ac1..38a3947e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.15", + "@types/mongoose": "^5.5.17", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", "chai": "^4.2.0", From 70cb77571f294c51b772a12cc1a5df9c389d3e9b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2019 02:08:31 +0000 Subject: [PATCH 132/243] Bump mongoose from 5.6.12 to 5.6.13 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.12 to 5.6.13. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.12...5.6.13) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c675b80e..f60b80b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5699,9 +5699,9 @@ } }, "mongoose": { - "version": "5.6.12", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.12.tgz", - "integrity": "sha512-1E/wEGw1widyblhrLUBEOatm1COS0jyks0tKBiuvjPoncty4Msbk0X1EZWUxFtkZuhlbXeILJPYlKBDzxFmPfg==", + "version": "5.6.13", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.13.tgz", + "integrity": "sha512-MGV2qSED8JFFwRXtR8ETxLRSaF15u5rAJQ0ejmp7/Z0gy6wFit32pKBQKvuEuYRoNYQmSsctUDngFnOByNPH4g==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 38a3947e..856148f4 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.2.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.12", + "mongoose": "^5.6.13", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 066a3fbfcbfe356fe27f79b3af18984b8f0b82b3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2019 20:16:50 +0000 Subject: [PATCH 133/243] Bump mongoose from 5.6.13 to 5.7.0 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.6.13 to 5.7.0. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.6.13...5.7.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 58 +++++++---------------------------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index f60b80b0..95e31595 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5281,12 +5281,6 @@ "resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz", "integrity": "sha1-eJCwHVLADI68nVM+H46xfjA0hxo=" }, - "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 - }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -5665,30 +5659,13 @@ } }, "mongodb": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.2.7.tgz", - "integrity": "sha512-2YdWrdf1PJgxcCrT1tWoL6nHuk6hCxhddAAaEh8QJL231ci4+P9FLyqopbTm2Z2sAU6mhCri+wd9r1hOcHdoMw==", - "requires": { - "mongodb-core": "3.2.7", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" - } - } - }, - "mongodb-core": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.2.7.tgz", - "integrity": "sha512-WypKdLxFNPOH/Jy6i9z47IjG2wIldA54iDZBmHMINcgKOUcWJh8og+Wix76oGd7EyYkHJKssQ2FAOw5Su/n4XQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.3.2.tgz", + "integrity": "sha512-fqJt3iywelk4yKu/lfwQg163Bjpo5zDKhXiohycvon4iQHbrfflSAz9AIlRE6496Pm/dQKQK5bMigdVo2s6gBg==", "requires": { "bson": "^1.1.1", "require_optional": "^1.0.1", - "safe-buffer": "^5.1.2", - "saslprep": "^1.0.0" + "safe-buffer": "^5.1.2" }, "dependencies": { "safe-buffer": { @@ -5699,15 +5676,14 @@ } }, "mongoose": { - "version": "5.6.13", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.6.13.tgz", - "integrity": "sha512-MGV2qSED8JFFwRXtR8ETxLRSaF15u5rAJQ0ejmp7/Z0gy6wFit32pKBQKvuEuYRoNYQmSsctUDngFnOByNPH4g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.0.tgz", + "integrity": "sha512-nE43r4kEUpUBfr32rf+zJKEtzd6I3F5YdbrSHp/DDdVQyej34Cv7gfBdcoRNehrPQDV3khOh0JpiS1aLN9/OCw==", "requires": { "async": "2.6.2", "bson": "~1.1.1", "kareem": "2.3.1", - "mongodb": "3.2.7", - "mongodb-core": "3.2.7", + "mongodb": "3.3.2", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.6.0", "mquery": "3.2.1", @@ -6788,15 +6764,6 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "saslprep": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", - "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", - "optional": true, - "requires": { - "sparse-bitfield": "^3.0.3" - } - }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -7115,15 +7082,6 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, - "sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", - "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", - "optional": true, - "requires": { - "memory-pager": "^1.0.2" - } - }, "split-array-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/split-array-stream/-/split-array-stream-2.0.0.tgz", diff --git a/package.json b/package.json index 856148f4..09681bbf 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.2.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.6.13", + "mongoose": "^5.7.0", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 8450c57f7387be96cda89a4351950a6787782c8f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2019 16:51:29 +0000 Subject: [PATCH 134/243] Bump mongoose from 5.7.0 to 5.7.1 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.7.0 to 5.7.1. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.7.0...5.7.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95e31595..53ce4a1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5676,9 +5676,9 @@ } }, "mongoose": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.0.tgz", - "integrity": "sha512-nE43r4kEUpUBfr32rf+zJKEtzd6I3F5YdbrSHp/DDdVQyej34Cv7gfBdcoRNehrPQDV3khOh0JpiS1aLN9/OCw==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.1.tgz", + "integrity": "sha512-TJeZHb5h8UGH++ctngh2shgZuZmR9o0D8elxfkWzIpKB6QAFsJPmALtDuD6RYZTS33+CifhDdAMGqs3OpJ3cyQ==", "requires": { "async": "2.6.2", "bson": "~1.1.1", diff --git a/package.json b/package.json index 09681bbf..c7c62157 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.2.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.7.0", + "mongoose": "^5.7.1", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 65a73f678901e7f0c23bac04d449b1e77eae87c7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2019 16:19:09 +0000 Subject: [PATCH 135/243] Bump qrcode from 1.4.1 to 1.4.2 Bumps [qrcode](https://github.com/soldair/node-qrcode) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/soldair/node-qrcode/releases) - [Changelog](https://github.com/soldair/node-qrcode/blob/master/CHANGELOG.md) - [Commits](https://github.com/soldair/node-qrcode/compare/v1.4.1...v1.4.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 22 +++++----------------- package.json | 2 +- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53ce4a1e..74d37c4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3550,8 +3550,7 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-func-name": { "version": "2.0.0", @@ -6374,9 +6373,9 @@ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, "qrcode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.4.1.tgz", - "integrity": "sha512-3JhHQJkKqJL4PfoM6t+B40f0GWv9eNJAJmuNx2X/sHEOLvMyvEPN8GfbdN1qmr19O8N2nLraOzeWjXocHz1S4w==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.4.2.tgz", + "integrity": "sha512-eR6RgxFYPDFH+zFLTJKtoNP/RlsHANQb52AUmQ2bGDPMuUw7jJb0F+DNEgx7qQGIElrbFxWYMc0/B91zLZPF9Q==", "requires": { "dijkstrajs": "^1.0.1", "isarray": "^2.0.1", @@ -6412,11 +6411,6 @@ "wrap-ansi": "^5.1.0" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -6427,11 +6421,6 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -6685,8 +6674,7 @@ "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "require_optional": { "version": "1.0.1", diff --git a/package.json b/package.json index c7c62157..b9e34968 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "passport": "^0.4.0", "passport-local": "^1.0.0", "q": "^1.5.1", - "qrcode": "^1.4.1", + "qrcode": "^1.4.2", "winston": "^2.4.4" }, "devDependencies": { From 3875b819414461b3ceba9fa6160c857f3dd2012a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2019 16:19:54 +0000 Subject: [PATCH 136/243] Bump @google-cloud/storage from 3.2.1 to 3.3.0 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.2.1 to 3.3.0. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.2.1...v3.3.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 91 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index 74d37c4e..740e98b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.2.1.tgz", - "integrity": "sha512-129EwPGej6bXzY1u5nja2aeMDew6DIHaJn7ZV6nteQ74LQQSNv2jKrqTlyhndBsAwpuwQAxeghPTCoFT/H8Frg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.3.0.tgz", + "integrity": "sha512-9jmHJ0ncQTcrZRwq5MRjXEwuCFkIjHenYwVbycV6bbZ4O84Hcgg4Yp33sKcJug5rvZeVgrpCzPbYXqO3B0LzJw==", "requires": { "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", @@ -202,17 +202,18 @@ "arrify": "^2.0.0", "compressible": "^2.0.12", "concat-stream": "^2.0.0", - "date-and-time": "^0.9.0", + "date-and-time": "^0.10.0", "duplexify": "^3.5.0", "extend": "^3.0.2", "gaxios": "^2.0.1", - "gcs-resumable-upload": "^2.0.0", + "gcs-resumable-upload": "^2.2.4", "hash-stream-validation": "^0.2.1", "mime": "^2.2.0", "mime-types": "^2.0.8", "onetime": "^5.1.0", "p-limit": "^2.2.0", "pumpify": "^2.0.0", + "readable-stream": "^3.4.0", "snakeize": "^0.1.0", "stream-events": "^1.0.1", "through2": "^3.0.0", @@ -220,9 +221,9 @@ }, "dependencies": { "@google-cloud/common": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.1.2.tgz", - "integrity": "sha512-VAjWRrTEgcGujj/MgTTAtjjzeDoQqs/FDT6DG7004QFZoJsSwBmx2vGpI5TJmCuxLWvhEc0Xs5AMOvhgt7FLSw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.2.2.tgz", + "integrity": "sha512-AgMdDgLeYlEG17tXtMCowE7mplm907pcugtfJYYAp06HNe9RDnunUIY5KMnn9yikYl7NXNofARC+hwG77Zsa4g==", "requires": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", @@ -282,35 +283,35 @@ } }, "gcp-metadata": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.2.tgz", - "integrity": "sha512-dxPXBvjyfz5qFEBXzEwNmuZXwsGYfuASGYeg3CKZDaQRXdiWti9J3/Ezmtyon1OrCNpDO2YekyoSjEqMtsrcXw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.0.0.tgz", + "integrity": "sha512-WP5/TZWri9TrD41jNr8ukY9dKYLL+8jwQVwbtUbmprjWuyybdnJNkbXbwqD2sdbXIVXD1WCqzfj7QftSLB6K8Q==", "requires": { "gaxios": "^2.0.1", "json-bigint": "^0.3.0" } }, "google-auth-library": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.0.tgz", - "integrity": "sha512-I2726rgOedQ06HgTvoNvBeRCzy5iFe6z3khwj6ugfRd1b0VHwnTYKl/3t2ytOTo7kKc6KivYIBsCIdZf2ep67g==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.2.tgz", + "integrity": "sha512-0vzniXbjD5SE9aenAMqhjVR99wvqLpyd5Fw6zC3WxJ15GIMGx96tq+Cu1WRviqsnQqhrmnad6T69kv6qkj/w2Q==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", - "gcp-metadata": "^2.0.0", + "gcp-metadata": "^3.0.0", "gtoken": "^4.0.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" } }, "google-p12-pem": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.1.tgz", - "integrity": "sha512-6h6x+eBX3k+IDSe/c8dVYmn8Mzr1mUcmKC9MdUSwaBkFAXlqBEnwFWmSFgGC+tcqtsLn73BDP/vUNWEehf1Rww==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.2.tgz", + "integrity": "sha512-UfnEARfJKI6pbmC1hfFFm+UAcZxeIwTiEcHfqKe/drMsXD/ilnVjF7zgOGpHXyhuvX6jNJK3S8A0hOQjwtFxEw==", "requires": { - "node-forge": "^0.8.0" + "node-forge": "^0.9.0" } }, "gtoken": { @@ -338,9 +339,9 @@ "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "node-forge": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.5.tgz", - "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", + "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" }, "p-limit": { "version": "2.2.1", @@ -1684,9 +1685,9 @@ }, "dependencies": { "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + "version": "1.41.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.41.0.tgz", + "integrity": "sha512-B5gxBI+2K431XW8C2rcc/lhppbuji67nf9v39eH8pkWoZDxnAL0PxdpH32KYRScniF8qDHBDlI+ipgg5WrCUYw==" } } }, @@ -1897,9 +1898,9 @@ } }, "date-and-time": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.9.0.tgz", - "integrity": "sha512-4JybB6PbR+EebpFx/KyR5Ybl+TcdXMLIJkyYsCx3P4M4CWGMuDyFF19yh6TyasMAIF5lrsgIxiSHBXh2FFc7Fg==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/date-and-time/-/date-and-time-0.10.0.tgz", + "integrity": "sha512-IbIzxtvK80JZOVsWF6+NOjunTaoFVYxkAQoyzmflJyuRCJAJebehy48mPiCAedcGp4P7/UO3QYRWa0fe6INftg==" }, "date-now": { "version": "0.1.4", @@ -3343,9 +3344,9 @@ } }, "gcs-resumable-upload": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.4.tgz", - "integrity": "sha512-UqoGRLImof+6DRv/7QnMGP3ot+RKhsIS2dVziGFe+ajFDW0cnit7xYyViFA99utDQB0RD+fSqKBkYwNXX3Y42w==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.5.tgz", + "integrity": "sha512-r98Hnxza8oYT21MzpziAB2thz3AURGz54+osWtczxGNxH7Fodb0HVUEtfqTwBS5vcf9RnKwR7c0EMaI8R39feg==", "requires": { "abort-controller": "^3.0.0", "configstore": "^5.0.0", @@ -3409,35 +3410,35 @@ } }, "gcp-metadata": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-2.0.2.tgz", - "integrity": "sha512-dxPXBvjyfz5qFEBXzEwNmuZXwsGYfuASGYeg3CKZDaQRXdiWti9J3/Ezmtyon1OrCNpDO2YekyoSjEqMtsrcXw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.0.0.tgz", + "integrity": "sha512-WP5/TZWri9TrD41jNr8ukY9dKYLL+8jwQVwbtUbmprjWuyybdnJNkbXbwqD2sdbXIVXD1WCqzfj7QftSLB6K8Q==", "requires": { "gaxios": "^2.0.1", "json-bigint": "^0.3.0" } }, "google-auth-library": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.0.tgz", - "integrity": "sha512-I2726rgOedQ06HgTvoNvBeRCzy5iFe6z3khwj6ugfRd1b0VHwnTYKl/3t2ytOTo7kKc6KivYIBsCIdZf2ep67g==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.2.tgz", + "integrity": "sha512-0vzniXbjD5SE9aenAMqhjVR99wvqLpyd5Fw6zC3WxJ15GIMGx96tq+Cu1WRviqsnQqhrmnad6T69kv6qkj/w2Q==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", - "gcp-metadata": "^2.0.0", + "gcp-metadata": "^3.0.0", "gtoken": "^4.0.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" } }, "google-p12-pem": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.1.tgz", - "integrity": "sha512-6h6x+eBX3k+IDSe/c8dVYmn8Mzr1mUcmKC9MdUSwaBkFAXlqBEnwFWmSFgGC+tcqtsLn73BDP/vUNWEehf1Rww==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.2.tgz", + "integrity": "sha512-UfnEARfJKI6pbmC1hfFFm+UAcZxeIwTiEcHfqKe/drMsXD/ilnVjF7zgOGpHXyhuvX6jNJK3S8A0hOQjwtFxEw==", "requires": { - "node-forge": "^0.8.0" + "node-forge": "^0.9.0" } }, "gtoken": { @@ -3478,9 +3479,9 @@ "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "node-forge": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.8.5.tgz", - "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", + "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" }, "pump": { "version": "3.0.0", diff --git a/package.json b/package.json index b9e34968..6efc23f7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.2.1", + "@google-cloud/storage": "^3.3.0", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 3c0294723188c5c71f425ebb34ee4411a93ff786 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2019 17:45:30 +0000 Subject: [PATCH 137/243] Bump handlebars from 4.2.0 to 4.2.1 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.2.1/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.2.0...v4.2.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 740e98b2..b8e21a3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.0.tgz", - "integrity": "sha512-Kb4xn5Qh1cxAKvQnzNWZ512DhABzyFNmsaJf3OAkWNa4NkaqWcNI8Tao8Tasi0/F4JD9oyG0YxuFyvyR57d+Gw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.1.tgz", + "integrity": "sha512-bqPIlDk06UWbVEIFoYj+LVo42WhK96J+b25l7hbFDpxrOXMphFM3fNIm+cluwg4Pk2jiLjWU5nHQY7igGE75NQ==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 6efc23f7..1aa08137 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.2.0", + "handlebars": "^4.2.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From 9d8e264c5c26f88ec3eef48c95e822d75cad2871 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 08:47:59 +0000 Subject: [PATCH 138/243] Bump handlebars from 4.2.1 to 4.3.0 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.2.1 to 4.3.0. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.2.1...v4.3.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b8e21a3d..5a194a97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.1.tgz", - "integrity": "sha512-bqPIlDk06UWbVEIFoYj+LVo42WhK96J+b25l7hbFDpxrOXMphFM3fNIm+cluwg4Pk2jiLjWU5nHQY7igGE75NQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.0.tgz", + "integrity": "sha512-7XlnO8yBXOdi7AzowjZssQr47Ctidqm7GbgARapOaqSN9HQhlClnOkR9HieGauIT3A8MBC6u9wPCXs97PCYpWg==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 1aa08137..68ab09e5 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.2.1", + "handlebars": "^4.3.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From e10fe17436e09f636bad5be111af7eb7ae680584 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 22:38:51 +0000 Subject: [PATCH 139/243] Bump handlebars from 4.3.0 to 4.3.1 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.3.0 to 4.3.1. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.3.1/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.3.0...v4.3.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a194a97..6d57f2d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.0.tgz", - "integrity": "sha512-7XlnO8yBXOdi7AzowjZssQr47Ctidqm7GbgARapOaqSN9HQhlClnOkR9HieGauIT3A8MBC6u9wPCXs97PCYpWg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.1.tgz", + "integrity": "sha512-c0HoNHzDiHpBt4Kqe99N8tdLPKAnGCQ73gYMPWtAYM4PwGnf7xl8PBUHJqh9ijlzt2uQKaSRxbXRt+rZ7M2/kA==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 68ab09e5..3deac6f6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.3.0", + "handlebars": "^4.3.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From eae694481d177618072f680fe354c43ee20b8fb5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 23:35:54 +0000 Subject: [PATCH 140/243] Bump @types/mongoose from 5.5.17 to 5.5.18 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.17 to 5.5.18. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d57f2d5..a4bed60f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -655,9 +655,9 @@ } }, "@types/mongoose": { - "version": "5.5.17", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.17.tgz", - "integrity": "sha512-Nv7Fmun31np7YpNw9s2Aib+bqErDeO2QQZgtl4zUJSwY4Fyp+UDYV/nWANEbKMFU0fkQ3aNbnkODziL1YtSdbg==", + "version": "5.5.18", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.18.tgz", + "integrity": "sha512-YWTNSehI+TvuqzEzr7nhzYRbwraq43bZao4XZc/T2ViGmzX06Wy9XPHCHAZ2vsuiZ9Vh9tiGomRt7MjzTihn+w==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 3deac6f6..fd4917a4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.17", + "@types/mongoose": "^5.5.18", "@types/multer": "^1.3.9", "apidoc": "^0.17.7", "chai": "^4.2.0", From ecb479c45c9b626385224cf5ea614a35c466b34d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2019 18:38:08 +0000 Subject: [PATCH 141/243] Bump @types/multer from 1.3.9 to 1.3.10 Bumps [@types/multer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/multer) from 1.3.9 to 1.3.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/multer) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a4bed60f..db119863 100644 --- a/package-lock.json +++ b/package-lock.json @@ -665,9 +665,9 @@ } }, "@types/multer": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.3.9.tgz", - "integrity": "sha512-aKUwxl4yH87G8b3wgmruBVdOWiG9qqmc4Epjt5Uz3mqaMZwx3dkMm4tHn5nnwBk2NT+X4t5yADJiEv/NfMFQIg==", + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.3.10.tgz", + "integrity": "sha512-3hECfz+W0ix/LvPanp87mjO3kOyDnJYTpY9y7gdBxXnYXqEcj21pD0lW7KEUFFr8CHrDF5Mhh7o241KLEXDRoQ==", "dev": true, "requires": { "@types/express": "*" diff --git a/package.json b/package.json index fd4917a4..a5b70e3e 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", "@types/mongoose": "^5.5.18", - "@types/multer": "^1.3.9", + "@types/multer": "^1.3.10", "apidoc": "^0.17.7", "chai": "^4.2.0", "chai-http": "^4.3.0", From 8835eb84153d95bb72d35661099d64d78188c487 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2019 22:03:07 +0000 Subject: [PATCH 142/243] Bump handlebars from 4.3.1 to 4.3.2 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.3.1 to 4.3.2. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.3.2/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.3.1...v4.3.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index db119863..6435a629 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.1.tgz", - "integrity": "sha512-c0HoNHzDiHpBt4Kqe99N8tdLPKAnGCQ73gYMPWtAYM4PwGnf7xl8PBUHJqh9ijlzt2uQKaSRxbXRt+rZ7M2/kA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.2.tgz", + "integrity": "sha512-LuccMnDrKB72bbClEIucoBNAIMpqmWvIGSKNEngDcYFT6hlCq7ZoCWc26ZT9mr6tfWTJeTswSldoI5LOeezzDQ==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index a5b70e3e..6369e67c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.3.1", + "handlebars": "^4.3.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From 4ee2209ac1e1aa321f60c00d2f50943b76db06e0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2019 08:20:10 +0000 Subject: [PATCH 143/243] Bump handlebars from 4.3.2 to 4.3.3 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.3.2 to 4.3.3. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.3.3/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.3.2...v4.3.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6435a629..5e7ba89a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.2.tgz", - "integrity": "sha512-LuccMnDrKB72bbClEIucoBNAIMpqmWvIGSKNEngDcYFT6hlCq7ZoCWc26ZT9mr6tfWTJeTswSldoI5LOeezzDQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.3.tgz", + "integrity": "sha512-VupOxR91xcGojfINrzMqrvlyYbBs39sXIrWa7YdaQWeBudOlvKEGvCczMfJPgnuwHE/zyH1M6J+IUP6cgDVyxg==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 6369e67c..c89caf6b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.3.2", + "handlebars": "^4.3.3", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From db5d7698aec63f30ab337e2365da16ff486f1504 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 28 Sep 2019 11:40:41 +0000 Subject: [PATCH 144/243] Bump handlebars from 4.3.3 to 4.3.4 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.3.4/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.3.3...v4.3.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5e7ba89a..fd5ceef6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.3.tgz", - "integrity": "sha512-VupOxR91xcGojfINrzMqrvlyYbBs39sXIrWa7YdaQWeBudOlvKEGvCczMfJPgnuwHE/zyH1M6J+IUP6cgDVyxg==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.4.tgz", + "integrity": "sha512-vvpo6mpK4ScNC1DbGRZ2d5BznS6ht0r1hi20RivsibMc6jNvFAeZQ6qk5VNspo6SOwVOJQbjHyBCpuS7BzA1pw==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index c89caf6b..6748a124 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.3.3", + "handlebars": "^4.3.4", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From 495d36293998f20b710fe2b006acd77ce5cdcab4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 29 Sep 2019 10:11:07 +0000 Subject: [PATCH 145/243] Bump nodemon from 1.19.2 to 1.19.3 Bumps [nodemon](https://github.com/remy/nodemon) from 1.19.2 to 1.19.3. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v1.19.2...v1.19.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd5ceef6..fce392eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4688,9 +4688,9 @@ } }, "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", "dev": true }, "is-stream": { @@ -5878,9 +5878,9 @@ } }, "nodemon": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.2.tgz", - "integrity": "sha512-hRLYaw5Ihyw9zK7NF+9EUzVyS6Cvgc14yh8CAYr38tPxJa6UrOxwAQ351GwrgoanHCF0FalQFn6w5eoX/LGdJw==", + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.3.tgz", + "integrity": "sha512-TBNKRmJykEbxpTniZBusqRrUTHIEqa2fpecbTQDQj1Gxjth7kKAPP296ztR0o5gPUWsiYbuEbt73/+XMYab1+w==", "dev": true, "requires": { "chokidar": "^2.1.5", diff --git a/package.json b/package.json index 6748a124..1f60a498 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.2.0", - "nodemon": "^1.19.2" + "nodemon": "^1.19.3" } } From d5892a6ca75188dac30af3c1b3d89f82785b3c0c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 29 Sep 2019 13:37:14 +0000 Subject: [PATCH 146/243] Bump handlebars from 4.3.4 to 4.4.0 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.3.4 to 4.4.0. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.4.0/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.3.4...v4.4.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index fce392eb..81763386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1665,9 +1665,9 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.1.tgz", + "integrity": "sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg==", "optional": true }, "component-emitter": { @@ -4193,9 +4193,9 @@ } }, "handlebars": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.4.tgz", - "integrity": "sha512-vvpo6mpK4ScNC1DbGRZ2d5BznS6ht0r1hi20RivsibMc6jNvFAeZQ6qk5VNspo6SOwVOJQbjHyBCpuS7BzA1pw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.0.tgz", + "integrity": "sha512-xkRtOt3/3DzTKMOt3xahj2M/EqNhY988T+imYSlMgs5fVhLN2fmKVVj0LtEGmb+3UUYV5Qmm1052Mm3dIQxOvw==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 1f60a498..48646e34 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.3.4", + "handlebars": "^4.4.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.1", From e0e72b72528b752d27596fd6d99a5e53b1678bba Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 29 Sep 2019 13:52:10 +0000 Subject: [PATCH 147/243] Bump mocha from 6.2.0 to 6.2.1 Bumps [mocha](https://github.com/mochajs/mocha) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/v6.2.1/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v6.2.0...v6.2.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 441 ++++++++++++++-------------------------------- package.json | 2 +- 2 files changed, 138 insertions(+), 305 deletions(-) diff --git a/package-lock.json b/package-lock.json index 81763386..25a19f34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2223,17 +2223,21 @@ "dev": true }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.14.2.tgz", + "integrity": "sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==", "dev": true, "requires": { "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", "has": "^1.0.3", + "has-symbols": "^1.0.0", "is-callable": "^1.1.4", "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "object-inspect": "^1.6.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.0.0", + "string.prototype.trimright": "^2.0.0" } }, "es-to-primitive": { @@ -5204,15 +5208,6 @@ "pify": "^3.0.0" } }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -5265,17 +5260,6 @@ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, - "mem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" - } - }, "memory-cache": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz", @@ -5331,12 +5315,6 @@ "mime-db": "~1.33.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -5409,9 +5387,9 @@ } }, "mocha": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", - "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.1.tgz", + "integrity": "sha512-VCcWkLHwk79NYQc8cxhkmI8IigTIhsCwZ6RTxQsqK6go4UvEhzJkYuHm8B2YtlSxcYq2fY+ucr4JBwoD6ci80A==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -5434,51 +5412,35 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" + "yargs": "13.3.0", + "yargs-parser": "13.1.1", + "yargs-unparser": "1.6.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - } + "color-convert": "^1.9.0" } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, "debug": { @@ -5490,30 +5452,6 @@ "ms": "^2.1.1" } }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -5528,54 +5466,18 @@ "path-is-absolute": "^1.0.0" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -5585,32 +5487,15 @@ "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } }, "supports-color": { @@ -5631,6 +5516,17 @@ "isexe": "^2.0.0" } }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", @@ -5638,22 +5534,21 @@ "dev": true }, "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "yargs-parser": "^13.1.1" } } } @@ -5815,12 +5710,6 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "node-environment-flags": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", @@ -5832,9 +5721,9 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } @@ -6007,6 +5896,12 @@ } } }, + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -6136,24 +6031,12 @@ "os-tmpdir": "^1.0.0" } }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, - "p-is-promise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true - }, "p-limit": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", @@ -7169,6 +7052,26 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -7883,9 +7786,9 @@ } }, "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -7901,177 +7804,107 @@ } }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, "requires": { "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "lodash": "^4.17.15", + "yargs": "^13.3.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "color-convert": "^1.9.0" } }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "pump": "^3.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true }, - "os-locale": { + "string-width": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "ansi-regex": "^4.1.0" } }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" } }, - "strip-ansi": { + "y18n": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" } } } diff --git a/package.json b/package.json index 48646e34..cc0c90c9 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "chai-http": "^4.3.0", "jshint": "^2.10.2", "jslint": "^0.12.1", - "mocha": "^6.2.0", + "mocha": "^6.2.1", "nodemon": "^1.19.3" } } From 6bdcde0902edc564cb1a4de0bbd5ad68373fc29f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2019 21:55:58 +0000 Subject: [PATCH 148/243] Bump mongoose from 5.7.1 to 5.7.3 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.7.1 to 5.7.3. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.7.1...5.7.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 23 +++++++---------------- package.json | 2 +- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25a19f34..8622b1a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5571,17 +5571,16 @@ } }, "mongoose": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.1.tgz", - "integrity": "sha512-TJeZHb5h8UGH++ctngh2shgZuZmR9o0D8elxfkWzIpKB6QAFsJPmALtDuD6RYZTS33+CifhDdAMGqs3OpJ3cyQ==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.3.tgz", + "integrity": "sha512-CKCCCAhFnJRtmdmver8Ud9/NZ9m7D2H/xLgmrcL6cb9D4nril/idL8lsWWpBsJI81AOCVsktiZJ4X4vfo2S0fw==", "requires": { - "async": "2.6.2", "bson": "~1.1.1", "kareem": "2.3.1", "mongodb": "3.3.2", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.6.0", - "mquery": "3.2.1", + "mquery": "3.2.2", "ms": "2.1.2", "regexp-clone": "1.0.0", "safe-buffer": "5.1.2", @@ -5589,14 +5588,6 @@ "sliced": "1.0.1" }, "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -5620,9 +5611,9 @@ "integrity": "sha512-i75qh79MJ5Xo/sbhxrDrPSEG0H/mr1kcZXJ8dH6URU5jD/knFxCVqVC/gVSW7GIXL/9hHWlT9haLbCXWOll3qw==" }, "mquery": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.1.tgz", - "integrity": "sha512-kY/K8QToZWTTocm0U+r8rqcJCp5PRl6e8tPmoDs5OeSO3DInZE2rAL6AYH+V406JTo8305LdASOQcxRDqHojyw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz", + "integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==", "requires": { "bluebird": "3.5.1", "debug": "3.1.0", diff --git a/package.json b/package.json index cc0c90c9..76d06b09 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.4.0", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.7.1", + "mongoose": "^5.7.3", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 8940b52a41314da6ab5cec2f7c1a6c3367219c8f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2019 21:27:36 +0000 Subject: [PATCH 149/243] Bump @google-cloud/storage from 3.3.0 to 3.3.1 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.3.0...v3.3.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 88 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8622b1a3..212aca9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.3.0.tgz", - "integrity": "sha512-9jmHJ0ncQTcrZRwq5MRjXEwuCFkIjHenYwVbycV6bbZ4O84Hcgg4Yp33sKcJug5rvZeVgrpCzPbYXqO3B0LzJw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.3.1.tgz", + "integrity": "sha512-+OoVaJbETDh9cyDoRGe1MJE2Rhrd6JXjSP7GVpdxCUkwYw8pLll/Oz+84JEB82GebQlxG+GVHGcKYTVcSobB5g==", "requires": { "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", @@ -292,16 +292,16 @@ } }, "google-auth-library": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.2.tgz", - "integrity": "sha512-0vzniXbjD5SE9aenAMqhjVR99wvqLpyd5Fw6zC3WxJ15GIMGx96tq+Cu1WRviqsnQqhrmnad6T69kv6qkj/w2Q==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.3.0.tgz", + "integrity": "sha512-DnwwP18H6RVtvtmDjmPLipKyx8NsXTQNZcNYud+ueOYaWSVxXeaSFBiBxABb93S3Ae41R60SnaSc19rljeoAxQ==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", "gcp-metadata": "^3.0.0", - "gtoken": "^4.0.0", + "gtoken": "^4.1.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" } @@ -315,9 +315,9 @@ } }, "gtoken": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.0.0.tgz", - "integrity": "sha512-XaRCfHJxhj06LmnWNBzVTAr85NfAErq0W1oabkdqwbq3uL/QTB1kyvGog361Uu2FMG/8e3115sIy/97Rnd4GjQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.0.tgz", + "integrity": "sha512-wqyn2gf5buzEZN4QNmmiiW2i2JkEdZnL7Z/9p44RtZqgt4077m4khRgAYNuu8cBwHWCc6MsP6eDUn/KkF6jFIw==", "requires": { "gaxios": "^2.0.0", "google-p12-pem": "^2.0.0", @@ -339,9 +339,9 @@ "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", + "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==" }, "p-limit": { "version": "2.2.1", @@ -361,9 +361,9 @@ } }, "pumpify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.0.tgz", - "integrity": "sha512-ieN9HmpFPt4J4U4qnjN4BxrnqpPPXJyp3qFErxfwBtFOec6ewpIHdS2eu3TkmGW6S+RzFGEOGpm5ih/X/onRPQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.1.tgz", + "integrity": "sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw==", "requires": { "duplexify": "^4.1.1", "inherits": "^2.0.3", @@ -407,9 +407,9 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } }, @@ -1685,9 +1685,9 @@ }, "dependencies": { "mime-db": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.41.0.tgz", - "integrity": "sha512-B5gxBI+2K431XW8C2rcc/lhppbuji67nf9v39eH8pkWoZDxnAL0PxdpH32KYRScniF8qDHBDlI+ipgg5WrCUYw==" + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", + "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" } } }, @@ -3423,16 +3423,16 @@ } }, "google-auth-library": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.2.2.tgz", - "integrity": "sha512-0vzniXbjD5SE9aenAMqhjVR99wvqLpyd5Fw6zC3WxJ15GIMGx96tq+Cu1WRviqsnQqhrmnad6T69kv6qkj/w2Q==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.3.0.tgz", + "integrity": "sha512-DnwwP18H6RVtvtmDjmPLipKyx8NsXTQNZcNYud+ueOYaWSVxXeaSFBiBxABb93S3Ae41R60SnaSc19rljeoAxQ==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", "gcp-metadata": "^3.0.0", - "gtoken": "^4.0.0", + "gtoken": "^4.1.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" } @@ -3446,9 +3446,9 @@ } }, "gtoken": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.0.0.tgz", - "integrity": "sha512-XaRCfHJxhj06LmnWNBzVTAr85NfAErq0W1oabkdqwbq3uL/QTB1kyvGog361Uu2FMG/8e3115sIy/97Rnd4GjQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.0.tgz", + "integrity": "sha512-wqyn2gf5buzEZN4QNmmiiW2i2JkEdZnL7Z/9p44RtZqgt4077m4khRgAYNuu8cBwHWCc6MsP6eDUn/KkF6jFIw==", "requires": { "gaxios": "^2.0.0", "google-p12-pem": "^2.0.0", @@ -3483,9 +3483,9 @@ "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==" + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", + "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==" }, "pump": { "version": "3.0.0", @@ -3497,9 +3497,9 @@ } }, "pumpify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.0.tgz", - "integrity": "sha512-ieN9HmpFPt4J4U4qnjN4BxrnqpPPXJyp3qFErxfwBtFOec6ewpIHdS2eu3TkmGW6S+RzFGEOGpm5ih/X/onRPQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.1.tgz", + "integrity": "sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw==", "requires": { "duplexify": "^4.1.1", "inherits": "^2.0.3", @@ -3546,9 +3546,9 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } }, @@ -5315,6 +5315,11 @@ "mime-db": "~1.33.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -5972,13 +5977,6 @@ "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "requires": { "mimic-fn": "^2.1.0" - }, - "dependencies": { - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - } } }, "optimist": { diff --git a/package.json b/package.json index 76d06b09..ccc0a863 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.3.0", + "@google-cloud/storage": "^3.3.1", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 8ada5ad1da48da92b7586e977e176405ab8fd6a5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2019 19:58:10 +0000 Subject: [PATCH 150/243] Bump handlebars from 4.4.0 to 4.4.1 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.4.0 to 4.4.1. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.4.1/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.4.0...v4.4.1) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 212aca9e..e9d60370 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4197,9 +4197,9 @@ } }, "handlebars": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.0.tgz", - "integrity": "sha512-xkRtOt3/3DzTKMOt3xahj2M/EqNhY988T+imYSlMgs5fVhLN2fmKVVj0LtEGmb+3UUYV5Qmm1052Mm3dIQxOvw==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.1.tgz", + "integrity": "sha512-lj/malGM5VJjSeqhYVpoOBP3hsugN6uU9NlOvLqq6kSFASpveWVLj3kb1b3w7Q3umSPdRMR1kAbFH/5EEEPiIA==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index ccc0a863..50bb1f44 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.4.0", + "handlebars": "^4.4.1", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.3", From 441c60140c95f348ccd87dbe6f242f8a70b230cf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2019 20:55:59 +0000 Subject: [PATCH 151/243] Bump handlebars from 4.4.1 to 4.4.2 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.4.1 to 4.4.2. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.4.2/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.4.1...v4.4.2) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e9d60370..7cd85b10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4197,9 +4197,9 @@ } }, "handlebars": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.1.tgz", - "integrity": "sha512-lj/malGM5VJjSeqhYVpoOBP3hsugN6uU9NlOvLqq6kSFASpveWVLj3kb1b3w7Q3umSPdRMR1kAbFH/5EEEPiIA==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.2.tgz", + "integrity": "sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", diff --git a/package.json b/package.json index 50bb1f44..60c73e89 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.4.1", + "handlebars": "^4.4.2", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.3", From 3983c13fbfa62320dadd39f4f64777b27eeb73f3 Mon Sep 17 00:00:00 2001 From: Pierre Theo Klein Date: Thu, 3 Oct 2019 10:20:33 -0400 Subject: [PATCH 152/243] Add documentation for the batch scripts (#463) --- docs/getting-started.md | 12 +++++++++--- docs/standards.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 29ba30ff..7f0ceef1 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -3,7 +3,7 @@ ## What you will need before you can use this * A google cloud provider account: - * Google storage bucket. + * Google storage bucket. * Sendgrid account and the sendgrid_api_key ## Setting up this repo @@ -13,8 +13,10 @@ 1. `git`: 2. `mongodb`: 1. Make sure you also have the `/data/db` directory. + 2. To test the installation, run `mongod`. 3. `node`: - 4. `npm`: + 4. `npm`: . + 5. `Postman`: . We use this for testing the API locally. 3. Make sure you have the following (only if you are going to be publishing this as a kubernetes cluster on google cloud): 1. `kubectl`: 2. `gcloud`: @@ -25,4 +27,8 @@ 1. Determine which environment the database you want to seed belongs to (`deployment`, `development`, or `test`). 2. Navigate to `package.json`, and confirm that at the `seed` script, `NODE_ENV` is set to the proper environment. -3. Run `npm run seed`. \ No newline at end of file +3. Run `npm run seed`. + +## Testing the API + +In order to test that you have set up the API properly, run `npm run test`. \ No newline at end of file diff --git a/docs/standards.md b/docs/standards.md index 9699d078..02affc46 100644 --- a/docs/standards.md +++ b/docs/standards.md @@ -207,6 +207,7 @@ Things to take note of: * Finally, we want to interact with the database. This is done either in the `Controller` function, or in another `middleware` function. * the last middleware should always be a `Controller` (since we want to respond to the user of the api). * **Connecting inputted route with the newly created route**: We finally connect the newly created router with the inputted router at the end of the `activate` function by writing: + ```javascript apiRouter.use("/account", accountRouter); ``` @@ -223,6 +224,36 @@ Things to take note of: `TODO` +## Batch Scripts + +There is a set of batch scripts written in [batch_scripts.py](../scripts/batch_scripts.py). The motivation for these scripts is to provide crucial functionality for the hackathon process that is lacking in the admin UX. The goal is to extend the functionality to provide a full-fledged CLI client so that we can interface with the API without using the admin dashboard. + +### How to Run + +This script expects python3, and will not work in python2. Before you run the script, make sure that you have installed the following library: + +* [bson](https://pypi.org/project/bson/): `pip install bson` + +Then, run the following command: +```python3 batch_scripts.py``` + +In order for the script to work with all of the actions, you must have a staff account. Otherwise, it's possible that you do not have the proper permission to execute all of the actions. + +### Existing Actions in the Script file + +There are 6 batch actions: + +1. `updateStatus`: Update the status of a set of hackers. The script asks for a file which contains the IDs of hackers to update, and also for a pre-requisite status that the hacker must be in order for the update to properly go through. +2. `dayOf`: Send the day-of email to a set of hackers. The script asks for a file which contains the IDs of hackers to send the emails to, and also for a pre-requisite status that the hacker must be in order for the email to properly go through. +3. `weekOf`: Send the week-of email to a set of hackers. The script asks for a file which contains the IDs of hackers to send the emails to, and also for a pre-requisite status that the hacker must be in order for the email to properly go through. +4. `downloadResume`: Download the resumes for a set of hackers. The script asks for a file which contains the IDs of hackers to download. and also for a pre-requisite status that the hacker must be in order to download the resume. +5. `inviteUsers`: Invites a set of emails to create accounts. The script asks for a CSV file, which should be formatted in the following way: + | email | accountType | + | ----------- | ----------- | + | foo@bar.com | Staff | + | baz@bar.com | Sponsor | +6. `getHackers`: Downloads all of the hacker details whose status matches the inputted status. Places the hacker information into a CSV file in the inputted directory. + ## Documentation of API We use apidoc.js to generate documentation for the API. This documentation is found on our github pages link. From 0fd69b5f753ea5bbb2922c76fae2fbc6dd893d2d Mon Sep 17 00:00:00 2001 From: Richard Zhang Date: Thu, 3 Oct 2019 07:21:24 -0700 Subject: [PATCH 153/243] Feature/454 documentation refactor (#458) * version 1.6.1 * documentation update * WIP services * Test files * Validation * Documentation update * Add links to documentation * update docs * PR changes * Detail generic validator functions --- VERSION | 2 +- docs/api/api_data.js | 16 ++-- docs/api/api_data.json | 16 ++-- docs/api/api_project.js | 2 +- docs/api/api_project.json | 2 +- docs/architecture.md | 4 +- docs/standards.md | 181 ++++++++++++++++++++++++++++++++++++-- 7 files changed, 196 insertions(+), 27 deletions(-) diff --git a/VERSION b/VERSION index ce6a70b9..2eda823f 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0 \ No newline at end of file +1.6.1 \ No newline at end of file diff --git a/docs/api/api_data.js b/docs/api/api_data.js index ab46549f..3bd69968 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1257,7 +1257,7 @@ define({ }, { "type": "get", - "url": "/hacker/:id", + "url": "/hacker/email/:email", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1268,8 +1268,8 @@ define({ "group": "param", "type": "String", "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" + "field": "email", + "description": "

a hacker's unique email

" }] } }, @@ -1324,12 +1324,12 @@ define({ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" + "url": "https://api.mchacks.ca/api/hacker/email/:email" }] }, { "type": "get", - "url": "/hacker/email/:email", + "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1340,8 +1340,8 @@ define({ "group": "param", "type": "String", "optional": false, - "field": "email", - "description": "

a hacker's unique email

" + "field": "id", + "description": "

a hacker's unique mongoID

" }] } }, @@ -1396,7 +1396,7 @@ define({ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" + "url": "https://api.mchacks.ca/api/hacker/:id" }] }, { diff --git a/docs/api/api_data.json b/docs/api/api_data.json index dcb9e4ed..b6d16068 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1256,7 +1256,7 @@ }, { "type": "get", - "url": "/hacker/:id", + "url": "/hacker/email/:email", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1267,8 +1267,8 @@ "group": "param", "type": "String", "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" + "field": "email", + "description": "

a hacker's unique email

" }] } }, @@ -1323,12 +1323,12 @@ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" + "url": "https://api.mchacks.ca/api/hacker/email/:email" }] }, { "type": "get", - "url": "/hacker/email/:email", + "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", @@ -1339,8 +1339,8 @@ "group": "param", "type": "String", "optional": false, - "field": "email", - "description": "

a hacker's unique email

" + "field": "id", + "description": "

a hacker's unique mongoID

" }] } }, @@ -1395,7 +1395,7 @@ "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" + "url": "https://api.mchacks.ca/api/hacker/:id" }] }, { diff --git a/docs/api/api_project.js b/docs/api/api_project.js index 5875ef3e..0d68be91 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -9,7 +9,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-18T21:54:16.394Z", + "time": "2019-05-06T17:36:31.903Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/docs/api/api_project.json b/docs/api/api_project.json index befdcc87..c9e1f4e7 100644 --- a/docs/api/api_project.json +++ b/docs/api/api_project.json @@ -9,7 +9,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-18T21:54:16.394Z", + "time": "2019-05-06T17:36:31.903Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/docs/architecture.md b/docs/architecture.md index 02603986..952ee097 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -97,7 +97,7 @@ hackerRouter.route("/").post( ); ``` -To add `Authorization`, you will need to import the `Auth` module file, and then insert into the route definition, just like `Authentication`. However, if there are route parameters, you will need to also provide as arguments an array which contains the functions required to access the given parameters. There must be a one-to-one mapping between route parameters and function inputs. An example is below: +To add `Authorization`, you will need to import the `Auth` module file, and then insert into the route definition, just like `Authentication`. However, if there are route parameters, you will need to also provide as arguments an array which contains the functions required to access the given parameters. The route parameters are typically some model id. The functions in the array need return an object that contains the user id either in `_id` or `accountId`. The method signature for the inputted functions must be: `(parameter) => {accountId:string} | {_id:string}`. There must be a one-to-one mapping between route parameters and function inputs. The order of route parameters and function inputs must be the same. The details of authorization is heavily commented in in `ensureAuthorized` at [auth.service.js](../services/auth.service.js). An example is below: ```javascript const Middleware = { @@ -117,7 +117,7 @@ hackerRouter.route("/:id1/friend/:id2/").get( Here, we note that we pass in one function for `id1`, and one function for `id2`. -The method signature for the inputted functions must be: `(parameter) => {accountId:string} | {_id:string}`. +The `ensureAuthorized` middleware calls the `ensureAuthorized` service in [auth.service.js](../services/auth.service.js). ### Limitations diff --git a/docs/standards.md b/docs/standards.md index 02affc46..9b29cd0e 100644 --- a/docs/standards.md +++ b/docs/standards.md @@ -32,7 +32,7 @@ The naming convention for all `.js` files (with the exception of routes) is as s ### Middleware files -Middleware functions are chained together in a route to process a request in a modular way. Look at Express.js documentation for a better understanding. +Middleware functions are chained together in a route to process a request in a modular way. Look at Express.js [documentation](https://expressjs.com/en/guide/using-middleware.html) for a better understanding. Below is an example middleware file: ```javascript @@ -201,8 +201,9 @@ Things to take note of: * **`activate` function**: Every route file contains one exported function, called `activate`. This takes as input an `ExpressRouter`, to which we will attach the sub router to. We will also define all of the sub-routes in this function. * **Chaining middlewares in a route**: We chain middlewares together by placing them one after another as arguments to the http request of the route. * **Ordering of middleware**: - * The first middleware should always be the validator for the inputted data of a route. In this case, we have the validator for a new account. - * The next middleware should always be `Middleware.parseBody.middleware`. This middleware parses validated information, and places it inside of `req.body` if everything is properly validated. Else, it errors out. + * If input is expected, validation of that input should be done promptly. Therefore validators are generally the first middlewares. + * The first middleware should be the validator for the inputted data of a route. In this case, we have the validator for a new account. + * The next middleware should be `Middleware.parseBody.middleware` to parse the validated information. This middleware also places the data inside of `req.body`. If validation fails, it fails the request. * The following middlewares will depend on what type of route it is. In this case, we are creating a new item in our database, so we want to create a new `Account` object. This is what `Middleware.Account.parseAccount` does. * Finally, we want to interact with the database. This is done either in the `Controller` function, or in another `middleware` function. * the last middleware should always be a `Controller` (since we want to respond to the user of the api). @@ -214,15 +215,183 @@ Things to take note of: ### Services files -`TODO` +Service files contain functions that interact with external services. The most common service file interacts with mongoose models to find, create, update documents. Service files are found in the services folder, and are named `.service.js`. Service files are generally called in middleware functions. Below is an example service file: + +```javascript +"use strict"; +const Account = require("../models/account.model"); + +/** + * @function findById + * @param {ObjectId} id + * @return {DocumentQuery} The document query will resolve to either account or null. + * @description Finds an account by mongoID. + */ +function findById(id) { + const TAG = `[Account Service # findById]:`; + const query = { + _id: id + }; + + return Account.findById(query, logger.queryCallbackFactory(TAG, "account", query)); +} +... +module.exports = { + findById: findById +} +``` + +Things to take note of: +* **async & await**: When the service call is to a mongoose model, they generally return a mongoose query. These can be handled as a promise, and Mongoose has further documentation on it [here](https://mongoosejs.com/docs/api.html). We handle then by using `await` on the service call. For example, a middleware function that uses `findById` would be: + ```javascript + async function getById(req, res, next) { + const acc = await Services.Account.findById(req.body.id); + + if (!acc) { + return res.status(404).json({ + message: Constants.Error.ACCOUNT_404_MESSAGE, + data: {} + }); + } + + req.body.account = acc; + return next(); + } + ``` +It's important to: + * Use `await` when calling the service function + * Put `async` in the method head + * Check the output of the service function call for any errors. In the code snippet we need to check for a scenario where the account is not found, which is a 404 error. A full list of the current error messages are in [error.constant.js](../constants/error.constant.js). +More information on asynchronous functions can be found [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). +* **queryCallbackFactory**: The query callback factory returns a function that uses winston to log the success or failure of the service call. The callback factory is used for mongoose service calls. ### Test files -`TODO` +We use [Mocha](https://mochajs.org/) with [Chai](https://www.chaijs.com/) to test our routes and services. These test files are located in the `tests` folder, and are named `.test.js` or `.spec.js`. It is important to test both succcess and fail cases. For example, testing account retrieval may include scenarios of: + * Failure due to authentication + * Failure due to authorization + * Failure due to the account not existing + * Success case for a user + * Success case for an admin +The code for this example can be found in [account.test.js](../tests/account.test.js). + +We repopulate the test server before each test to ensure consistency. [setup.spec.js](../tests/setup.spec.js) contains the code for that. The `storeAll` and `dropAll` functions call test util functions that store and drop specific collections. For example, `account.test.util.js` contains the code a `storeAll` function that inserts all the test account documents into the test database. + +#### Util files and Test Database Population + +##### Motivation + +We wanted to have a scalable way to create new entities that properly reference each other. The biggest challenge lied in creating enough accounts that can be properly referenced during specific tests. + +##### Util.js + +Account.util.js contains the test data for accounts. When an account is created, it is placeed within an object whose name references the type of account it will be (ex: Hacker, Sponsor, etc). The object has keys that further define the state of the account. The keys are: `new` for new accounts, `stored` for accounts that already exist, and `invalid` for invalid accounts. Additionally, there are 2 more keys inside `stored` for hacker accounts, which are `team` and `noTeam` for accounts linked to hackers that are on a team, or not on a team respectively. + +```javascript +let hackerAccounts = { + new: createNAccounts(10, { + "accountType": Constants.HACKER, + "confirmed": true, + }), + stored: { + team: createNAccounts(10, { + "accountType": Constants.HACKER, + "confirmed": true, + }), + noTeam: createNAccounts(10, { + "accountType": Constants.HACKER, + "confirmed": true, + }), + }, + invalid: createNAccounts(10, { + "accountType": Constants.HACKER + }) +}; +``` + +In this example the `new` accounts are accounts that exist, but the hacker objects have not been created. The `stored.team` accounts are those linked to a hacker object that is in a team. The `stored.noTeam` accounts link to a hacker that is not in a team. The `invalid` accounts are created accounts that are linked to a hacker object that does not fit with the Hacker schema. The invalid accounts are used to test fail cases. The value for each key is an array of account objects. + +On the other end of the account-hacker link, [hacker.util.js](../tests/util/hacker.test.util.js) contains the hacker data in the form of hacker objects. These hacker objects have an `accountId` attribute which references an account's `_id`. The matching between the hacker object and the respective account object it needs to link to is also done by nomenclature. For example, a hacker on a team would be called `TeamHackerX` where X is a number. This hacker's account object would be within the array specified by `hackerAccounts.stored.team`. The specific account object is referenced by its index in the array. That index is the same as the value X in the name of the hacker object. ### Validation files -`TODO` +These files validate inputs using [express-validator](https://express-validator.github.io/docs/). Validation files are located in the `middlewares` directory under a subdirectory called `validators`. The filenames are `.validator.js`. To be used in a route, a validator needs to be a list express validator functions. We have generic validator functions located in [validator.helper.js](../middlewares/validators/validator.helper.js). The goal is to have a generic validator function for each datatype, which can then be put in the list of validators as the situation requires. The generic validators may take several arguments, but generally require: + * Where the variable is located: `body`, `query`, `header`, or `param`. To validate a value located in `req.body`, one should use `body` + * The fieldname, such as `email` for `req.body.email`. + * A boolean detailing whether this value is optional. `false` means that the value is necessary. + +An example of a generic validator function: +```javascript +function stringValidator(fieldLocation, fieldname, optional = true) { + const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid string"); + if (optional) { + return name.optional({ + checkFalsy: true + }).isString().withMessage("must be a string"); + } else { + return name.exists().withMessage("name must exist").isString().withMessage("must be a string"); + } +} +``` +It's important to note the use of `setProperValidationChainBuilder` to parse the input value from the appropriate input location. This is consistent across generic validators. It is also important to create a validator for situations where the input is optional. + +A validator example, using generic validator functions. +```javascript +"use strict"; +const VALIDATOR = require("./validator.helper"); +const Constants = require("../../constants/general.constant"); + +module.exports = { + idValidator: [ + VALIDATOR.mongoIdValidator("param", "id", false), + ], + updateAccountValidator: [ + VALIDATOR.stringValidator("body", "firstName", true), + VALIDATOR.stringValidator("body", "lastName", true), + VALIDATOR.stringValidator("body", "pronoun", true), + VALIDATOR.regexValidator("body", "email", true, Constants.EMAIL_REGEX), + VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", true), + VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, true), + VALIDATOR.dateValidator("body", "birthDate", true), + VALIDATOR.phoneNumberValidator("body", "phoneNumber", true) + ], +}; +``` + +A route would use a validator in the following manner: +```javascript + accountRouter.route("/:id").patch( + ... + // validators + Middleware.Validator.RouteParam.idValidator, + Middleware.Validator.Account.updateAccountValidator, + + Middleware.parseBody.middleware, + ... + ); +``` + +`Middleware.parseBody.middleware` evaluates the validator functions, so it is generally placed right after the validators. If there is an error during validation, it will send a 422 error status to be handled. If all the validators pass, then it will move the validated values into req.body. If there a validator function was not found for a property in `req.body`, that property will be removed. For example, suppose `req.body` was originally: + +```javascript +{ + "A": "foo", + "B": true, + "C": { + "bar": "baz" + } +} +``` + +and only `A` and `B` are validated. Then `req.body` after validation will be: + +```javascript +{ + "A": "foo", + "B": true +} +``` + ## Batch Scripts From 2f8a99c4fc0b586b64ff422cbf286719e7228620 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2019 23:22:18 +0000 Subject: [PATCH 154/243] Bump @types/mongoose from 5.5.18 to 5.5.19 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.18 to 5.5.19. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7cd85b10..5fbcb2fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -655,9 +655,9 @@ } }, "@types/mongoose": { - "version": "5.5.18", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.18.tgz", - "integrity": "sha512-YWTNSehI+TvuqzEzr7nhzYRbwraq43bZao4XZc/T2ViGmzX06Wy9XPHCHAZ2vsuiZ9Vh9tiGomRt7MjzTihn+w==", + "version": "5.5.19", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.19.tgz", + "integrity": "sha512-VIT+chW2nMHKK5vleT5PKOt8i72PwFbSHAKDKL0RQ9QcXvUex9LtR0Mq4nAI3WM8AwvvJqwFUCk4XY4r+PZlQA==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 60c73e89..e0e4286a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.18", + "@types/mongoose": "^5.5.19", "@types/multer": "^1.3.10", "apidoc": "^0.17.7", "chai": "^4.2.0", From 5cf283b269cefa60a4d5f32c07331dd6c8567083 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2019 22:27:24 +0000 Subject: [PATCH 155/243] Bump handlebars from 4.4.2 to 4.4.3 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.4.2 to 4.4.3. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.4.2...v4.4.3) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5fbcb2fd..a00eab70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1665,9 +1665,9 @@ } }, "commander": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.1.tgz", - "integrity": "sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "optional": true }, "component-emitter": { @@ -4197,9 +4197,9 @@ } }, "handlebars": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.2.tgz", - "integrity": "sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.3.tgz", + "integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==", "requires": { "neo-async": "^2.6.0", "optimist": "^0.6.1", @@ -7380,12 +7380,12 @@ "dev": true }, "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.1.tgz", + "integrity": "sha512-+dSJLJpXBb6oMHP+Yvw8hUgElz4gLTh82XuX68QiJVTXaE5ibl6buzhNkQdYhBlIhozWOC9ge16wyRmjG4TwVQ==", "optional": true, "requires": { - "commander": "~2.20.0", + "commander": "2.20.0", "source-map": "~0.6.1" }, "dependencies": { diff --git a/package.json b/package.json index e0e4286a..282d5bd3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", - "handlebars": "^4.4.2", + "handlebars": "^4.4.3", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", "mongoose": "^5.7.3", From dc69f545c2442afb4b428567763985caef1c6006 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2019 20:43:23 +0000 Subject: [PATCH 156/243] Bump mongoose from 5.7.3 to 5.7.4 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.7.3...5.7.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a00eab70..e404b762 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5576,9 +5576,9 @@ } }, "mongoose": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.3.tgz", - "integrity": "sha512-CKCCCAhFnJRtmdmver8Ud9/NZ9m7D2H/xLgmrcL6cb9D4nril/idL8lsWWpBsJI81AOCVsktiZJ4X4vfo2S0fw==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.4.tgz", + "integrity": "sha512-IgqQS5HIaZ8tG2cib6QllfIw2Wc/A0QVOsdKLsSqRolqJFWOjI0se3vsKXLNkbEcuJ1xziW3e/jPhBs65678Hg==", "requires": { "bson": "~1.1.1", "kareem": "2.3.1", diff --git a/package.json b/package.json index 282d5bd3..ab49345c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.4.3", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.7.3", + "mongoose": "^5.7.4", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From 3b920888b89233e91d32bf4f31b7eaff8ab648af Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2019 00:26:31 +0000 Subject: [PATCH 157/243] Bump @types/mongoose from 5.5.19 to 5.5.20 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.19 to 5.5.20. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e404b762..764f61b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -655,9 +655,9 @@ } }, "@types/mongoose": { - "version": "5.5.19", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.19.tgz", - "integrity": "sha512-VIT+chW2nMHKK5vleT5PKOt8i72PwFbSHAKDKL0RQ9QcXvUex9LtR0Mq4nAI3WM8AwvvJqwFUCk4XY4r+PZlQA==", + "version": "5.5.20", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.20.tgz", + "integrity": "sha512-vaLVDjfuNp2LMfqHGMss4hN/K9puZfql/Rh6yXFvJvex3jKP646CXtvSKT8FM9uOUb2P4me266fmpPovBhEJXQ==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index ab49345c..45e5d836 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.19", + "@types/mongoose": "^5.5.20", "@types/multer": "^1.3.10", "apidoc": "^0.17.7", "chai": "^4.2.0", From 40b1de8f2ad40c3ce06929c54e4beabcedc74e69 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2019 19:59:19 +0000 Subject: [PATCH 158/243] Bump mongoose from 5.7.4 to 5.7.5 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.7.4 to 5.7.5. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.7.4...5.7.5) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 764f61b3..a7f5e235 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5576,9 +5576,9 @@ } }, "mongoose": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.4.tgz", - "integrity": "sha512-IgqQS5HIaZ8tG2cib6QllfIw2Wc/A0QVOsdKLsSqRolqJFWOjI0se3vsKXLNkbEcuJ1xziW3e/jPhBs65678Hg==", + "version": "5.7.5", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.5.tgz", + "integrity": "sha512-BZ4FxtnbTurc/wcm/hLltLdI4IDxo4nsE0D9q58YymTdZwreNzwO62CcjVtaHhmr8HmJtOInp2W/T12FZaMf8g==", "requires": { "bson": "~1.1.1", "kareem": "2.3.1", diff --git a/package.json b/package.json index 45e5d836..d02e23c2 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "handlebars": "^4.4.3", "jsonwebtoken": "^8.5.1", "memory-cache": "^0.2.0", - "mongoose": "^5.7.4", + "mongoose": "^5.7.5", "multer": "^1.4.2", "passport": "^0.4.0", "passport-local": "^1.0.0", From d9f6e2d393a35c7fd8fafc85fc367ed210a4dbdd Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2019 20:02:05 +0000 Subject: [PATCH 159/243] Bump @google-cloud/storage from 3.3.1 to 3.4.0 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.3.1 to 3.4.0. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.3.1...v3.4.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 84 ++++++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 58 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7f5e235..c57c8594 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.3.1.tgz", - "integrity": "sha512-+OoVaJbETDh9cyDoRGe1MJE2Rhrd6JXjSP7GVpdxCUkwYw8pLll/Oz+84JEB82GebQlxG+GVHGcKYTVcSobB5g==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.4.0.tgz", + "integrity": "sha512-y3oIUyuerq/+a6/SmPFVXGdddKgoMzmI5F1eEAh272iqgg6rkoyCuTwk1Ou/eOaq7oJONVm/Q/dSRphy/bMWpw==", "requires": { "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", @@ -283,24 +283,24 @@ } }, "gcp-metadata": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.0.0.tgz", - "integrity": "sha512-WP5/TZWri9TrD41jNr8ukY9dKYLL+8jwQVwbtUbmprjWuyybdnJNkbXbwqD2sdbXIVXD1WCqzfj7QftSLB6K8Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.0.tgz", + "integrity": "sha512-ympv+yQ6k5QuWCuwQqnGEvFGS7MBKdcQdj1i188v3bW9QLFIchTGaBCEZxSQapT0jffdn1vdt8oJhB5VBWQO1Q==", "requires": { "gaxios": "^2.0.1", "json-bigint": "^0.3.0" } }, "google-auth-library": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.3.0.tgz", - "integrity": "sha512-DnwwP18H6RVtvtmDjmPLipKyx8NsXTQNZcNYud+ueOYaWSVxXeaSFBiBxABb93S3Ae41R60SnaSc19rljeoAxQ==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.4.1.tgz", + "integrity": "sha512-0KsKBGvlPBNHBkLmw2dfYWDHTuCGCWJrDTzzbYbJO8/ZfcEQ4RJ9Xo1Tnba0a/ZCxPHUkpHqBMB/aRTvnNvxPg==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", - "gcp-metadata": "^3.0.0", + "gcp-metadata": "^3.2.0", "gtoken": "^4.1.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" @@ -3348,9 +3348,9 @@ } }, "gcs-resumable-upload": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.2.5.tgz", - "integrity": "sha512-r98Hnxza8oYT21MzpziAB2thz3AURGz54+osWtczxGNxH7Fodb0HVUEtfqTwBS5vcf9RnKwR7c0EMaI8R39feg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gcs-resumable-upload/-/gcs-resumable-upload-2.3.0.tgz", + "integrity": "sha512-PclXJiEngrVx0c4K0LfE1XOxhmOkBEy39Rrhspdn6jAbbwe4OQMZfjo7Z1LHBrh57+bNZeIN4M+BooYppCoHSg==", "requires": { "abort-controller": "^3.0.0", "configstore": "^5.0.0", @@ -3414,24 +3414,24 @@ } }, "gcp-metadata": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.0.0.tgz", - "integrity": "sha512-WP5/TZWri9TrD41jNr8ukY9dKYLL+8jwQVwbtUbmprjWuyybdnJNkbXbwqD2sdbXIVXD1WCqzfj7QftSLB6K8Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.0.tgz", + "integrity": "sha512-ympv+yQ6k5QuWCuwQqnGEvFGS7MBKdcQdj1i188v3bW9QLFIchTGaBCEZxSQapT0jffdn1vdt8oJhB5VBWQO1Q==", "requires": { "gaxios": "^2.0.1", "json-bigint": "^0.3.0" } }, "google-auth-library": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.3.0.tgz", - "integrity": "sha512-DnwwP18H6RVtvtmDjmPLipKyx8NsXTQNZcNYud+ueOYaWSVxXeaSFBiBxABb93S3Ae41R60SnaSc19rljeoAxQ==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.4.1.tgz", + "integrity": "sha512-0KsKBGvlPBNHBkLmw2dfYWDHTuCGCWJrDTzzbYbJO8/ZfcEQ4RJ9Xo1Tnba0a/ZCxPHUkpHqBMB/aRTvnNvxPg==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", "fast-text-encoding": "^1.0.0", "gaxios": "^2.0.0", - "gcp-metadata": "^3.0.0", + "gcp-metadata": "^3.2.0", "gtoken": "^4.1.0", "jws": "^3.1.5", "lru-cache": "^5.0.0" @@ -4291,9 +4291,9 @@ } }, "hash-stream-validation": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/hash-stream-validation/-/hash-stream-validation-0.2.1.tgz", - "integrity": "sha1-7Mm5l7IYvluzEphii7gHhptz3NE=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/hash-stream-validation/-/hash-stream-validation-0.2.2.tgz", + "integrity": "sha512-cMlva5CxWZOrlS/cY0C+9qAzesn5srhFA8IT1VPiHc9bWWBLkJfEUIZr7MWoi89oOOGmpg8ymchaOjiArsGu5A==", "requires": { "through2": "^2.0.0" } @@ -7163,17 +7163,47 @@ } }, "teeny-request": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.2.1.tgz", - "integrity": "sha512-gCVm5EV3z0p/yZOKyeBOFOpSXuxdIs3foeWDWb/foKMBejK18w40L0k0UMd/ZrGkOH+gxodjqpL8KK6x3haYCQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.3.0.tgz", + "integrity": "sha512-sN9E3JvEBe2CFqB/jpJpw1erWD1C7MxyYCxogHFCQSyZfkHYcdf4wzVQSw7FZxbwcfnS+FP0W9BS0mp6SEOKjg==", "requires": { "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.1", + "https-proxy-agent": "^3.0.0", "node-fetch": "^2.2.0", "stream-events": "^1.0.5", "uuid": "^3.3.2" }, "dependencies": { + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "https-proxy-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.0.tgz", + "integrity": "sha512-y4jAxNEihqvBI5F3SaO2rtsjIOnnNA8sEbuiP+UhJZJHeM2NRm6c09ax2tgqme+SgUUvjao2fJXF4h3D6Cb2HQ==", + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "stream-events": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", diff --git a/package.json b/package.json index d02e23c2..549ab40a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.3.1", + "@google-cloud/storage": "^3.4.0", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 7fca70b7f9bc01e53f1d5187103471d06abd3e42 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2019 23:48:14 +0000 Subject: [PATCH 160/243] Bump @types/mongoose from 5.5.20 to 5.5.21 Bumps [@types/mongoose](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mongoose) from 5.5.20 to 5.5.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mongoose) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index c57c8594..1b54e287 100644 --- a/package-lock.json +++ b/package-lock.json @@ -655,9 +655,9 @@ } }, "@types/mongoose": { - "version": "5.5.20", - "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.20.tgz", - "integrity": "sha512-vaLVDjfuNp2LMfqHGMss4hN/K9puZfql/Rh6yXFvJvex3jKP646CXtvSKT8FM9uOUb2P4me266fmpPovBhEJXQ==", + "version": "5.5.21", + "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.5.21.tgz", + "integrity": "sha512-vQFa53WOqDmsQzzPGcOQE5F64RLJMBvHJoYdmQ6ksQdbbd5H1qssxeQArSnII45jbIvOPCOCNo+rdp5U/NPtkA==", "dev": true, "requires": { "@types/mongodb": "*", diff --git a/package.json b/package.json index 549ab40a..90ec9bf4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@types/express": "^4.17.1", "@types/google-cloud__storage": "^1.7.2", "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.20", + "@types/mongoose": "^5.5.21", "@types/multer": "^1.3.10", "apidoc": "^0.17.7", "chai": "^4.2.0", From 93721c52e06c9cf624d26f12e782a20d61afd634 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2019 23:49:34 +0000 Subject: [PATCH 161/243] Bump nodemon from 1.19.3 to 1.19.4 Bumps [nodemon](https://github.com/remy/nodemon) from 1.19.3 to 1.19.4. - [Release notes](https://github.com/remy/nodemon/releases) - [Commits](https://github.com/remy/nodemon/compare/v1.19.3...v1.19.4) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 37 ++++++++++++++++++++++++++----------- package.json | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b54e287..84aba3ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5763,18 +5763,18 @@ } }, "nodemon": { - "version": "1.19.3", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.3.tgz", - "integrity": "sha512-TBNKRmJykEbxpTniZBusqRrUTHIEqa2fpecbTQDQj1Gxjth7kKAPP296ztR0o5gPUWsiYbuEbt73/+XMYab1+w==", + "version": "1.19.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.19.4.tgz", + "integrity": "sha512-VGPaqQBNk193lrJFotBU8nvWZPqEZY2eIzymy2jjY0fJ9qIsxA0sxQ8ATPl0gZC645gijYEc1jtZvpS8QWzJGQ==", "dev": true, "requires": { - "chokidar": "^2.1.5", - "debug": "^3.1.0", + "chokidar": "^2.1.8", + "debug": "^3.2.6", "ignore-by-default": "^1.0.1", "minimatch": "^3.0.4", - "pstree.remy": "^1.1.6", - "semver": "^5.5.0", - "supports-color": "^5.2.0", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", "touch": "^3.1.0", "undefsafe": "^2.0.2", "update-notifier": "^2.5.0" @@ -5794,6 +5794,21 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -7641,9 +7656,9 @@ "integrity": "sha512-0Twghia4Z5wDGDYWURlhZmI47GvERMCsXIu0QZWVVZyW9ZjpbbZvD9Zy9M6cWiQQRRbAcYajIyKNavaZZDt1Uw==" }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" diff --git a/package.json b/package.json index 90ec9bf4..b4e9ff94 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,6 @@ "jshint": "^2.10.2", "jslint": "^0.12.1", "mocha": "^6.2.1", - "nodemon": "^1.19.3" + "nodemon": "^1.19.4" } } From 6845845ac253202024fd6d079f39666ae62b9bbc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2019 23:50:48 +0000 Subject: [PATCH 162/243] Bump @google-cloud/storage from 3.4.0 to 3.5.0 Bumps [@google-cloud/storage](https://github.com/googleapis/nodejs-storage) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/googleapis/nodejs-storage/releases) - [Changelog](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/nodejs-storage/compare/v3.4.0...v3.5.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84aba3ca..0846718b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -192,9 +192,9 @@ "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==" }, "@google-cloud/storage": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.4.0.tgz", - "integrity": "sha512-y3oIUyuerq/+a6/SmPFVXGdddKgoMzmI5F1eEAh272iqgg6rkoyCuTwk1Ou/eOaq7oJONVm/Q/dSRphy/bMWpw==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-3.5.0.tgz", + "integrity": "sha512-QxJ/zft4Kxbedpu7MQ5ZsNeS5WbonB7H28T32R4hQO2ply/j6n7bXmd5Vz0kzJu/iub20sK/ibgxYoxrgZD6CQ==", "requires": { "@google-cloud/common": "^2.1.1", "@google-cloud/paginator": "^2.0.0", @@ -292,9 +292,9 @@ } }, "google-auth-library": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.4.1.tgz", - "integrity": "sha512-0KsKBGvlPBNHBkLmw2dfYWDHTuCGCWJrDTzzbYbJO8/ZfcEQ4RJ9Xo1Tnba0a/ZCxPHUkpHqBMB/aRTvnNvxPg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.5.0.tgz", + "integrity": "sha512-TNeraw4miu6/FhO0jDrHiJuRx3SBrAhxHSPj7+rhif43bKE34UItXX9lejKxo3E8FNytuY4LIVIvpcqMQHSYZw==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", @@ -3423,9 +3423,9 @@ } }, "google-auth-library": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.4.1.tgz", - "integrity": "sha512-0KsKBGvlPBNHBkLmw2dfYWDHTuCGCWJrDTzzbYbJO8/ZfcEQ4RJ9Xo1Tnba0a/ZCxPHUkpHqBMB/aRTvnNvxPg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.5.0.tgz", + "integrity": "sha512-TNeraw4miu6/FhO0jDrHiJuRx3SBrAhxHSPj7+rhif43bKE34UItXX9lejKxo3E8FNytuY4LIVIvpcqMQHSYZw==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", diff --git a/package.json b/package.json index b4e9ff94..ae567150 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.4.0", + "@google-cloud/storage": "^3.5.0", "@sendgrid/mail": "^6.4.0", "bcrypt": "^3.0.6", "cookie-parser": "~1.4.4", From 0904a1818c264ff3b95316581fdd044db89be047 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2019 09:08:51 +0000 Subject: [PATCH 163/243] Bump dotenv from 8.1.0 to 8.2.0 Bumps [dotenv](https://github.com/motdotla/dotenv) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/motdotla/dotenv/releases) - [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/motdotla/dotenv/compare/v8.1.0...v8.2.0) Signed-off-by: dependabot-preview[bot] --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0846718b..ad884d92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2135,9 +2135,9 @@ } }, "dotenv": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz", - "integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==" + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" }, "duplexer3": { "version": "0.1.4", diff --git a/package.json b/package.json index ae567150..e745de4a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "cors": "^2.8.5", "cryptiles": "^4.1.3", "debug": "~4.1.1", - "dotenv": "^8.1.0", + "dotenv": "^8.2.0", "express": "~4.17.1", "express-validator": "^6.2.0", "express-winston": "^2.6.0", From fc763edab75c812f5632ad5815fb506945b422aa Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Sat, 16 Nov 2019 18:11:30 -0500 Subject: [PATCH 164/243] Set back to account confirmation on email change --- controllers/account.controller.js | 1 + middlewares/account.middleware.js | 12 ++++++++++-- routes/api/account.js | 27 ++++++++++++++------------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/controllers/account.controller.js b/controllers/account.controller.js index 740cf072..44e0cff7 100644 --- a/controllers/account.controller.js +++ b/controllers/account.controller.js @@ -50,6 +50,7 @@ function addUser(req, res) { * The id is moved to req.body.id from req.params.id by validation. */ function updatedAccount(req, res) { + delete req.body.account; return res.status(200).json({ message: Constants.Success.ACCOUNT_UPDATE, data: req.body diff --git a/middlewares/account.middleware.js b/middlewares/account.middleware.js index 6233af93..2f2e5ceb 100644 --- a/middlewares/account.middleware.js +++ b/middlewares/account.middleware.js @@ -159,8 +159,16 @@ async function addAccount(req, res, next) { * @param {*} next */ async function updateAccount(req, res, next) { - const account = await Services.Account.updateOne(req.params.id, req.body); - if (account) { + var account = await Services.Account.findById(req.params.id) + + // If we are changing the email, and there is a difference between the two, set back to unconfirmed status. + if (req.body.email && account.email != req.body.email) { + req.body.confirmed = false + } + + req.body.account = await Services.Account.updateOne(req.params.id, req.body); + + if (req.body.account) { return next(); } else { return next({ diff --git a/routes/api/account.js b/routes/api/account.js index f394e43b..ac3d0fd3 100644 --- a/routes/api/account.js +++ b/routes/api/account.js @@ -21,7 +21,7 @@ const Services = { }; module.exports = { - activate: function(apiRouter) { + activate: function (apiRouter) { const accountRouter = express.Router(); /** @@ -170,12 +170,12 @@ module.exports = { } */ accountRouter.route("/invite").post( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Account.inviteAccountValidator, - Middleware.parseBody.middleware, - Middleware.Account.inviteAccount, - Controllers.Account.invitedAccount + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Validator.Account.inviteAccountValidator, + Middleware.parseBody.middleware, + Middleware.Account.inviteAccount, + Controllers.Account.invitedAccount ); /** * @api {get} /account/invite Get all of the invites. @@ -193,11 +193,11 @@ module.exports = { } */ accountRouter.route("/invite").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.parseBody.middleware, - Middleware.Account.getInvites, - Controllers.Account.gotInvites + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.parseBody.middleware, + Middleware.Account.getInvites, + Controllers.Account.gotInvites ); /** @@ -223,7 +223,7 @@ module.exports = { * @apiSuccess {object} data Account object * @apiSuccessExample {object} Success-Response: * { - "message": "Changed account information", + "message": "Account update successful.", "data": { "id": ObjectId("5bff8b9f3274cf001bc71048"), "firstName": "Theo", @@ -253,6 +253,7 @@ module.exports = { Middleware.Account.parsePatch, Middleware.Account.updateAccount, + Middleware.Auth.sendConfirmAccountEmailMiddleware, // no parse account because will use req.body as information // because the number of fields will be variable Controllers.Account.updatedAccount From 99863b02adce20fc817af604536304c6e551a7fe Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Sat, 16 Nov 2019 19:15:31 -0500 Subject: [PATCH 165/243] Reduced middleware function name --- middlewares/auth.middleware.js | 4 ++-- routes/api/account.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/middlewares/auth.middleware.js b/middlewares/auth.middleware.js index 2b42f181..3ac2b5ef 100644 --- a/middlewares/auth.middleware.js +++ b/middlewares/auth.middleware.js @@ -191,7 +191,7 @@ async function sendResetPasswordEmailMiddleware(req, res, next) { * @param {*} res * @param {(err?)=>void} next */ -async function sendConfirmAccountEmailMiddleware(req, res, next) { +async function sendConfirmAccountEmail(req, res, next) { const account = req.body.account; if (account.confirmed) { return next(); @@ -455,7 +455,7 @@ module.exports = { parseResetToken: parseResetToken, validateResetToken: Middleware.Util.asyncMiddleware(validateResetToken), deleteResetToken: deleteResetToken, - sendConfirmAccountEmailMiddleware: Middleware.Util.asyncMiddleware(sendConfirmAccountEmailMiddleware), + sendConfirmAccountEmail: Middleware.Util.asyncMiddleware(sendConfirmAccountEmail), parseAccountConfirmationToken: parseAccountConfirmationToken, validateConfirmationToken: Middleware.Util.asyncMiddleware(validateConfirmationToken), getAccountTypeFromConfirmationToken: Middleware.Util.asyncMiddleware(getAccountTypeFromConfirmationToken), diff --git a/routes/api/account.js b/routes/api/account.js index ac3d0fd3..88366da1 100644 --- a/routes/api/account.js +++ b/routes/api/account.js @@ -137,7 +137,7 @@ module.exports = { // middleware to create a hacker token // and send a confirmation message - Middleware.Auth.sendConfirmAccountEmailMiddleware, + Middleware.Auth.sendConfirmAccountEmail, // should return status in this function Controllers.Account.addUser ); @@ -253,7 +253,7 @@ module.exports = { Middleware.Account.parsePatch, Middleware.Account.updateAccount, - Middleware.Auth.sendConfirmAccountEmailMiddleware, + Middleware.Auth.sendConfirmAccountEmail, // no parse account because will use req.body as information // because the number of fields will be variable Controllers.Account.updatedAccount From 225e15e0cc12b9d02093f8b414c960355a479c83 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Thu, 21 Nov 2019 15:36:54 -0500 Subject: [PATCH 166/243] Added tests and verified confirmed status of hacker on most hacker routes --- constants/testMongoId.constant.js | 3 +- middlewares/hacker.middleware.js | 47 ++++++-- routes/api/hacker.js | 58 +++++----- tests/hacker.test.js | 163 +++++++++++++++++++++++++++- tests/util/account.test.util.js | 5 + tests/util/hacker.test.util.js | 29 +++++ tests/util/roleBinding.test.util.js | 3 + 7 files changed, 272 insertions(+), 36 deletions(-) diff --git a/constants/testMongoId.constant.js b/constants/testMongoId.constant.js index faebd1a3..5e8c74be 100644 --- a/constants/testMongoId.constant.js +++ b/constants/testMongoId.constant.js @@ -13,7 +13,7 @@ const hackerDId = mongoose.Types.ObjectId(); const hackerEId = mongoose.Types.ObjectId(); const hackerFId = mongoose.Types.ObjectId(); const hackerGId = mongoose.Types.ObjectId(); - +const hackerHId = mongoose.Types.ObjectId(); module.exports = { team1Id: team1Id, @@ -26,4 +26,5 @@ module.exports = { hackerEId: hackerEId, hackerFId: hackerFId, hackerGId: hackerGId, + hackerHId: hackerHId, }; \ No newline at end of file diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 93b49ca3..ec3ae8ae 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -129,13 +129,11 @@ function addDefaultStatus(req, res, next) { } /** - * Verifies that account is confirmed and of proper type from the account ID passed in req.body.accountId - * @param {{body: {accountId: ObjectId}}} req - * @param {*} res + * Helper function that validates if account is confirmed and is of proper type + * @param account account object containing the information for an account * @param {(err?) => void} next */ -async function validateConfirmedStatus(req, res, next) { - const account = await Services.Account.findById(req.body.accountId); +async function validateConfirmedStatus(account, next) { if (!account) { return next({ status: 404, @@ -158,6 +156,39 @@ async function validateConfirmedStatus(req, res, next) { } } +/** + * Verifies that account is confirmed and of proper type from the account ID passed in req.body.accountId + * @param {{body: {accountId: ObjectId}}} req + * @param {*} res + * @param {(err?) => void} next + */ +async function validateConfirmedStatusFromAccountId(req, res, next) { + const account = await Services.Account.findById(req.body.accountId); + return validateConfirmedStatus(account, next); +} + +/** + * Verifies that account is confirmed and of proper type from the hacker ID passed in req.params.id + * @param {{params: {id: ObjectId}}} req + * @param {*} res + * @param {(err?) => void} next + */ +async function validateConfirmedStatusFromHackerId(req, res, next) { + const hacker = await Services.Hacker.findById(req.params.id); + const account = await Services.Account.findById(hacker.accountId); + return validateConfirmedStatus(account, next); +} + +/** + * Verifies that account is confirmed and of proper type from the account object passed in req.body.account + * @param {{body: {account: Object}}} req + * @param {*} res + * @param {(err?) => void} next + */ +async function validateConfirmedStatusFromObject(req, res, next) { + return validateConfirmedStatus(req.body.account, next); +} + /** * @async * @function findById @@ -527,7 +558,7 @@ async function checkDuplicateAccountLinks(req, res, next) { * @param {(err?)=>void} next */ async function findSelf(req, res, next) { - if (req.user.accountType != Constants.General.HACKER) { + if (req.user.accountType != Constants.General.HACKER || !req.user.confirmed) { return next({ status: 409, message: Constants.Error.ACCOUNT_TYPE_409_MESSAGE, @@ -571,7 +602,9 @@ module.exports = { sendStatusUpdateEmail: Middleware.Util.asyncMiddleware(sendStatusUpdateEmail), sendAppliedStatusEmail: Middleware.Util.asyncMiddleware(sendAppliedStatusEmail), updateHacker: Middleware.Util.asyncMiddleware(updateHacker), - validateConfirmedStatus: Middleware.Util.asyncMiddleware(validateConfirmedStatus), + validateConfirmedStatusFromAccountId: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromAccountId), + validateConfirmedStatusFromHackerId: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromHackerId), + validateConfirmedStatusFromObject: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromObject), checkDuplicateAccountLinks: Middleware.Util.asyncMiddleware(checkDuplicateAccountLinks), updateStatusIfApplicationCompleted: Middleware.Util.asyncMiddleware(updateStatusIfApplicationCompleted), checkStatus: checkStatus, diff --git a/routes/api/hacker.js b/routes/api/hacker.js index b0289e35..544dd1f0 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -23,7 +23,7 @@ const Services = { const CONSTANTS = require("../../constants/general.constant"); module.exports = { - activate: function(apiRouter) { + activate: function (apiRouter) { const hackerRouter = express.Router(); /** @@ -156,7 +156,7 @@ module.exports = { Middleware.parseBody.middleware, // validate type - Middleware.Hacker.validateConfirmedStatus, + Middleware.Hacker.validateConfirmedStatusFromAccountId, // validate that the accountId is not being used for any other thing Middleware.Hacker.checkDuplicateAccountLinks, @@ -205,15 +205,15 @@ module.exports = { * */ hackerRouter.route("/stats").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.statsValidator, - Middleware.parseBody.middleware, - Middleware.Search.setExpandTrue, - Middleware.Search.parseQuery, - Middleware.Search.executeQuery, - Middleware.Hacker.getStats, - Controllers.Hacker.gotStats + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Validator.Hacker.statsValidator, + Middleware.parseBody.middleware, + Middleware.Search.setExpandTrue, + Middleware.Search.parseQuery, + Middleware.Search.executeQuery, + Middleware.Hacker.getStats, + Controllers.Hacker.gotStats ); /** @@ -235,15 +235,16 @@ module.exports = { * @apiPermission Administrator */ hackerRouter.route("/status/:id").patch( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.Hacker.updateStatusValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, - Middleware.Hacker.updateHacker, - Middleware.Hacker.sendStatusUpdateEmail, - Controllers.Hacker.updatedHacker + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + Middleware.Validator.Hacker.updateStatusValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, + Middleware.Hacker.validateConfirmedStatusFromHackerId, + Middleware.Hacker.updateHacker, + Middleware.Hacker.sendStatusUpdateEmail, + Controllers.Hacker.updatedHacker ); /** @@ -271,7 +272,7 @@ module.exports = { Middleware.parseBody.middleware, Middleware.Hacker.parsePatch, - + Middleware.Hacker.validateConfirmedStatusFromHackerId, Middleware.Hacker.checkStatus([ CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED @@ -358,6 +359,7 @@ module.exports = { Middleware.parseBody.middleware, Middleware.Hacker.parsePatch, + Middleware.Hacker.validateConfirmedStatusFromHackerId, Middleware.Hacker.updateHacker, Middleware.Hacker.updateStatusIfApplicationCompleted, @@ -579,7 +581,7 @@ module.exports = { Middleware.Validator.Hacker.updateConfirmationValidator, Middleware.parseBody.middleware, Middleware.Hacker.parsePatch, - + Middleware.Hacker.validateConfirmedStatusFromHackerId, Middleware.Hacker.checkStatus([ CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED, @@ -595,7 +597,7 @@ module.exports = { /** * @api {post} /hacker/email/weekOf/:id - * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. + * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in. * @apiName postHackerSendWeekOfEmail * @apiGroup Hacker * @apiVersion 0.0.9 @@ -617,6 +619,7 @@ module.exports = { Middleware.parseBody.middleware, Middleware.Hacker.findById, + Middleware.Hacker.validateConfirmedStatusFromHackerId, Middleware.Hacker.checkStatus([ CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CHECKED_IN @@ -626,9 +629,9 @@ module.exports = { ); /** - * @api {post} /hacker/email/weekOf/:id - * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. - * @apiName postHackerSendWeekOfEmail + * @api {post} /hacker/email/dayOf/:id + * @apiDescription Sends a hacker the day-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in. + * @apiName postHackerSendDayOfEmail * @apiGroup Hacker * @apiVersion 0.0.9 * @@ -637,7 +640,7 @@ module.exports = { * @apiSuccess {object} data empty * @apiSuccessExample {object} Success-Response: * { - * "message": "Hacker week-of email sent.", + * "message": "Hacker day-of email sent.", * "data": {} * } * @apiPermission Administrator @@ -649,6 +652,7 @@ module.exports = { Middleware.parseBody.middleware, Middleware.Hacker.findById, + Middleware.Hacker.validateConfirmedStatusFromHackerId, Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CHECKED_IN]), Middleware.Hacker.sendDayOfEmail, Controllers.Hacker.sentDayOfEmail diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 2953af27..52c9e19b 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -41,6 +41,11 @@ const TeamHacker0 = util.hacker.TeamHacker0; const TeamHacker1 = util.hacker.TeamHacker1; const duplicateAccountLinkHacker0 = util.hacker.duplicateAccountLinkHacker0; +const unconfirmedHackerAccount1 = util.account.hackerAccounts.stored.unconfirmed[0]; +const unconfirmedHackerAccount0 = util.hacker.unconfirmedAccountHacker0; + +const unconfirmedHacker1 = util.hacker.unconfirmedAccountHacker1; + const invalidHacker1 = util.hacker.invalidHacker1; describe("GET hacker", function () { @@ -102,6 +107,25 @@ describe("GET hacker", function () { }); }); + // fail case due to unconfirmed email address of already defined hacker + it("should fail to list the user's hacker info due to unconfirmed email on /api/hacker/self GET", function (done) { + util.auth.login(agent, unconfirmedHackerAccount1, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/hacker/self") + .end(function (err, res) { + res.should.have.status(409); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_TYPE_409_MESSAGE); + done(); + }); + }); + }); + // succeed on admin case it("should list a hacker's information using admin power on /api/hacker/:id GET", function (done) { util.auth.login(agent, Admin0, (error) => { @@ -406,7 +430,7 @@ describe("POST create hacker", function () { return agent .post(`/api/hacker/`) .type("application/json") - .send(util.hacker.unconfirmedAccountHacker0) + .send(unconfirmedHackerAccount0) .end(function (err, res) { res.should.be.json; res.body.should.have.property("message"); @@ -552,6 +576,30 @@ describe("PATCH update one hacker", function () { }); }); + // hacker changed email, thus cannot change their status until they confirm email + it("should FAIL and NOT update a hacker STATUS as a Hacker due to unconfirmed email", function (done) { + util.auth.login(agent, Admin0, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/status/${unconfirmedHacker1._id}`) + .type("application/json") + .send({ + status: "Waitlisted" + }) + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); + // volunteer should successfully checkin hacker it("should SUCCEED and check in hacker as a volunteer", function (done) { util.auth.login(agent, volunteerAccount0, (error) => { @@ -603,6 +651,30 @@ describe("PATCH update one hacker", function () { }); }); + // hacker should fail to checkin hacker due to unconfirmed email + it("should FAIL to check in hacker as a volunteer due to unconfirmed email", function (done) { + util.auth.login(agent, volunteerAccount0, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/checkin/${unconfirmedHacker1._id}`) + .type("application/json") + .send({ + status: "Checked-in" + }) + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); + // should succeed on hacker case it("should SUCCEED and update the user's hacker info", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { @@ -630,6 +702,30 @@ describe("PATCH update one hacker", function () { }); }); + // should fail to change hacker data with an unconfirmed email + it("should FAIL and FAIL to update the user's hacker info due to unconfirmed email", function (done) { + util.auth.login(agent, unconfirmedHackerAccount1, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/${unconfirmedHacker1._id}`) + .type("application/json") + .send({ + gender: "Other" + }) + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); + // should fail due to authorization it("should Fail to update hacker info due to lack of authorization", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { @@ -710,6 +806,33 @@ describe("PATCH update one hacker", function () { }); }); + // Fail and don't change to accepted + it("should fail for hacker to update their own status from accepted to confirmed due to unconfirmed email", function (done) { + util.auth.login(agent, unconfirmedHackerAccount1, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/confirmation/${unconfirmedHacker1._id}`) + .type("application/json") + .send({ + confirm: true + }) + .end(function (err, res) { + if (err) { + return done(err); + } + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); + // Succeed and change confirmed to accepted it("should succeed for hacker to update their own status from confirmed to accepted", function (done) { util.auth.login(agent, teamHackerAccount0, (error) => { @@ -964,6 +1087,25 @@ describe("POST send week-of email", function () { }); }); }); + + it("It should FAIL to send the week-of email due to unconfirmed email of hacker", function (done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, (error) => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/weekOf/${unconfirmedHacker1._id}`) + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); }); describe("POST send day-of email", function () { @@ -1016,4 +1158,23 @@ describe("POST send day-of email", function () { }); }); }); + + it("It should FAIL to send the day-of email due to unconfirmed email of hacker", function (done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, (error) => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/dayOf/${unconfirmedHacker1._id}`) + .end(function (err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + }); }); \ No newline at end of file diff --git a/tests/util/account.test.util.js b/tests/util/account.test.util.js index 87b5decd..6d5005f7 100644 --- a/tests/util/account.test.util.js +++ b/tests/util/account.test.util.js @@ -108,6 +108,10 @@ let hackerAccounts = { "accountType": Constants.HACKER, "confirmed": true, }), + unconfirmed: createNAccounts(5, { + "accountType": Constants.HACKER, + "confirmed": false, + }), }, invalid: createNAccounts(10, { "accountType": Constants.HACKER @@ -313,6 +317,7 @@ function store(attributes) { async function storeAll() { await store(hackerAccounts.stored.team); await store(hackerAccounts.stored.noTeam); + await store(hackerAccounts.stored.unconfirmed); await store(volunteerAccounts.stored); await store(staffAccounts.stored); await store(sponsorT1Accounts.stored); diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index a34c6565..7cf16465 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -355,6 +355,33 @@ const unconfirmedAccountHacker0 = { "codeOfConduct": true, }; +const unconfirmedAccountHacker1 = { + "_id": Constants.MongoId.hackerHId, + "accountId": Util.Account.hackerAccounts.stored.unconfirmed[0]._id, + "status": "Accepted", + "school": "University of Blah2", + "degree": "Underggraduate", + "gender": "Female", + "needsBus": false, + "application": { + "portfolioURL": { + //gcloud bucket link + "resume": "www.gcloud.com/myResume123", + "github": "www.github.com/Personasdf", + "dropler": undefined, + "personal": undefined, + "linkedIn": undefined, + "other": undefined + }, + "jobInterest": "Internship", + "skills": ["CSS", "HTML", "JS"], + }, + "ethnicity": ["European"], + "major": ["EE"], + "graduationYear": 2019, + "codeOfConduct": true, +}; + const Hackers = [ TeamHacker0, TeamHacker1, @@ -363,6 +390,7 @@ const Hackers = [ TeamHacker4, NoTeamHacker0, + unconfirmedAccountHacker1, duplicateAccountLinkHacker0, waitlistedHacker0 @@ -386,6 +414,7 @@ module.exports = { duplicateAccountLinkHacker0: duplicateAccountLinkHacker0, waitlistedHacker0: waitlistedHacker0, unconfirmedAccountHacker0: unconfirmedAccountHacker0, + unconfirmedAccountHacker1: unconfirmedAccountHacker1, Hackers: Hackers, storeAll: storeAll, diff --git a/tests/util/roleBinding.test.util.js b/tests/util/roleBinding.test.util.js index 8d3b42b8..721d5691 100644 --- a/tests/util/roleBinding.test.util.js +++ b/tests/util/roleBinding.test.util.js @@ -61,6 +61,7 @@ function createRoleBindings(accounts) { const TeamHackerRB = createRoleBindings(Util.Account.hackerAccounts.stored.team); const NoTeamHackerRB = createRoleBindings(Util.Account.hackerAccounts.stored.noTeam); +const UnconfirmedHackerRB = createRoleBindings(Util.Account.hackerAccounts.stored.unconfirmed); const VolunteerRB = createRoleBindings(Util.Account.volunteerAccounts.stored); const StaffRB = createRoleBindings(Util.Account.staffAccounts.stored); const SponsorT1RB = createRoleBindings(Util.Account.sponsorT1Accounts.stored); @@ -98,6 +99,7 @@ function store(attributes) { async function storeAll() { await store(TeamHackerRB); await store(NoTeamHackerRB); + await store(UnconfirmedHackerRB); await store(VolunteerRB); await store(StaffRB); await store(SponsorT1RB); @@ -132,6 +134,7 @@ async function dropAll() { module.exports = { TeamHackerRB: TeamHackerRB, NoTeamHackerRB: NoTeamHackerRB, + UnconfirmedHackerRB: UnconfirmedHackerRB, VolunteerRB: VolunteerRB, StaffRB: StaffRB, SponsorT1RB: SponsorT1RB, From 9e1a86cac850ca2f607e32eae4fae71658fa0235 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Thu, 21 Nov 2019 17:43:16 -0500 Subject: [PATCH 167/243] Fixed all females test due to new hacker stored --- middlewares/account.middleware.js | 3 ++- tests/search.service.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/middlewares/account.middleware.js b/middlewares/account.middleware.js index 2f2e5ceb..e96bc54a 100644 --- a/middlewares/account.middleware.js +++ b/middlewares/account.middleware.js @@ -68,7 +68,8 @@ function parseAccount(req, res, next) { delete req.body.phoneNumber; req.body.accountDetails = accountDetails; - + console.log(req.body.accountDetails) + console.log(req.body) return next(); } diff --git a/tests/search.service.spec.js b/tests/search.service.spec.js index 78bf1d59..7acddbe3 100644 --- a/tests/search.service.spec.js +++ b/tests/search.service.spec.js @@ -102,7 +102,7 @@ describe("Searching for hackers", function () { .end(function (err, res) { res.should.have.status(200); res.body.should.have.property("data"); - res.body.data.should.have.length(6); + res.body.data.should.have.length(7); done(); }); }); @@ -281,7 +281,7 @@ describe("Searching for hackers", function () { .end(function (err, res) { res.should.have.status(200); res.body.should.have.property("data"); - res.body.data.should.have.length(6); + res.body.data.should.have.length(7); res.body.data[0].should.have.property("accountId"); res.body.data[0].accountId.should.have.property("email"); done(); From 44a992db9861974e77e3cc3b0069bf8a1e1440c6 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Tue, 26 Nov 2019 14:52:58 -0500 Subject: [PATCH 168/243] addressed code review nits, changed all lowercase should fails to should FAIL --- middlewares/account.middleware.js | 3 +-- tests/account.test.js | 12 +++++------ tests/hacker.test.js | 36 +++++++++++++++---------------- tests/role.test.js | 2 +- tests/settings.test.js | 4 ++-- tests/sponsor.test.js | 14 ++++++------ tests/volunteer.test.js | 4 ++-- 7 files changed, 37 insertions(+), 38 deletions(-) diff --git a/middlewares/account.middleware.js b/middlewares/account.middleware.js index e96bc54a..cb609b7a 100644 --- a/middlewares/account.middleware.js +++ b/middlewares/account.middleware.js @@ -68,8 +68,6 @@ function parseAccount(req, res, next) { delete req.body.phoneNumber; req.body.accountDetails = accountDetails; - console.log(req.body.accountDetails) - console.log(req.body) return next(); } @@ -163,6 +161,7 @@ async function updateAccount(req, res, next) { var account = await Services.Account.findById(req.params.id) // If we are changing the email, and there is a difference between the two, set back to unconfirmed status. + // TODO: When pull request for parse patch refactor #546 hits, req.body.email will not be present. if (req.body.email && account.email != req.body.email) { req.body.confirmed = false } diff --git a/tests/account.test.js b/tests/account.test.js index f718405f..b99c1cef 100644 --- a/tests/account.test.js +++ b/tests/account.test.js @@ -42,7 +42,7 @@ const newAccount0 = util.account.unlinkedAccounts.new[0]; describe("GET user account", function () { // fail on authentication - it("should fail to list the user's account on /api/account/self GET due to authentication", function (done) { + it("should FAIL to list the user's account on /api/account/self GET due to authentication", function (done) { chai.request(server.app) .get("/api/account/self") .end(function (err, res) { @@ -55,7 +55,7 @@ describe("GET user account", function () { }); // fail due to invalid login - it("should fail due to invalid password", function (done) { + it("should FAIL due to invalid password", function (done) { agent.post("/api/auth/login").type("application/json").send({ email: Admin0.email, password: "FakePassword" @@ -153,7 +153,7 @@ describe("GET user account", function () { }); // // fail case on authorization - it("should fail to list an account specified by id on /api/account/:id/ GET due to lack of authorization", function (done) { + it("should FAIL to list an account specified by id on /api/account/:id/ GET due to lack of authorization", function (done) { util.auth.login(agent, teamHackerAccount0, (error) => { if (error) { agent.close(); @@ -262,7 +262,7 @@ describe("PATCH update account", function () { }; // fail on authentication - it("should fail to update an account due to authentication", function (done) { + it("should FAIL to update an account due to authentication", function (done) { chai.request(server.app) .patch(`/api/account/${updatedInfo._id}`) .end(function (err, res) { @@ -377,7 +377,7 @@ describe("PATCH change password for logged in user", function () { "newPassword": "password12345" }; // fail on authentication - it("should fail to change the user's password because they are not logged in", function (done) { + it("should FAIL to change the user's password because they are not logged in", function (done) { chai.request(server.app) .patch("/api/auth/password/change") .type("application/json") @@ -411,7 +411,7 @@ describe("PATCH change password for logged in user", function () { }); }); // fail case because old password in incorrect - it("should fail to change the logged in user's password to a new password because old password is incorrect", function (done) { + it("should FAIL to change the logged in user's password to a new password because old password is incorrect", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 52c9e19b..b1ccd144 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -50,7 +50,7 @@ const invalidHacker1 = util.hacker.invalidHacker1; describe("GET hacker", function () { // fail on authentication - it("should fail to list a hacker's information on /api/hacker/:id GET due to authentication", function (done) { + it("should FAIL to list a hacker's information on /api/hacker/:id GET due to authentication", function (done) { chai.request(server.app) .get(`/api/hacker/` + TeamHacker0._id) .end(function (err, res) { @@ -89,7 +89,7 @@ describe("GET hacker", function () { }); // fail case due to wrong account type - it("should fail to list the hacker info of an admin due to wrong account type /api/account/self GET", function (done) { + it("should FAIL to list the hacker info of an admin due to wrong account type /api/account/self GET", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); @@ -108,7 +108,7 @@ describe("GET hacker", function () { }); // fail case due to unconfirmed email address of already defined hacker - it("should fail to list the user's hacker info due to unconfirmed email on /api/hacker/self GET", function (done) { + it("should FAIL to list the user's hacker info due to unconfirmed email on /api/hacker/self GET", function (done) { util.auth.login(agent, unconfirmedHackerAccount1, (error) => { if (error) { agent.close(); @@ -184,7 +184,7 @@ describe("GET hacker", function () { }); // fail due to lack of authorization - it("should fail to list a hacker information due to lack of authorization on /api/hacker/:id GET", function (done) { + it("should FAIL to list a hacker information due to lack of authorization on /api/hacker/:id GET", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { if (error) { agent.close(); @@ -209,7 +209,7 @@ describe("GET hacker", function () { }); // fail due to lack of hacker - it("should fail to list an invalid hacker /api/hacker/:id GET", function (done) { + it("should FAIL to list an invalid hacker /api/hacker/:id GET", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); @@ -290,7 +290,7 @@ describe("GET hacker", function () { }); // fail due to lack of authorization - it("should fail to list a hacker information due to lack of authorization on /api/hacker/email/:id GET", function (done) { + it("should FAIL to list a hacker information due to lack of authorization on /api/hacker/email/:id GET", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { if (error) { agent.close(); @@ -317,7 +317,7 @@ describe("GET hacker", function () { describe("POST create hacker", function () { // fail on authentication - it("should fail to create a new hacker due to lack of authentication", + it("should FAIL to create a new hacker due to lack of authentication", function (done) { chai.request(server.app) .post(`/api/hacker/`) @@ -396,7 +396,7 @@ describe("POST create hacker", function () { }); }); - // should fail due to 'false' on code of conduct + // should FAIL due to 'false' on code of conduct it("should FAIL if the new hacker does not accept code of conduct", function (done) { util.auth.login(agent, newHacker0, (error) => { if (error) { @@ -484,7 +484,7 @@ describe("POST create hacker", function () { describe("PATCH update one hacker", function () { // fail on authentication - it("should fail to update a hacker on /api/hacker/:id GET due to authentication", function (done) { + it("should FAIL to update a hacker on /api/hacker/:id GET due to authentication", function (done) { chai.request(server.app) .patch(`/api/hacker/${TeamHacker0._id}`) .type("application/json") @@ -627,7 +627,7 @@ describe("PATCH update one hacker", function () { }); }); - // hacker should fail to checkin hacker + // hacker should FAIL to checkin hacker it("should FAIL to check in hacker as a hacker", function (done) { util.auth.login(agent, teamHackerAccount0, (error) => { if (error) { @@ -651,7 +651,7 @@ describe("PATCH update one hacker", function () { }); }); - // hacker should fail to checkin hacker due to unconfirmed email + // hacker should FAIL to checkin hacker due to unconfirmed email it("should FAIL to check in hacker as a volunteer due to unconfirmed email", function (done) { util.auth.login(agent, volunteerAccount0, (error) => { if (error) { @@ -702,8 +702,8 @@ describe("PATCH update one hacker", function () { }); }); - // should fail to change hacker data with an unconfirmed email - it("should FAIL and FAIL to update the user's hacker info due to unconfirmed email", function (done) { + // should FAIL to change hacker data with an unconfirmed email + it("should FAIL and not update the user's hacker info due to unconfirmed email", function (done) { util.auth.login(agent, unconfirmedHackerAccount1, (error) => { if (error) { agent.close(); @@ -726,7 +726,7 @@ describe("PATCH update one hacker", function () { }); }); - // should fail due to authorization + // should FAIL due to authorization it("should Fail to update hacker info due to lack of authorization", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { if (error) { @@ -752,7 +752,7 @@ describe("PATCH update one hacker", function () { }); // fail due to lack of hacker - it("should fail to change an invalid hacker's info", function (done) { + it("should FAIL to change an invalid hacker's info", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); @@ -807,7 +807,7 @@ describe("PATCH update one hacker", function () { }); // Fail and don't change to accepted - it("should fail for hacker to update their own status from accepted to confirmed due to unconfirmed email", function (done) { + it("should FAIL for hacker to update their own status from accepted to confirmed due to unconfirmed email", function (done) { util.auth.login(agent, unconfirmedHackerAccount1, (error) => { if (error) { agent.close(); @@ -865,7 +865,7 @@ describe("PATCH update one hacker", function () { }); // fail for a hacker that's not accepted - it("should fail to update hacker status when hacker status is not accepted or confirmed", function (done) { + it("should FAIL to update hacker status when hacker status is not accepted or confirmed", function (done) { util.auth.login(agent, util.account.waitlistedHacker0, (error) => { if (error) { agent.close(); @@ -893,7 +893,7 @@ describe("PATCH update one hacker", function () { }); // fail for a hacker that's not accepted - it("should fail for hacker trying to confirm someone else", function (done) { + it("should FAIL for hacker trying to confirm someone else", function (done) { util.auth.login(agent, util.account.waitlistedHacker0, (error) => { if (error) { agent.close(); diff --git a/tests/role.test.js b/tests/role.test.js index b5444098..9be86414 100644 --- a/tests/role.test.js +++ b/tests/role.test.js @@ -75,7 +75,7 @@ describe("POST create role", function () { }); }); - // should fail due to lack of authorization + // should FAIL due to lack of authorization it("should Fail to add new role due to lack of authorization", function (done) { util.auth.login(agent, Hacker0, (error) => { if (error) { diff --git a/tests/settings.test.js b/tests/settings.test.js index eec1bd11..3cf834a3 100644 --- a/tests/settings.test.js +++ b/tests/settings.test.js @@ -35,7 +35,7 @@ describe("GET settings", function () { }); describe("PATCH settings", function () { - it("should fail to update the settings due to lack of authentication", function (done) { + it("should FAIL to update the settings due to lack of authentication", function (done) { chai.request(server.app) .patch(`/api/settings/`) // does not have password because of to stripped json @@ -47,7 +47,7 @@ describe("PATCH settings", function () { done(); }); }); - it("should fail to update the settings due to lack of authorization", function (done) { + it("should FAIL to update the settings due to lack of authorization", function (done) { util.auth.login(agent, invalidAccount, (error) => { if (error) { agent.close(); diff --git a/tests/sponsor.test.js b/tests/sponsor.test.js index f944d866..1a374f70 100644 --- a/tests/sponsor.test.js +++ b/tests/sponsor.test.js @@ -28,7 +28,7 @@ const newT2Sponsor0 = util.sponsor.newT2Sponsor0; let duplicateSponsor = util.sponsor.duplicateAccountLinkSponsor1; describe("GET user's sponsor info", function () { - it("should fail list a sponsor's information due to authentication from /api/sponsor/self GET", function (done) { + it("should FAIL list a sponsor's information due to authentication from /api/sponsor/self GET", function (done) { chai.request(server.app) .get(`/api/sponsor/self`) // does not have password because of to stripped json @@ -139,7 +139,7 @@ describe("GET user's sponsor info", function () { }); describe("GET sponsor by id", function () { - it("should fail list a sponsor's information due to authentication from /api/sponsor/:id GET", function (done) { + it("should FAIL list a sponsor's information due to authentication from /api/sponsor/:id GET", function (done) { chai.request(server.app) .get(`/api/sponsor/` + T1Sponsor0._id) // does not have password because of to stripped json @@ -208,7 +208,7 @@ describe("GET sponsor by id", function () { }); // failure due to lack of auth - it("should fail to list a user's sponsor info due to lack of authorization /api/sponsor/:id GET", function (done) { + it("should FAIL to list a user's sponsor info due to lack of authorization /api/sponsor/:id GET", function (done) { util.auth.login(agent, HackerAccount0, (error) => { if (error) { agent.close(); @@ -232,7 +232,7 @@ describe("GET sponsor by id", function () { }); // failure due to lack of this sponsor - it("should fail to list non existant info on /api/sponsor/:id GET", function (done) { + it("should FAIL to list non existant info on /api/sponsor/:id GET", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); @@ -257,7 +257,7 @@ describe("GET sponsor by id", function () { }); describe("POST create sponsor", function () { - it("should fail to create a new sponsor due to lack of authentication", function (done) { + it("should FAIL to create a new sponsor due to lack of authentication", function (done) { chai.request(server.app) .post(`/api/sponsor`) .type("application/json") @@ -301,7 +301,7 @@ describe("POST create sponsor", function () { }); // fail case - duplicate accountId - it("should fail to create a sponsor due to duplicate accountId", function (done) { + it("should FAIL to create a sponsor due to duplicate accountId", function (done) { util.auth.login(agent, T1SponsorAccount0, (error) => { if (error) { agent.close(); @@ -346,7 +346,7 @@ describe("POST create sponsor", function () { }); describe("PATCH update sponsor", function () { - it("should fail to update a sponsor due to lack of authentication", function (done) { + it("should FAIL to update a sponsor due to lack of authentication", function (done) { chai.request(server.app) .patch(`/api/sponsor/${T1Sponsor0._id}/`) .type("application/json") diff --git a/tests/volunteer.test.js b/tests/volunteer.test.js index bde8924c..9d0d9667 100644 --- a/tests/volunteer.test.js +++ b/tests/volunteer.test.js @@ -141,7 +141,7 @@ describe("GET volunteer", function () { }); describe("POST create volunteer", function () { - it("should fail to create a new volunteer due to lack of authentication", function (done) { + it("should FAIL to create a new volunteer due to lack of authentication", function (done) { chai.request(server.app) .post(`/api/volunteer`) .type("application/json") @@ -229,7 +229,7 @@ describe("POST create volunteer", function () { }); // fail on non-volunteer type account trying to create volunteer - it("should fail to create a volunteer due to authorization /api/volunteer POST", function (done) { + it("should FAIL to create a volunteer due to authorization /api/volunteer POST", function (done) { util.auth.login(agent, HackerAccount0, (error) => { if (error) { agent.close(); From eb64c3704ccc5a66fb6e9c8bd5138b712b23572b Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Fri, 29 Nov 2019 01:21:27 -0500 Subject: [PATCH 169/243] Fixed validation for new and improved hacker object --- middlewares/hacker.middleware.js | 832 ++++++------- middlewares/parse-body.middleware.js | 38 +- middlewares/validators/hacker.validator.js | 82 +- middlewares/validators/validator.helper.js | 1226 +++++++++++++------- models/hacker.model.js | 216 ++-- services/account.service.js | 93 +- services/hacker.service.js | 231 ++-- 7 files changed, 1600 insertions(+), 1118 deletions(-) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 93b49ca3..684f1e19 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -3,31 +3,31 @@ const TAG = `[ HACKER.MIDDLEWARE.js ]`; const mongoose = require("mongoose"); const Services = { - Hacker: require("../services/hacker.service"), - Storage: require("../services/storage.service"), - Email: require("../services/email.service"), - Account: require("../services/account.service"), - Env: require("../services/env.service"), + Hacker: require("../services/hacker.service"), + Storage: require("../services/storage.service"), + Email: require("../services/email.service"), + Account: require("../services/account.service"), + Env: require("../services/env.service") }; const Middleware = { - Util: require("./util.middleware") + Util: require("./util.middleware") }; const Constants = { - General: require("../constants/general.constant"), - Error: require("../constants/error.constant"), + General: require("../constants/general.constant"), + Error: require("../constants/error.constant") }; /** * @function parsePatch - * @param {body: {id: ObjectId}} req - * @param {*} res - * @param {(err?) => void} next + * @param {body: {id: ObjectId}} req + * @param {*} res + * @param {(err?) => void} next * @return {void} * @description Delete the req.body.id that was added by the validation of route parameter. */ function parsePatch(req, res, next) { - delete req.body.id; - return next(); + delete req.body.id; + return next(); } /** @@ -36,45 +36,45 @@ function parsePatch(req, res, next) { * @param {*} res * @param {(err?)=>void} next * @return {void} - * @description - * Moves accountId, school, degree, gender, needsBus, application from req.body to req.body.hackerDetails. + * @description + * Moves accountId, school, degree, gender, needsBus, application from req.body to req.body.hackerDetails. * Adds _id to hackerDetails. */ function parseHacker(req, res, next) { - const hackerDetails = { - _id: mongoose.Types.ObjectId(), - accountId: req.body.accountId, - school: req.body.school, - degree: req.body.degree, - gender: req.body.gender, - needsBus: req.body.needsBus, - application: req.body.application, - - ethnicity: req.body.ethnicity, - major: req.body.major, - graduationYear: req.body.graduationYear, - codeOfConduct: req.body.codeOfConduct, - - teamId: req.body.teamId, - }; - req.body.token = req.body.authorization; - - delete req.body.accountId; - delete req.body.school; - delete req.body.degree; - delete req.body.gender; - delete req.body.needsBus; - delete req.body.application; - delete req.body.authorization; - delete req.body.ethnicity; - delete req.body.major; - delete req.body.graduationYear; - delete req.body.codeOfConduct; - delete req.body.teamId; - - req.body.hackerDetails = hackerDetails; - - return next(); + const hackerDetails = { + _id: mongoose.Types.ObjectId(), + accountId: req.body.accountId, + school: req.body.school, + degree: req.body.degree, + gender: req.body.gender, + needsBus: req.body.needsBus, + application: req.body.application, + + ethnicity: req.body.ethnicity, + major: req.body.major, + graduationYear: req.body.graduationYear, + codeOfConduct: req.body.codeOfConduct, + + teamId: req.body.teamId + }; + req.body.token = req.body.authorization; + + delete req.body.accountId; + delete req.body.school; + delete req.body.degree; + delete req.body.gender; + delete req.body.needsBus; + delete req.body.application; + delete req.body.authorization; + delete req.body.ethnicity; + delete req.body.major; + delete req.body.graduationYear; + delete req.body.codeOfConduct; + delete req.body.teamId; + + req.body.hackerDetails = hackerDetails; + + return next(); } /** @@ -83,13 +83,13 @@ function parseHacker(req, res, next) { * @param {*} res * @param {(err?)=>void} next * @return {void} - * @description + * @description * Adds the checked-in status to req.body */ function parseCheckIn(req, res, next) { - req.body.status = Constants.General.HACKER_STATUS_CHECKED_IN; + req.body.status = Constants.General.HACKER_STATUS_CHECKED_IN; - return next(); + return next(); } /** @@ -98,21 +98,21 @@ function parseCheckIn(req, res, next) { * @param {*} res * @param {(err?)=>void} next * @return {void} - * @description + * @description * Changes req.body.status to confirmed or cancelled depending on whether req.body.confirm is true or false respectively. * Deletes req.body.confirm afterwards */ function parseConfirmation(req, res, next) { - const confirm = req.body.confirm; + const confirm = req.body.confirm; - if (confirm) { - req.body.status = Constants.General.HACKER_STATUS_CONFIRMED; - } else { - req.body.status = Constants.General.HACKER_STATUS_CANCELLED; - } + if (confirm) { + req.body.status = Constants.General.HACKER_STATUS_CONFIRMED; + } else { + req.body.status = Constants.General.HACKER_STATUS_CANCELLED; + } - delete req.body.confirm; - return next(); + delete req.body.confirm; + return next(); } /** @@ -124,38 +124,38 @@ function parseConfirmation(req, res, next) { * @description Adds status to hackerDetails. */ function addDefaultStatus(req, res, next) { - req.body.hackerDetails.status = "Applied"; - return next(); + req.body.hackerDetails.status = "Applied"; + return next(); } /** * Verifies that account is confirmed and of proper type from the account ID passed in req.body.accountId - * @param {{body: {accountId: ObjectId}}} req - * @param {*} res - * @param {(err?) => void} next + * @param {{body: {accountId: ObjectId}}} req + * @param {*} res + * @param {(err?) => void} next */ async function validateConfirmedStatus(req, res, next) { - const account = await Services.Account.findById(req.body.accountId); - if (!account) { - return next({ - status: 404, - message: Constants.Error.ACCOUNT_404_MESSAGE, - error: {} - }); - } else if (!account.confirmed) { - return next({ - status: 403, - message: Constants.Error.ACCOUNT_403_MESSAGE, - error: {} - }); - } else if (account.accountType !== Constants.General.HACKER) { - return next({ - status: 409, - message: Constants.Error.ACCOUNT_TYPE_409_MESSAGE - }); - } else { - return next(); - } + const account = await Services.Account.findById(req.body.accountId); + if (!account) { + return next({ + status: 404, + message: Constants.Error.ACCOUNT_404_MESSAGE, + error: {} + }); + } else if (!account.confirmed) { + return next({ + status: 403, + message: Constants.Error.ACCOUNT_403_MESSAGE, + error: {} + }); + } else if (account.accountType !== Constants.General.HACKER) { + return next({ + status: 409, + message: Constants.Error.ACCOUNT_TYPE_409_MESSAGE + }); + } else { + return next(); + } } /** @@ -166,228 +166,268 @@ async function validateConfirmedStatus(req, res, next) { * @description Retrieves a hacker's information via req.body.id, moving result to req.body.hacker if succesful. */ async function findById(req, res, next) { - const hacker = await Services.Hacker.findById(req.body.id); + const hacker = await Services.Hacker.findById(req.body.id); - if (!hacker) { - return next({ - status: 404, - message: Constants.Error.HACKER_404_MESSAGE - }); - } + if (!hacker) { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE + }); + } - req.body.hacker = hacker; - next(); + req.body.hacker = hacker; + next(); } async function findByEmail(req, res, next) { - const account = await Services.Account.findByEmail(req.body.email); - if (!account) { - return next({ - status: 404, - message: Constants.Error.ACCOUNT_404_MESSAGE, - error: {} - }); - } - const hacker = await Services.Hacker.findByAccountId(account._id); - if (!hacker) { - return next({ - status: 404, - message: Constants.Error.HACKER_404_MESSAGE, - error: {} - }); - } + const account = await Services.Account.findByEmail(req.body.email); + if (!account) { + return next({ + status: 404, + message: Constants.Error.ACCOUNT_404_MESSAGE, + error: {} + }); + } + const hacker = await Services.Hacker.findByAccountId(account._id); + if (!hacker) { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE, + error: {} + }); + } - req.body.hacker = hacker; - next(); + req.body.hacker = hacker; + next(); } /** * Verifies that the current signed in user is linked to the hacker passed in via req.body.id - * @param {{body: {id: ObjectId}}} req - * @param {*} res + * @param {{body: {id: ObjectId}}} req + * @param {*} res * @param {(err?)=>void} next */ // must check that the account id is in the hacker schema. function ensureAccountLinkedToHacker(req, res, next) { - Services.Hacker.findById(req.body.id).then( - (hacker) => { - req.hacker = hacker; - if (hacker && req.user && String.toString(hacker.accountId) === String.toString(req.user.id)) { - return next(); - } else { - return next({ - status: 403, - message: Constants.Error.AUTH_403_MESSAGE, - error: {} - }); - } - } - ).catch(next); + Services.Hacker.findById(req.body.id) + .then(hacker => { + req.hacker = hacker; + if ( + hacker && + req.user && + String.toString(hacker.accountId) === String.toString(req.user.id) + ) { + return next(); + } else { + return next({ + status: 403, + message: Constants.Error.AUTH_403_MESSAGE, + error: {} + }); + } + }) + .catch(next); } /** - * Uploads resume via the storage service. Assumes there is a resume in req, and a hacker id in req.body. - * @param {{body: {id: ObjectId}, resume: [Buffer]}} req - * @param {*} res + * Uploads resume via the storage service. Assumes there is a resume in req, and a hacker id in req.body. + * @param {{body: {id: ObjectId}, resume: [Buffer]}} req + * @param {*} res * @param {(err?)=>void} next */ async function uploadResume(req, res, next) { - const gcfilename = `resumes/${Date.now()}-${req.hacker.id}`; - await Services.Storage.upload(req.file, gcfilename); - req.body.gcfilename = gcfilename; - await Services.Hacker.updateOne(req.hacker.id, { - $set: { - "application.portfolioURL.resume": gcfilename - } - }); - return next(); + const gcfilename = `resumes/${Date.now()}-${req.hacker.id}`; + await Services.Storage.upload(req.file, gcfilename); + req.body.gcfilename = gcfilename; + await Services.Hacker.updateOne(req.hacker.id, { + $set: { + "application.portfolioURL.resume": gcfilename + } + }); + return next(); } /** * Attaches the resume of a hacker to req.body.resume. Assumes req.body.id exists. - * @param {{body: {id: ObjectId}}} req - * @param {*} res + * @param {{body: {id: ObjectId}}} req + * @param {*} res * @param {(err?)=>void} next */ async function downloadResume(req, res, next) { - const hacker = await Services.Hacker.findById(req.body.id); - if (hacker && hacker.application && hacker.application.portfolioURL && hacker.application.portfolioURL.resume) { - req.body.resume = await Services.Storage.download(hacker.application.portfolioURL.resume); - } else { - return next({ - status: 404, - message: Constants.Error.RESUME_404_MESSAGE, - error: {} - }); - } - return next(); + const hacker = await Services.Hacker.findById(req.body.id); + if ( + hacker && + hacker.application && + hacker.application.portfolioURL && + hacker.application.portfolioURL.resume + ) { + req.body.resume = await Services.Storage.download( + hacker.application.portfolioURL.resume + ); + } else { + return next({ + status: 404, + message: Constants.Error.RESUME_404_MESSAGE, + error: {} + }); + } + return next(); } /** * Sends a preset email to a user if a status change occured. - * @param {{body: {status?: string}, params: {id: string}}} req - * @param {*} res - * @param {(err?:*)=>void} next + * @param {{body: {status?: string}, params: {id: string}}} req + * @param {*} res + * @param {(err?:*)=>void} next */ async function sendStatusUpdateEmail(req, res, next) { - //skip if the status doesn't exist - if (!req.body.status) { - return next(); - } else { - // send it to the hacker that is being updated. - const hacker = await Services.Hacker.findById(req.params.id); - const account = await Services.Account.findById(hacker.accountId); - if (!hacker) { - return next({ - status: 404, - message: Constants.Error.HACKER_404_MESSAGE, - }); - } else if (!account) { - return next({ - status: 500, - message: Constants.Error.GENERIC_500_MESSAGE, - }); - } - Services.Email.sendStatusUpdate(account.firstName, account.email, req.body.status, next); + //skip if the status doesn't exist + if (!req.body.status) { + return next(); + } else { + // send it to the hacker that is being updated. + const hacker = await Services.Hacker.findById(req.params.id); + const account = await Services.Account.findById(hacker.accountId); + if (!hacker) { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE + }); + } else if (!account) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE + }); } + Services.Email.sendStatusUpdate( + account.firstName, + account.email, + req.body.status, + next + ); + } } /** * Sends an email telling the user that they have applied. This is used exclusively when we POST a hacker. - * @param {{body: {hacker: {accountId: string}}}} req - * @param {*} res - * @param {(err?:*)=>void} next + * @param {{body: {hacker: {accountId: string}}}} req + * @param {*} res + * @param {(err?:*)=>void} next */ async function sendAppliedStatusEmail(req, res, next) { - const hacker = req.body.hacker; - const account = await Services.Account.findById(hacker.accountId); - if (!account) { - return next({ - status: 500, - message: Constants.Error.GENERIC_500_MESSAGE, - error: {} - }); - } - Services.Email.sendStatusUpdate(account.firstName, account.email, Constants.General.HACKER_STATUS_APPLIED, next); + const hacker = req.body.hacker; + const account = await Services.Account.findById(hacker.accountId); + if (!account) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE, + error: {} + }); + } + Services.Email.sendStatusUpdate( + account.firstName, + account.email, + Constants.General.HACKER_STATUS_APPLIED, + next + ); } /** * Sends an email telling the user that they have applied. This is used exclusively when we POST a hacker. - * @param {{body: {hacker: {accountId: string}}}} req - * @param {*} res - * @param {(err?:*)=>void} next + * @param {{body: {hacker: {accountId: string}}}} req + * @param {*} res + * @param {(err?:*)=>void} next */ async function sendWeekOfEmail(req, res, next) { - const hacker = req.body.hacker; - const address = Services.Env.isProduction() ? process.env.FRONTEND_ADDRESS_DEPLOY : process.env.FRONTEND_ADDRESS_DEV; - const httpOrHttps = (address.includes("localhost")) ? "http" : "https"; - const singleHackerViewLink = Services.Hacker.generateHackerViewLink(httpOrHttps, address, hacker._id.toString()); - const ticketSVG = await Services.Hacker.generateQRCode(singleHackerViewLink); - const account = await Services.Account.findById(hacker.accountId); - if (!account || !ticketSVG) { - return next({ - status: 500, - message: Constants.Error.GENERIC_500_MESSAGE, - error: {} - }); - } - Services.Email.sendWeekOfEmail(account.firstName, account.email, ticketSVG, next); + const hacker = req.body.hacker; + const address = Services.Env.isProduction() + ? process.env.FRONTEND_ADDRESS_DEPLOY + : process.env.FRONTEND_ADDRESS_DEV; + const httpOrHttps = address.includes("localhost") ? "http" : "https"; + const singleHackerViewLink = Services.Hacker.generateHackerViewLink( + httpOrHttps, + address, + hacker._id.toString() + ); + const ticketSVG = await Services.Hacker.generateQRCode(singleHackerViewLink); + const account = await Services.Account.findById(hacker.accountId); + if (!account || !ticketSVG) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE, + error: {} + }); + } + Services.Email.sendWeekOfEmail( + account.firstName, + account.email, + ticketSVG, + next + ); } /** * Sends an email telling the user that they have applied. This is used exclusively when we POST a hacker. - * @param {{body: {hacker: {accountId: string}}}} req - * @param {*} res - * @param {(err?:*)=>void} next + * @param {{body: {hacker: {accountId: string}}}} req + * @param {*} res + * @param {(err?:*)=>void} next */ async function sendDayOfEmail(req, res, next) { - const hacker = req.body.hacker; - const account = await Services.Account.findById(hacker.accountId); - if (!account) { - return next({ - status: 500, - message: Constants.Error.GENERIC_500_MESSAGE, - error: {} - }); - } - Services.Email.sendDayOfEmail(account.firstName, account.email, next); + const hacker = req.body.hacker; + const account = await Services.Account.findById(hacker.accountId); + if (!account) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE, + error: {} + }); + } + Services.Email.sendDayOfEmail(account.firstName, account.email, next); } /** * If the current hacker's status is Constants.HACKER_STATUS_NONE, and the hacker's application is completed, - * then it will change the status of the hacker to Constants.General.HACKER_STATUS_APPLIED, and then email the hacker to + * then it will change the status of the hacker to Constants.General.HACKER_STATUS_APPLIED, and then email the hacker to * confirm that they applied. - * @param {{body: {status?: string}, params: {id: string}}} req - * @param {*} res - * @param {(err?:*)=>void} next + * @param {{body: {status?: string}, params: {id: string}}} req + * @param {*} res + * @param {(err?:*)=>void} next */ async function updateStatusIfApplicationCompleted(req, res, next) { - const hacker = await Services.Hacker.findById(req.params.id); - if (hacker) { - if (hacker.status === Constants.General.HACKER_STATUS_NONE && hacker.isApplicationComplete()) { - await Services.Hacker.updateOne(req.params.id, { - status: Constants.General.HACKER_STATUS_APPLIED - }); - const account = await Services.Account.findById(hacker.accountId); - if (!account) { - return next({ - status: 500, - message: Constants.Error.GENERIC_500_MESSAGE, - error: {} - }); - } - Services.Email.sendStatusUpdate(account.firstName, account.email, Constants.General.HACKER_STATUS_APPLIED, next); - } else { - return next(); - } - } else { + const hacker = await Services.Hacker.findById(req.params.id); + if (hacker) { + if ( + hacker.status === Constants.General.HACKER_STATUS_NONE && + hacker.isApplicationComplete() + ) { + await Services.Hacker.updateOne(req.params.id, { + status: Constants.General.HACKER_STATUS_APPLIED + }); + const account = await Services.Account.findById(hacker.accountId); + if (!account) { return next({ - status: 404, - message: Constants.Error.HACKER_404_MESSAGE, - data: { - id: req.params.id - } + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE, + error: {} }); + } + Services.Email.sendStatusUpdate( + account.firstName, + account.email, + Constants.General.HACKER_STATUS_APPLIED, + next + ); + } else { + return next(); } + } else { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE, + data: { + id: req.params.id + } + }); + } } /** @@ -396,190 +436,196 @@ async function updateStatusIfApplicationCompleted(req, res, next) { * @returns {(req, res, next) => {}} the middleware that will check hacker's status */ function checkStatus(statuses) { - return Middleware.Util.asyncMiddleware(async (req, res, next) => { - - let hacker = await Services.Hacker.findById(req.params.id); - - if (!!hacker) { - const status = hacker.status; - // makes sure the hacker's status is in the accepted statuses list - if (statuses.indexOf(status) === -1) { - return next({ - status: 409, - message: Constants.Error.HACKER_STATUS_409_MESSAGE, - data: { - id: req.params.id, - validStatuses: statuses - } - }); - } - - return next(); - } else { - return next({ - status: 404, - message: Constants.Error.HACKER_404_MESSAGE, - data: { - id: req.params.id - } - }); + return Middleware.Util.asyncMiddleware(async (req, res, next) => { + let hacker = await Services.Hacker.findById(req.params.id); + + if (!!hacker) { + const status = hacker.status; + // makes sure the hacker's status is in the accepted statuses list + if (statuses.indexOf(status) === -1) { + return next({ + status: 409, + message: Constants.Error.HACKER_STATUS_409_MESSAGE, + data: { + id: req.params.id, + validStatuses: statuses + } + }); + } + + return next(); + } else { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE, + data: { + id: req.params.id } - }); + }); + } + }); } /** - * Updates a hacker that is specified by req.params.id, and then sets req.email + * Updates a hacker that is specified by req.params.id, and then sets req.email * to the email of the hacker, found in Account. - * @param {{params:{id: string}, body: *}} req - * @param {*} res - * @param {*} next + * @param {{params:{id: string}, body: *}} req + * @param {*} res + * @param {*} next */ async function updateHacker(req, res, next) { - const hacker = await Services.Hacker.updateOne(req.params.id, req.body); - if (hacker) { - const acct = await Services.Account.findById(hacker.accountId); - if (!acct) { - return next({ - status: 500, - message: Constants.Error.HACKER_UPDATE_500_MESSAGE, - data: { - hackerId: hacker.id, - accountId: hacker.accountId - } - }); + const hacker = await Services.Hacker.updateOne(req.params.id, req.body); + if (hacker) { + const acct = await Services.Account.findById(hacker.accountId); + if (!acct) { + return next({ + status: 500, + message: Constants.Error.HACKER_UPDATE_500_MESSAGE, + data: { + hackerId: hacker.id, + accountId: hacker.accountId } - req.email = acct.email; - return next(); - } else { - return next({ - status: 404, - message: Constants.Error.HACKER_404_MESSAGE, - data: { - id: req.params.id - } - }); + }); } + req.email = acct.email; + return next(); + } else { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE, + data: { + id: req.params.id + } + }); + } } /** * @function createhacker - * @param {{body: {hackerDetails: object}}} req - * @param {*} res - * @param {(err?)=>void} next + * @param {{body: {hackerDetails: object}}} req + * @param {*} res + * @param {(err?)=>void} next * @return {void} * @description * Creates hacker document after making sure there is no other hacker with the same linked accountId */ async function createHacker(req, res, next) { - const hackerDetails = req.body.hackerDetails; + const hackerDetails = req.body.hackerDetails; - const exists = await Services.Hacker.findByAccountId(hackerDetails.accountId); + const exists = await Services.Hacker.findByAccountId(hackerDetails.accountId); - if (exists) { - return next({ - status: 422, - message: Constants.Error.ACCOUNT_DUPLICATE_422_MESSAGE, - data: { - id: hackerDetails.accountId - } - }); - } + if (exists) { + return next({ + status: 422, + message: Constants.Error.ACCOUNT_DUPLICATE_422_MESSAGE, + data: { + id: hackerDetails.accountId + } + }); + } - const hacker = await Services.Hacker.createHacker(hackerDetails); + const hacker = await Services.Hacker.createHacker(hackerDetails); - if (!!hacker) { - req.body.hacker = hacker; - return next(); - } else { - return next({ - status: 500, - message: Constants.Error.HACKER_CREATE_500_MESSAGE, - data: {} - }) - } + if (!!hacker) { + req.body.hacker = hacker; + return next(); + } else { + return next({ + status: 500, + message: Constants.Error.HACKER_CREATE_500_MESSAGE, + data: {} + }); + } } /** * Checks that there are no other hackers with the same account id as the one passed into req.body.accountId - * @param {{body:{accountId: ObjectId}}} req - * @param {*} res + * @param {{body:{accountId: ObjectId}}} req + * @param {*} res * @param {*} next */ async function checkDuplicateAccountLinks(req, res, next) { - const hacker = await Services.Hacker.findByAccountId(req.body.accountId); - if (!hacker) { - return next(); - } else { - return next({ - status: 409, - message: Constants.Error.HACKER_ID_409_MESSAGE, - data: { - id: req.body.accountId - } - }); - } + const hacker = await Services.Hacker.findByAccountId(req.body.accountId); + if (!hacker) { + return next(); + } else { + return next({ + status: 409, + message: Constants.Error.HACKER_ID_409_MESSAGE, + data: { + id: req.body.accountId + } + }); + } } /** * Finds the hacker information of the logged in user - * @param {{user: {id: string}}} req - * @param {*} res - * @param {(err?)=>void} next + * @param {{user: {id: string}}} req + * @param {*} res + * @param {(err?)=>void} next */ async function findSelf(req, res, next) { - if (req.user.accountType != Constants.General.HACKER) { - return next({ - status: 409, - message: Constants.Error.ACCOUNT_TYPE_409_MESSAGE, - error: { - id: req.user.id, - } - }); - } - - const hacker = await Services.Hacker.findByAccountId(req.user.id); + if (req.user.accountType != Constants.General.HACKER) { + return next({ + status: 409, + message: Constants.Error.ACCOUNT_TYPE_409_MESSAGE, + error: { + id: req.user.id + } + }); + } + const hacker = await Services.Hacker.findByAccountId(req.user.id); - if (!!hacker) { - req.body.hacker = hacker; - return next(); - } else { - return next({ - status: 409, - message: Constants.Error.HACKER_404_MESSAGE, - error: { - id: req.user.id, - } - }); - } + if (!!hacker) { + req.body.hacker = hacker; + return next(); + } else { + return next({ + status: 409, + message: Constants.Error.HACKER_404_MESSAGE, + error: { + id: req.user.id + } + }); + } } async function getStats(req, res, next) { - const stats = await Services.Hacker.getStats(req.body.results); - req.body.stats = stats; - next(); + const stats = await Services.Hacker.getStats(req.body.results); + req.body.stats = stats; + next(); } module.exports = { - parsePatch: parsePatch, - parseHacker: parseHacker, - addDefaultStatus: addDefaultStatus, - ensureAccountLinkedToHacker: ensureAccountLinkedToHacker, - uploadResume: Middleware.Util.asyncMiddleware(uploadResume), - downloadResume: Middleware.Util.asyncMiddleware(downloadResume), - sendWeekOfEmail: Middleware.Util.asyncMiddleware(sendWeekOfEmail), - sendDayOfEmail: Middleware.Util.asyncMiddleware(sendDayOfEmail), - sendStatusUpdateEmail: Middleware.Util.asyncMiddleware(sendStatusUpdateEmail), - sendAppliedStatusEmail: Middleware.Util.asyncMiddleware(sendAppliedStatusEmail), - updateHacker: Middleware.Util.asyncMiddleware(updateHacker), - validateConfirmedStatus: Middleware.Util.asyncMiddleware(validateConfirmedStatus), - checkDuplicateAccountLinks: Middleware.Util.asyncMiddleware(checkDuplicateAccountLinks), - updateStatusIfApplicationCompleted: Middleware.Util.asyncMiddleware(updateStatusIfApplicationCompleted), - checkStatus: checkStatus, - parseCheckIn: parseCheckIn, - parseConfirmation: parseConfirmation, - createHacker: Middleware.Util.asyncMiddleware(createHacker), - findSelf: Middleware.Util.asyncMiddleware(findSelf), - getStats: Middleware.Util.asyncMiddleware(getStats), - findById: Middleware.Util.asyncMiddleware(findById), - findByEmail: Middleware.Util.asyncMiddleware(findByEmail), -}; \ No newline at end of file + parsePatch: parsePatch, + parseHacker: parseHacker, + addDefaultStatus: addDefaultStatus, + ensureAccountLinkedToHacker: ensureAccountLinkedToHacker, + uploadResume: Middleware.Util.asyncMiddleware(uploadResume), + downloadResume: Middleware.Util.asyncMiddleware(downloadResume), + sendWeekOfEmail: Middleware.Util.asyncMiddleware(sendWeekOfEmail), + sendDayOfEmail: Middleware.Util.asyncMiddleware(sendDayOfEmail), + sendStatusUpdateEmail: Middleware.Util.asyncMiddleware(sendStatusUpdateEmail), + sendAppliedStatusEmail: Middleware.Util.asyncMiddleware( + sendAppliedStatusEmail + ), + updateHacker: Middleware.Util.asyncMiddleware(updateHacker), + validateConfirmedStatus: Middleware.Util.asyncMiddleware( + validateConfirmedStatus + ), + checkDuplicateAccountLinks: Middleware.Util.asyncMiddleware( + checkDuplicateAccountLinks + ), + updateStatusIfApplicationCompleted: Middleware.Util.asyncMiddleware( + updateStatusIfApplicationCompleted + ), + checkStatus: checkStatus, + parseCheckIn: parseCheckIn, + parseConfirmation: parseConfirmation, + createHacker: Middleware.Util.asyncMiddleware(createHacker), + findSelf: Middleware.Util.asyncMiddleware(findSelf), + getStats: Middleware.Util.asyncMiddleware(getStats), + findById: Middleware.Util.asyncMiddleware(findById), + findByEmail: Middleware.Util.asyncMiddleware(findByEmail) +}; diff --git a/middlewares/parse-body.middleware.js b/middlewares/parse-body.middleware.js index c69539dc..8f3e4e9d 100644 --- a/middlewares/parse-body.middleware.js +++ b/middlewares/parse-body.middleware.js @@ -1,33 +1,29 @@ "use strict"; -const { - validationResult -} = require("express-validator/check"); -const { - matchedData -} = require("express-validator/filter"); +const { validationResult } = require("express-validator/check"); +const { matchedData } = require("express-validator/filter"); const Constants = { - Error: require("../constants/error.constant"), + Error: require("../constants/error.constant") }; module.exports = { - middleware: middleware + middleware: middleware }; /** * Moves matched data to req.body, and fails if any validation fails. - * @param {*} req - * @param {*} res + * @param {*} req + * @param {*} res * @param {(err?)=>void} next */ function middleware(req, res, next) { - const errors = validationResult(req); - if (!errors.isEmpty()) { - return next({ - status: 422, - message: Constants.Error.VALIDATION_422_MESSAGE, - data: errors.mapped() - }); - } - req.body = matchedData(req); - return next(); -} \ No newline at end of file + const errors = validationResult(req); + if (!errors.isEmpty()) { + return next({ + status: 422, + message: Constants.Error.VALIDATION_422_MESSAGE, + data: errors.mapped() + }); + } + req.body = matchedData(req); + return next(); +} diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js index 6728a9f6..90fc942a 100644 --- a/middlewares/validators/hacker.validator.js +++ b/middlewares/validators/hacker.validator.js @@ -3,49 +3,43 @@ const VALIDATOR = require("./validator.helper"); const Constants = require("../../constants/general.constant"); module.exports = { - newHackerValidator: [ - // status will be added automatically - VALIDATOR.mongoIdValidator("body", "accountId", false), - VALIDATOR.stringValidator("body", "school", false), - VALIDATOR.stringValidator("body", "degree", false), - VALIDATOR.stringValidator("body", "gender", false), - VALIDATOR.booleanValidator("body", "needsBus", false), - VALIDATOR.applicationValidator("body", "application", false), - VALIDATOR.alphaArrayValidator("body", "ethnicity", false), - VALIDATOR.alphaArrayValidator("body", "major", false), - VALIDATOR.integerValidator("body", "graduationYear", false, 2019, 2030), - VALIDATOR.booleanValidator("body", "codeOfConduct", false, true), - VALIDATOR.mongoIdValidator("body", "teamId", true) - ], + newHackerValidator: [ + // status will be added automatically + VALIDATOR.mongoIdValidator("body", "accountId", false), + // VALIDATOR.stringValidator("body", "school", false), + // VALIDATOR.stringValidator("body", "degree", false), + // VALIDATOR.stringValidator("body", "gender", false), + // VALIDATOR.booleanValidator("body", "needsBus", false), + VALIDATOR.applicationValidator("body", "application", false), + // VALIDATOR.alphaArrayValidator("body", "ethnicity", false), + // VALIDATOR.alphaArrayValidator("body", "major", false), + // VALIDATOR.integerValidator("body", "graduationYear", false, 2019, 2030), + // VALIDATOR.booleanValidator("body", "codeOfConduct", false, true), + VALIDATOR.mongoIdValidator("body", "teamId", true) + ], - updateConfirmationValidator: [ - VALIDATOR.booleanValidator("body", "confirm", false), - ], + updateConfirmationValidator: [ + VALIDATOR.booleanValidator("body", "confirm", false) + ], - updateHackerValidator: [ - VALIDATOR.stringValidator("body", "school", true), - VALIDATOR.stringValidator("body", "degree", true), - VALIDATOR.stringValidator("body", "gender", true), - VALIDATOR.booleanValidator("body", "needsBus", true), - VALIDATOR.applicationValidator("body", "application", true), - VALIDATOR.alphaArrayValidator("body", "ethnicity", true), - VALIDATOR.alphaArrayValidator("body", "major", true), - VALIDATOR.integerValidator("body", "graduationYear", true, 2019, 2030), - ], - updateStatusValidator: [ - VALIDATOR.enumValidator("body", "status", Constants.HACKER_STATUSES, false), - ], - checkInStatusValidator: [ - VALIDATOR.enumValidator("body", "status", Constants.HACKER_STATUS_CHECKED_IN, false) - ], - uploadResumeValidator: [ - VALIDATOR.mongoIdValidator("param", "id", false) - ], - downloadResumeValidator: [ - VALIDATOR.mongoIdValidator("param", "id", false) - ], - statsValidator: [ - VALIDATOR.searchModelValidator("query", "model", false), - VALIDATOR.searchValidator("query", "q") - ] -}; \ No newline at end of file + updateHackerValidator: [ + VALIDATOR.applicationValidator("body", "application", false) + ], + updateStatusValidator: [ + VALIDATOR.enumValidator("body", "status", Constants.HACKER_STATUSES, false) + ], + checkInStatusValidator: [ + VALIDATOR.enumValidator( + "body", + "status", + Constants.HACKER_STATUS_CHECKED_IN, + false + ) + ], + uploadResumeValidator: [VALIDATOR.mongoIdValidator("param", "id", false)], + downloadResumeValidator: [VALIDATOR.mongoIdValidator("param", "id", false)], + statsValidator: [ + VALIDATOR.searchModelValidator("query", "model", false), + VALIDATOR.searchValidator("query", "q") + ] +}; diff --git a/middlewares/validators/validator.helper.js b/middlewares/validators/validator.helper.js index 3fff34b4..7548369d 100644 --- a/middlewares/validators/validator.helper.js +++ b/middlewares/validators/validator.helper.js @@ -1,9 +1,10 @@ "use strict"; const { - body, - query, - header, - param + body, + query, + header, + param, + check } = require("express-validator/check"); const logger = require("../../services/logger.service"); const mongoose = require("mongoose"); @@ -11,53 +12,84 @@ const TAG = `[ VALIDATOR.HELPER.js ]`; const jwt = require("jsonwebtoken"); const Constants = require("../../constants/general.constant"); const Models = { - Hacker: require("../../models/hacker.model") + Hacker: require("../../models/hacker.model") }; /** * Validates that field is a valid integer - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname Name of the field that needs to be validated. * @param {boolean} optional Whether the field is optional or not. * @param {number} lowerBound Lower bound for a valid integer. * @param {number} upperBound Lpper bound for a valid integer. */ -function integerValidator(fieldLocation, fieldname, optional = true, lowerBound = -Infinity, upperBound = Infinity) { - const value = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid integer"); - - if (optional) { - return value.optional({ - checkFalsy: true - }) - .isInt().withMessage(`${fieldname} must be an integer.`) - .custom((value) => { - return value >= lowerBound && value <= upperBound; - }).withMessage(`${fieldname} must be between ${lowerBound} and ${upperBound}`); - } else { - return value.exists().withMessage("tier must exist") - .isInt().withMessage(`${fieldname} must be an integer.`) - .custom((value) => { - return value >= lowerBound && value <= upperBound; - }).withMessage(`${fieldname} must be between ${lowerBound} and ${upperBound}`); - } +function integerValidator( + fieldLocation, + fieldname, + optional = true, + lowerBound = -Infinity, + upperBound = Infinity +) { + const value = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid integer" + ); + + if (optional) { + return value + .optional({ + checkFalsy: true + }) + .isInt() + .withMessage(`${fieldname} must be an integer.`) + .custom(value => { + return value >= lowerBound && value <= upperBound; + }) + .withMessage( + `${fieldname} must be between ${lowerBound} and ${upperBound}` + ); + } else { + return value + .exists() + .withMessage("tier must exist") + .isInt() + .withMessage(`${fieldname} must be an integer.`) + .custom(value => { + return value >= lowerBound && value <= upperBound; + }) + .withMessage( + `${fieldname} must be between ${lowerBound} and ${upperBound}` + ); + } } /** * Validates that field is a valid mongoID - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname Name of the field that needs to be validated. * @param {boolean} optional Whether the field is optional or not. */ function mongoIdValidator(fieldLocation, fieldname, optional = true) { - const mongoId = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid mongoID"); - - if (optional) { - return mongoId.optional({ - checkFalsy: true - }).isMongoId().withMessage("must be a valid mongoID"); - } else { - return mongoId.exists().isMongoId().withMessage("must be a valid mongoID"); - } + const mongoId = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid mongoID" + ); + + if (optional) { + return mongoId + .optional({ + checkFalsy: true + }) + .isMongoId() + .withMessage("must be a valid mongoID"); + } else { + return mongoId + .exists() + .isMongoId() + .withMessage("must be a valid mongoID"); + } } /** @@ -67,135 +99,224 @@ function mongoIdValidator(fieldLocation, fieldname, optional = true) { * @param {boolean} optional Whether the field is optional or not. */ function mongoIdArrayValidator(fieldLocation, fieldname, optional = true) { - const arr = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid mongoID array"); - - if (optional) { - return arr.optional({ - checkFalsy: true - }) - .custom(isMongoIdArray).withMessage("Value must be an array of mongoIDs"); - } else { - return arr.exists() - .custom(isMongoIdArray).withMessage("Value must be an array of mongoIDs"); - } + const arr = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid mongoID array" + ); + + if (optional) { + return arr + .optional({ + checkFalsy: true + }) + .custom(isMongoIdArray) + .withMessage("Value must be an array of mongoIDs"); + } else { + return arr + .exists() + .custom(isMongoIdArray) + .withMessage("Value must be an array of mongoIDs"); + } } /** * Validates that field must be boolean. Optionally checks for desired boolean - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ -function booleanValidator(fieldLocation, fieldname, optional = true, desire = null) { - const booleanField = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid boolean"); - - if (optional) { - // do not use check falsy option as a 'false' boolean will be skipped - return booleanField.optional().isBoolean().withMessage("must be boolean").custom((val) => { - if (desire !== null) { - return desire === val; - } - return true; - }).withMessage(`Must be equal to ${desire}`); - } else { - return booleanField.exists().isBoolean().withMessage("must be boolean").custom((val) => { - if (desire !== null) { - return desire === val; - } - return true; - }).withMessage(`Must be equal to ${desire}`); - } +function booleanValidator( + fieldLocation, + fieldname, + optional = true, + desire = null +) { + const booleanField = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid boolean" + ); + + if (optional) { + // do not use check falsy option as a 'false' boolean will be skipped + return booleanField + .optional() + .isBoolean() + .withMessage("must be boolean") + .custom(val => { + if (desire !== null) { + return desire === val; + } + return true; + }) + .withMessage(`Must be equal to ${desire}`); + } else { + return booleanField + .exists() + .isBoolean() + .withMessage("must be boolean") + .custom(val => { + if (desire !== null) { + return desire === val; + } + return true; + }) + .withMessage(`Must be equal to ${desire}`); + } } /** * Validates that field name is ascii only. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function asciiValidator(fieldLocation, fieldname, optional = true) { - const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid name"); - if (optional) { - return name.optional({ - checkFalsy: true - }).isAscii().withMessage("must contain only ascii characters"); - } else { - return name.exists().withMessage("name must exist").isAscii().withMessage("must contain only ascii characters"); - } + const name = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid name" + ); + if (optional) { + return name + .optional({ + checkFalsy: true + }) + .isAscii() + .withMessage("must contain only ascii characters"); + } else { + return name + .exists() + .withMessage("name must exist") + .isAscii() + .withMessage("must contain only ascii characters"); + } } /** * Validates that field name is string only. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function stringValidator(fieldLocation, fieldname, optional = true) { - const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid string"); - if (optional) { - return name.optional({ - checkFalsy: true - }).isString().withMessage("must be a string"); - } else { - return name.exists().withMessage("name must exist").isString().withMessage("must be a string"); - } + const name = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "Invalid String" + ); + + if (optional) { + return name + .optional({ + checkFalsy: true + }) + .isString() + .withMessage("must be a string"); + } else { + return name + .exists() + .withMessage("name must exist") + .isString() + .withMessage("must be a string"); + } } /** * Validates the field against a regex - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname Name of the field that needs to be validated. * @param {boolean} optional Whether the field is optional or not. * @param {regex} desire The regex to match against * @description The default regex to match against accepts anything */ -function regexValidator(fieldLocation, fieldname, optional = true, desire = Constants.ANY_REGEX) { - const match = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid name"); - - if (optional) { - return match.optional({ - checkFalsy: true - }) - .matches(desire) - .withMessage("must be valid url"); - } else { - return match.exists().withMessage("url must exist") - .matches(desire) - .withMessage("must be valid url"); - } +function regexValidator( + fieldLocation, + fieldname, + optional = true, + desire = Constants.ANY_REGEX +) { + const match = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid name" + ); + + if (optional) { + return match + .optional({ + checkFalsy: true + }) + .matches(desire) + .withMessage("must be valid url"); + } else { + return match + .exists() + .withMessage("url must exist") + .matches(desire) + .withMessage("must be valid url"); + } } /** * Validates that field must be alphabetical. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function alphaValidator(fieldLocation, fieldname, optional = true) { - const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid alpha string"); - if (optional) { - return name.optional({ - checkFalsy: true - }).isAlpha().withMessage("must contain alphabet characters"); - } else { - return name.exists().withMessage("must exist").isAlpha().withMessage("must contain alphabet characters"); - } + const name = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid alpha string" + ); + if (optional) { + return name + .optional({ + checkFalsy: true + }) + .isAlpha() + .withMessage("must contain alphabet characters"); + } else { + return name + .exists() + .withMessage("must exist") + .isAlpha() + .withMessage("must contain alphabet characters"); + } } /** * Validates that field must be an array with alphabetical characters. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function alphaArrayValidator(fieldLocation, fieldname, optional = true) { - const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid alpha array"); - if (optional) { - return name.optional({ - checkFalsy: true - }).custom(alphaArrayValidationHelper).withMessage("must contain alphabet characters in each element of the array"); - } else { - return name.exists().withMessage("must exist").custom(alphaArrayValidationHelper).withMessage("must contain alphabet characters in each element of the array"); - } + const name = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid alpha array" + ); + + if (optional) { + return name + .optional({ + checkFalsy: true + }) + .custom(alphaArrayValidationHelper) + .withMessage( + "must contain alphabet characters in each element of the array" + ); + } else { + return name + .exists() + .withMessage("must exist") + .custom(alphaArrayValidationHelper) + .withMessage( + "must contain alphabet characters in each element of the array" + ); + } } /** @@ -203,103 +324,285 @@ function alphaArrayValidator(fieldLocation, fieldname, optional = true) { * @param {*} value value to check against */ function alphaArrayValidationHelper(value) { - if (!Array.isArray(value)) { - return false; - } - for (const el of value) { - if (typeof el !== "string") { - return false; - } + if (!Array.isArray(value)) { + return false; + } + for (const el of value) { + if (typeof el !== "string") { + return false; } - return true; + } + return true; } /** - * Validates that field must be at least 6 characters long. + * Validates that field must be at least 6 characters long. * TODO: impose better restrictions. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function passwordValidator(fieldLocation, fieldname, optional = true) { - const password = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid password"); - if (optional) { - return password.optional({ - checkFalsy: true - }).isLength({ - min: 6 - }).withMessage("must be longer than 6 characters"); - } else { - return password.exists().withMessage("password must exist").isLength({ - min: 6 - }).withMessage("must be longer than 6 characters"); - } + const password = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid password" + ); + if (optional) { + return password + .optional({ + checkFalsy: true + }) + .isLength({ + min: 6 + }) + .withMessage("must be longer than 6 characters"); + } else { + return password + .exists() + .withMessage("password must exist") + .isLength({ + min: 6 + }) + .withMessage("must be longer than 6 characters"); + } } - /** * Validates that field must be a valid application. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function applicationValidator(fieldLocation, fieldname, optional = true) { - const application = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid application"); - - //helper object to iterate through the items in the application and track which items are not valid. - const hasValid = { - github: false, - dropler: false, - personal: false, - linkedIn: false, - other: false, - jobInterest: false, - skills: false, - comments: false, - essay: false, - team: false - }; - if (optional) { - return application.optional({ - checkFalsy: true - }).custom(app => { - const jobInterests = Constants.JOB_INTERESTS; - hasValid.github = (!app.portfolioURL.github || typeof (app.portfolioURL.github) === "string"); - hasValid.dropler = (!app.portfolioURL.dropler || typeof (app.portfolioURL.dropler) === "string"); - hasValid.personal = (!app.portfolioURL.personal || typeof (app.portfolioURL.personal) === "string"); - hasValid.linkedIn = (!app.portfolioURL.linkedIn || typeof (app.portfolioURL.linkedIn) === "string"); - hasValid.other = (!app.portfolioURL.other || typeof (app.portfolioURL.other) === "string"); - hasValid.jobInterest = (!app.jobInterest || jobInterests.includes(app.jobInterest)); - hasValid.skills = (!app.skills || alphaArrayValidationHelper(app.skills)); - hasValid.comments = (!app.comments || typeof (app.comments) === "string"); - hasValid.essay = (!app.essay || typeof (app.essay) === "string"); - hasValid.team = (!app.team || mongoose.Types.ObjectId.isValid(app.team)); - return hasValid.comments && hasValid.github && hasValid.dropler && hasValid.personal && - hasValid.linkedIn && hasValid.other && hasValid.jobInterest && hasValid.skills && hasValid.team; - }).withMessage({ - message: "Not all items of the application are valid", - isValid: hasValid - }); - } else { - return application.custom(app => { - const jobInterests = Constants.JOB_INTERESTS; - hasValid.github = (!app.portfolioURL.github || typeof (app.portfolioURL.github) === "string"); - hasValid.dropler = (!app.portfolioURL.dropler || typeof (app.portfolioURL.dropler) === "string"); - hasValid.personal = (!app.portfolioURL.personal || typeof (app.portfolioURL.personal) === "string"); - hasValid.linkedIn = (!app.portfolioURL.linkedIn || typeof (app.portfolioURL.linkedIn) === "string"); - hasValid.other = (!app.portfolioURL.other || typeof (app.portfolioURL.other) === "string"); - hasValid.jobInterest = (jobInterests.includes(app.jobInterest)); - hasValid.skills = (!app.skills || alphaArrayValidationHelper(app.skills)); - hasValid.comments = (!app.comments || typeof (app.comments) === "string"); - hasValid.essay = (!app.essay || typeof (app.essay) === "string"); - hasValid.team = (!app.team || mongoose.Types.ObjectId.isValid(app.team)); - return hasValid.comments && hasValid.github && hasValid.dropler && hasValid.personal && - hasValid.linkedIn && hasValid.other && hasValid.jobInterest && hasValid.skills && hasValid.team; - }).withMessage({ - message: "Not all items of the application are valid", - isValid: hasValid - }); - } + const application = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid application" + ); + + //helper object to iterate through the items in the application and track which items are not valid. + const hasValid = { + school: false, + degree: false, + fieldOfStudy: false, + gender: false, + ethnicity: false, + bus: false, + graduationYear: false, + codeOfConduct: false, + github: false, + dribbble: false, + personal: false, + linkedIn: false, + other: false, + jobInterest: false, + skills: false, + comments: false, + question1: false, + question2: false, + team: false + }; + if (optional) { + return application + .optional({ + checkFalsy: true + }) + .custom(app => { + hasValid.school = stringValidator( + "body", + "application.general.school", + false + ); + hasValid.degree = stringValidator( + "body", + "application.general.degree", + false + ); + hasValid.fieldOfStudy = alphaArrayValidator( + "body", + "application.general.fieldOfStudy", + false + ); + hasValid.general = stringValidator( + "body", + "application.other.gender", + false + ); + hasValid.bus = booleanValidator( + "body", + "application.accomodation.needsBus", + false + ); + hasValid.ethnicity = alphaArrayValidator( + "body", + "application.other.ethnicity", + false + ); + hasValid.graduationYear = integerValidator( + "body", + "application.general.graduationYear", + false, + 2019, + 2030 + ); + hasValid.codeOfConduct = booleanValidator( + "body", + "application.accomodation.needsBus", + false + ); + const jobInterests = Constants.JOB_INTERESTS; + hasValid.github = + !app.general.URL.github || typeof app.general.URL.github === "string"; + hasValid.dribbble = + !app.general.URL.dribbble || + typeof app.general.URL.dribbble === "string"; + hasValid.personal = + !app.general.URL.personal || + typeof app.general.URL.personal === "string"; + hasValid.linkedIn = + !app.general.URL.linkedIn || + typeof app.general.URL.linkedIn === "string"; + hasValid.other = + !app.general.URL.other || typeof app.general.URL.other === "string"; + hasValid.jobInterest = + !app.general.jobInterest || + jobInterests.includes(app.general.jobInterest); + hasValid.skills = + !app.shortAnswer.skills || + alphaArrayValidationHelper(app.shortAnswer.skills); + hasValid.comments = + !app.shortAnswer.comments || + typeof app.shortAnswer.comments === "string"; + hasValid.question1 = + !app.shortAnswer.question1 || + typeof app.shortAnswer.question1 === "string"; + hasValid.question2 = + !app.shortAnswer.question2 || + typeof app.shortAnswer.question2 === "string"; + hasValid.team = !app.team || mongoose.Types.ObjectId.isValid(app.team); + return ( + hasValid.comments && + hasValid.school && + hasValid.degree && + hasValid.fieldOfStudy && + hasValid.graduationYear && + hasValid.ethnicity && + hasValid.bus && + hasValid.codeOfConduct && + hasValid.github && + hasValid.dribbble && + hasValid.personal && + hasValid.linkedIn && + hasValid.other && + hasValid.jobInterest && + hasValid.skills && + hasValid.team + ); + }) + .withMessage({ + message: "Not all items of the application are valid", + isValid: hasValid + }); + } else { + return application + .custom(app => { + hasValid.school = stringValidator( + "body", + "application.general.school", + false + ); + hasValid.degree = stringValidator( + "body", + "application.general.degree", + false + ); + hasValid.fieldOfStudy = alphaArrayValidator( + "body", + "application.general.fieldOfStudy", + false + ); + hasValid.general = stringValidator( + "body", + "application.other.gender", + false + ); + hasValid.bus = booleanValidator( + "body", + "application.accomodation.needsBus", + false + ); + hasValid.ethnicity = alphaArrayValidator( + "body", + "application.other.ethnicity", + false + ); + hasValid.graduationYear = integerValidator( + "body", + "application.general.graduationYear", + false, + 2019, + 2030 + ); + hasValid.codeOfConduct = booleanValidator( + "body", + "application.accomodation.needsBus", + false + ); + const jobInterests = Constants.JOB_INTERESTS; + hasValid.github = + !app.general.URL.github || typeof app.general.URL.github === "string"; + hasValid.dribbble = + !app.general.URL.dribbble || + typeof app.general.URL.dribbble === "string"; + hasValid.personal = + !app.general.URL.personal || + typeof app.general.URL.personal === "string"; + hasValid.linkedIn = + !app.general.URL.linkedIn || + typeof app.general.URL.linkedIn === "string"; + hasValid.other = + !app.general.URL.other || typeof app.general.URL.other === "string"; + hasValid.jobInterest = + !app.general.jobInterest || + jobInterests.includes(app.general.jobInterest); + hasValid.skills = + !app.shortAnswer.skills || + alphaArrayValidationHelper(app.shortAnswer.skills); + hasValid.comments = + !app.shortAnswer.comments || + typeof app.shortAnswer.comments === "string"; + hasValid.question1 = + !app.shortAnswer.question1 || + typeof app.shortAnswer.question1 === "string"; + hasValid.question2 = + !app.shortAnswer.question2 || + typeof app.shortAnswer.question2 === "string"; + hasValid.team = !app.team || mongoose.Types.ObjectId.isValid(app.team); + return ( + hasValid.comments && + hasValid.school && + hasValid.degree && + hasValid.fieldOfStudy && + hasValid.graduationYear && + hasValid.ethnicity && + hasValid.bus && + hasValid.codeOfConduct && + hasValid.github && + hasValid.dribbble && + hasValid.personal && + hasValid.linkedIn && + hasValid.other && + hasValid.jobInterest && + hasValid.skills && + hasValid.team + ); + }) + .withMessage({ + message: "Not all items of the application are valid", + isValid: hasValid + }); + } } /** @@ -308,49 +611,58 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { * @returns {boolean} whether the array contains only mongoIds */ function isMongoIdArray(arr) { - if (!Array.isArray(arr)) { - return false; - } + if (!Array.isArray(arr)) { + return false; + } - for (var ele of arr) { - if (!mongoose.Types.ObjectId.isValid(ele)) { - return false; - } + for (var ele of arr) { + if (!mongoose.Types.ObjectId.isValid(ele)) { + return false; } + } - return true; + return true; } /** * Validates that field must be a valid json web token. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {*} jwtSecret The secret that the json web token was encrypted with. * @param {boolean} optional whether the field is optional or not. */ function jwtValidator(fieldLocation, fieldname, jwtSecret, optional = true) { - const jwtValidationChain = setProperValidationChainBuilder(fieldLocation, fieldname, "Must be vali jwt"); - if (optional) { - return jwtValidationChain.optional({ - checkFalsy: true - }) - .custom(value => { - const token = jwt.verify(value, jwtSecret); - if (typeof token !== "undefined") { - return true; - } - return false; - }).withMessage(`must be valid jwt`); - } else { - return jwtValidationChain.exists().withMessage("Token must be provided") - .custom(value => { - const token = jwt.verify(value, jwtSecret); - if (typeof token !== "undefined") { - return true; - } - return false; - }).withMessage(`must be valid jwt`); - } + const jwtValidationChain = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "Must be vali jwt" + ); + if (optional) { + return jwtValidationChain + .optional({ + checkFalsy: true + }) + .custom(value => { + const token = jwt.verify(value, jwtSecret); + if (typeof token !== "undefined") { + return true; + } + return false; + }) + .withMessage(`must be valid jwt`); + } else { + return jwtValidationChain + .exists() + .withMessage("Token must be provided") + .custom(value => { + const token = jwt.verify(value, jwtSecret); + if (typeof token !== "undefined") { + return true; + } + return false; + }) + .withMessage(`must be valid jwt`); + } } /** @@ -359,11 +671,19 @@ function jwtValidator(fieldLocation, fieldname, jwtSecret, optional = true) { * @param {string} fieldname name of the field that needs to be validated. */ function searchModelValidator(fieldLocation, fieldName) { - const paramChain = setProperValidationChainBuilder(fieldLocation, fieldName, "Must be a valid searchable model"); - return paramChain.exists().withMessage("Model must be provided") - .isLowercase().withMessage("Model must be lower case") - .isAlpha().withMessage("must contain alphabet characters") - .isIn([Constants.HACKER.toLowerCase()]) + const paramChain = setProperValidationChainBuilder( + fieldLocation, + fieldName, + "Must be a valid searchable model" + ); + return paramChain + .exists() + .withMessage("Model must be provided") + .isLowercase() + .withMessage("Model must be lower case") + .isAlpha() + .withMessage("must contain alphabet characters") + .isIn([Constants.HACKER.toLowerCase()]); } /**== @@ -372,153 +692,198 @@ function searchModelValidator(fieldLocation, fieldName) { * @param {string} fieldname name of the field that needs to be validated. */ function searchValidator(fieldLocation, fieldname) { - const search = setProperValidationChainBuilder(fieldLocation, fieldname, "Invalid search query"); - - return search.exists().withMessage("Search query must be provided") - .custom((value, { - req - }) => { - //value is a serialized JSON - value = JSON.parse(value); - let modelString = req.query.model - //Supported models for searching - let model; - if (modelString === Constants.HACKER.toLowerCase()) { - model = Models.Hacker; - } else { - return false; + const search = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "Invalid search query" + ); + + return search + .exists() + .withMessage("Search query must be provided") + .custom((value, { req }) => { + //value is a serialized JSON + value = JSON.parse(value); + let modelString = req.query.model; + //Supported models for searching + let model; + if (modelString === Constants.HACKER.toLowerCase()) { + model = Models.Hacker; + } else { + return false; + } + //Validates each clause in the query + for (var q in value) { + //Checks that each clause has Param, Value, and Operation + var clause = value[q]; + if ( + !( + clause.hasOwnProperty("param") || + clause.hasOwnProperty("value") || + clause.hasOwnProperty("operation") + ) + ) { + return false; + } + var schemaPath = model.searchableField(clause.param); + if (!schemaPath) return false; + //Validates that operation corresponding to each clause is valid + switch (schemaPath) { + case "String": + if (!["equals", "ne", "regex", "in"].includes(clause.operation)) { + return false; } - //Validates each clause in the query - for (var q in value) { - //Checks that each clause has Param, Value, and Operation - var clause = value[q]; - if (!(clause.hasOwnProperty("param") || clause.hasOwnProperty("value") || clause.hasOwnProperty("operation"))) { - return false; - } - var schemaPath = model.searchableField(clause.param); - if (!schemaPath) return false; - //Validates that operation corresponding to each clause is valid - switch (schemaPath) { - case "String": - if (!["equals", "ne", "regex", "in"].includes(clause.operation)) { - return false; - } - break; - case "Number": - if (!["equals", "ne", "gte", "lte", "le", "ge", "in"].includes(clause.operation)) { - return false; - } - break; - case "Boolean": - if (!["equals", "ne"].includes(clause.operation)) { - return false; - } - break; - } + break; + case "Number": + if ( + !["equals", "ne", "gte", "lte", "le", "ge", "in"].includes( + clause.operation + ) + ) { + return false; } - return true; - }); + break; + case "Boolean": + if (!["equals", "ne"].includes(clause.operation)) { + return false; + } + break; + } + } + return true; + }); } function searchSortValidator(fieldLocation, fieldName) { - const searchSort = setProperValidationChainBuilder(fieldLocation, fieldName, "Invalid sort criteria") - return searchSort.optional({ - checkFalsy: true - }) - .custom((value, { - req - }) => { - let modelString = req.query.model - if (modelString.equals("hacker")) { - model = Models.Hacker; - } else { - return false; - } - if (!!model.searchableField(value)) { - let sortOrder = param("sort", "Sorting order not found"); - if (!sortOrder.equals("asc") || !sortOrder.equals("desc")) { - return false; - } - } else { - return false; - } - return true; - }) + const searchSort = setProperValidationChainBuilder( + fieldLocation, + fieldName, + "Invalid sort criteria" + ); + return searchSort + .optional({ + checkFalsy: true + }) + .custom((value, { req }) => { + let modelString = req.query.model; + if (modelString.equals("hacker")) { + model = Models.Hacker; + } else { + return false; + } + if (!!model.searchableField(value)) { + let sortOrder = param("sort", "Sorting order not found"); + if (!sortOrder.equals("asc") || !sortOrder.equals("desc")) { + return false; + } + } else { + return false; + } + return true; + }); } /** * Validates that field must be a valid date according to javascript Date.parse - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function dateValidator(fieldLocation, fieldname, optional = true) { - const date = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid date"); - if (optional) { - return date.optional({ - checkFalsy: true - }).custom(value => { - return !isNaN(Date.parse(value)); - }).withMessage({ - message: "Date is not valid.", - isValid: date - }); - } else { - return date.exists().withMessage("Date field must be specified").custom(value => { - return !isNaN(Date.parse(value)); - }).withMessage({ - message: "Date is not valid.", - isValid: date - }); - } + const date = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid date" + ); + if (optional) { + return date + .optional({ + checkFalsy: true + }) + .custom(value => { + return !isNaN(Date.parse(value)); + }) + .withMessage({ + message: "Date is not valid.", + isValid: date + }); + } else { + return date + .exists() + .withMessage("Date field must be specified") + .custom(value => { + return !isNaN(Date.parse(value)); + }) + .withMessage({ + message: "Date is not valid.", + isValid: date + }); + } } /** * Validates that field must be a valid phone number, having numbers and having a minimum length of 8 * Regex was not chosen because the number is not restricted to a particular country or location * The smallest number length without country code is 5 digits. With the country code, it makes 8. - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function phoneNumberValidator(fieldLocation, fieldname, optional = true) { - const number = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid phone number"); - if (optional) { - return number.optional({ - checkFalsy: true - }).isLength({ - min: 8 - }).isInt().withMessage("Phone number must consist of numbers."); - } else { - return number.exists().withMessage( - "Phone number must be specified." - ).isLength({ - min: 8 - }).isInt().withMessage("Phone number must consist of numbers."); - } + const number = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "invalid phone number" + ); + if (optional) { + return number + .optional({ + checkFalsy: true + }) + .isLength({ + min: 8 + }) + .isInt() + .withMessage("Phone number must consist of numbers."); + } else { + return number + .exists() + .withMessage("Phone number must be specified.") + .isLength({ + min: 8 + }) + .isInt() + .withMessage("Phone number must consist of numbers."); + } } /** * Validates that field must be an array of routes - * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found * @param {string} fieldname name of the field that needs to be validated. * @param {boolean} optional whether the field is optional or not. */ function routesValidator(fieldLocation, fieldname, optional = true) { - const routes = setProperValidationChainBuilder(fieldLocation, fieldname, "Invalid routes"); - - if (optional) { - return routes - .optional({ - checkFalsy: true - }) - .custom(routesArrayValidationHelper).withMessage("The value must be a route"); - } else { - return routes - .exists() - .withMessage("The route must exist.") - .custom(routesArrayValidationHelper).withMessage("The value must be a route"); - } + const routes = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "Invalid routes" + ); + + if (optional) { + return routes + .optional({ + checkFalsy: true + }) + .custom(routesArrayValidationHelper) + .withMessage("The value must be a route"); + } else { + return routes + .exists() + .withMessage("The route must exist.") + .custom(routesArrayValidationHelper) + .withMessage("The value must be a route"); + } } /** @@ -526,61 +891,70 @@ function routesValidator(fieldLocation, fieldname, optional = true) { * @param {*} routes value to check against */ function routesArrayValidationHelper(routes) { - if (!Array.isArray(routes)) { - return false; + if (!Array.isArray(routes)) { + return false; + } + for (const route of routes) { + if (route.uri === null || typeof route.uri !== "string") { + return false; } - for (const route of routes) { - if (route.uri === null || typeof route.uri !== "string") { - return false; - } - if (route.requestType === null || !checkEnum(route.requestType, Constants.REQUEST_TYPES)) { - return false; - } + if ( + route.requestType === null || + !checkEnum(route.requestType, Constants.REQUEST_TYPES) + ) { + return false; } - return true; + } + return true; } /** * Validates that field must be a value within the enum passed in through parameter 'enums' * @param {"query" | "body" | "header" | "param"} fieldLocation The location where the field should be found. * @param {string} fieldname The name of the field that needs to be validated. - * @param {Object} enums The enum object that the field must be part of. + * @param {Object} enums The enum object that the field must be part of. * @param {boolean} optional Whether the field is optional or not. */ function enumValidator(fieldLocation, fieldname, enums, optional = true) { - const enumValue = setProperValidationChainBuilder(fieldLocation, fieldname, "Invalid enums"); - - if (optional) { - return enumValue - .optional({ - checkFalsy: true - }) - .custom((val) => { - return checkEnum(val, enums); - }).withMessage("The value must be part of the enum"); - } else { - return enumValue - .exists() - .withMessage("The value being checked agains the enums must exist.") - .custom((val) => { - return checkEnum(val, enums); - }).withMessage("The value must be part of the enum"); - } + const enumValue = setProperValidationChainBuilder( + fieldLocation, + fieldname, + "Invalid enums" + ); + + if (optional) { + return enumValue + .optional({ + checkFalsy: true + }) + .custom(val => { + return checkEnum(val, enums); + }) + .withMessage("The value must be part of the enum"); + } else { + return enumValue + .exists() + .withMessage("The value being checked agains the enums must exist.") + .custom(val => { + return checkEnum(val, enums); + }) + .withMessage("The value must be part of the enum"); + } } /** * Checks that 'value' is part of 'enums'. 'enums' should be an enum dict. * @param {*} value Should be of the same type as the values of the enum - * @param {Object} enums An object that represents an enum. They keys are the keys of the enum, and the values are the enum values. + * @param {Object} enums An object that represents an enum. They keys are the keys of the enum, and the values are the enum values. * @return {boolean} Returns true if the value is part of the enum, false otherwise. */ function checkEnum(value, enums) { - for (var enumKey in enums) { - if (value === enums[enumKey]) { - return true; - } + for (var enumKey in enums) { + if (value === enums[enumKey]) { + return true; } - return false; + } + return false; } /** @@ -589,47 +963,51 @@ function checkEnum(value, enums) { * @param {string} fieldname name of the field that needs to be validated. * @param {*} errorString the string that is sent back to the user if the field is invalid */ -function setProperValidationChainBuilder(fieldLocation, fieldName, errorString) { - /** - * check: ValidationChainBuilder; - * body: ValidationChainBuilder; - * cookie: ValidationChainBuilder; - * header: ValidationChainBuilder; - * param: ValidationChainBuilder; - * query: ValidationChainBuilder; - */ - switch (fieldLocation) { - case "query": - return query(fieldName, errorString); - case "body": - return body(fieldName, errorString); - case "header": - return header(fieldName, errorString); - case "param": - return param(fieldName, errorString); - default: - logger.error(`${TAG} Invalid field location: ${fieldLocation}`); - } +function setProperValidationChainBuilder( + fieldLocation, + fieldName, + errorString +) { + /** + * check: ValidationChainBuilder; + * body: ValidationChainBuilder; + * cookie: ValidationChainBuilder; + * header: ValidationChainBuilder; + * param: ValidationChainBuilder; + * query: ValidationChainBuilder; + */ + switch (fieldLocation) { + case "query": + return query(fieldName, errorString); + case "body": + return body(fieldName, errorString); + case "header": + return header(fieldName, errorString); + case "param": + return param(fieldName, errorString); + default: + logger.error(`${TAG} Invalid field location: ${fieldLocation}`); + } } module.exports = { - regexValidator: regexValidator, - integerValidator: integerValidator, - mongoIdValidator: mongoIdValidator, - mongoIdArrayValidator: mongoIdArrayValidator, - asciiValidator: asciiValidator, - alphaValidator: alphaValidator, - alphaArrayValidator: alphaArrayValidator, - passwordValidator: passwordValidator, - booleanValidator: booleanValidator, - applicationValidator: applicationValidator, - jwtValidator: jwtValidator, - searchValidator: searchValidator, - searchModelValidator: searchModelValidator, - searchSortValidator: searchSortValidator, - phoneNumberValidator: phoneNumberValidator, - dateValidator: dateValidator, - enumValidator: enumValidator, - routesValidator: routesValidator, - stringValidator: stringValidator -}; \ No newline at end of file + regexValidator: regexValidator, + integerValidator: integerValidator, + mongoIdValidator: mongoIdValidator, + mongoIdArrayValidator: mongoIdArrayValidator, + asciiValidator: asciiValidator, + alphaValidator: alphaValidator, + alphaArrayValidator: alphaArrayValidator, + passwordValidator: passwordValidator, + booleanValidator: booleanValidator, + applicationValidator: applicationValidator, + jwtValidator: jwtValidator, + searchValidator: searchValidator, + searchModelValidator: searchModelValidator, + searchSortValidator: searchSortValidator, + phoneNumberValidator: phoneNumberValidator, + dateValidator: dateValidator, + enumValidator: enumValidator, + routesValidator: routesValidator, + stringValidator: stringValidator +}; diff --git a/models/hacker.model.js b/models/hacker.model.js index 26316e6b..df7e5408 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -4,116 +4,136 @@ const Constants = require("../constants/general.constant"); const mongoose = require("mongoose"); //describes the data type const HackerSchema = new mongoose.Schema({ - //account id - accountId: { - type: mongoose.Schema.Types.ObjectId, - ref: "Account", - required: true - }, - status: { - type: String, - enum: Constants.HACKER_STATUSES, - required: true, - default: "None" - }, - school: { + //account id + accountId: { + type: mongoose.Schema.Types.ObjectId, + ref: "Account", + required: true + }, + status: { + type: String, + enum: Constants.HACKER_STATUSES, + required: true, + default: "None" + }, + application: { + general: { + school: { type: String, required: true - }, - degree: { + }, + degree: { type: String, required: true - }, - //no enum for this - gender: { - type: String - }, - needsBus: Boolean, - application: { - portfolioURL: { - //gcloud bucket link - resume: { - type: String, - default: "" - }, - github: { - type: String - }, - dropler: { - type: String - }, - personal: { - type: String - }, - linkedIn: { - type: String - }, - other: { - type: String - } + }, + fieldOfStudy: [ + { + type: String, + required: true + } + ], + graduationYear: { + type: Number, + required: true + }, + jobInterest: { + type: String, + enum: Constants.JOB_INTERESTS, + required: true, + default: "None" + }, + URL: { + //gcloud bucket link + resume: { + type: String, + default: "" }, - jobInterest: { - type: String, - enum: Constants.JOB_INTERESTS, - required: true, - default: "None" + github: { + type: String }, - skills: [{ - type: String - }], - //any miscelaneous comments that the user has - comments: { - type: String, - default: "" + dribbble: { + type: String }, - //"Why do you want to come to our hackathon?" - essay: { - type: String, - default: "" + personal: { + type: String + }, + linkedIn: { + type: String }, - team: { - type: mongoose.Schema.Types.ObjectId, - ref: "Team" + other: { + type: String } + } }, - ethnicity: { - type: [{ + shortAnswer: { + skills: [ + { + type: String + } + ], + //any miscelaneous comments that the user has + comments: { + type: String, + default: "" + }, + //"Why do you want to come to our hackathon?" + question1: { + type: String, + default: "" + }, + // "Some Q" + question2: { + type: String, + default: "" + } + }, + other: { + ethnicity: { + type: [ + { type: String, required: true - }], + } + ], required: true - }, - major: [{ - type: String, - required: true - }], - graduationYear: { - type: Number, - required: true - }, - codeOfConduct: { + }, + //no enum for this + gender: { + type: String + }, + codeOfConduct: { type: Boolean, required: true + } }, - teamId: { - type: mongoose.Schema.Types.ObjectId, - ref: "Team" + accomodation: { + needsBus: Boolean + }, + team: { + type: mongoose.Schema.Types.ObjectId, + ref: "Team" } + }, + teamId: { + type: mongoose.Schema.Types.ObjectId, + ref: "Team" + } }); -HackerSchema.methods.toJSON = function () { - const hs = this.toObject(); - delete hs.__v; - hs.id = hs._id; - delete hs._id; - return hs; +HackerSchema.methods.toJSON = function() { + const hs = this.toObject(); + delete hs.__v; + hs.id = hs._id; + delete hs._id; + return hs; }; -HackerSchema.methods.isApplicationComplete = function () { - const hs = this.toObject(); - const portfolioDone = !!hs.application.portfolioURL.resume; - const jobInterestDone = !!hs.application.jobInterest; - const essayDone = !!hs.application.essay; - return portfolioDone && jobInterestDone && essayDone; +HackerSchema.methods.isApplicationComplete = function() { + const hs = this.toObject(); + const portfolioDone = !!hs.application.general.URL.resume; + const jobInterestDone = !!hs.application.general.jobInterest; + const question1Done = !!hs.application.shortAnswer.question1; + const question2Done = !!hs.application.shortAnswer.question2; + return portfolioDone && jobInterestDone && question1Done && question2Done; }; /** @@ -121,14 +141,14 @@ HackerSchema.methods.isApplicationComplete = function () { * @returns {String} type of the field being queried * @description return the type of the field(if it exists and is allowed to be searched on) */ -HackerSchema.statics.searchableField = function (field) { - const schemaField = HackerSchema.path(field) - if (schemaField != undefined) { - return schemaField.instance - } else { - return null; - } +HackerSchema.statics.searchableField = function(field) { + const schemaField = HackerSchema.path(field); + if (schemaField != undefined) { + return schemaField.instance; + } else { + return null; + } }; //export the model -module.exports = mongoose.model("Hacker", HackerSchema); \ No newline at end of file +module.exports = mongoose.model("Hacker", HackerSchema); diff --git a/services/account.service.js b/services/account.service.js index 511331e1..599696d3 100644 --- a/services/account.service.js +++ b/services/account.service.js @@ -10,26 +10,29 @@ const bcrypt = require("bcrypt"); * @description Finds an account by mongoID. */ function findById(id) { - const TAG = `[Account Service # findById]:`; - const query = { - _id: id - }; - - return Account.findById(query, logger.queryCallbackFactory(TAG, "account", query)); + const TAG = `[Account Service # findById]:`; + const query = { + _id: id + }; + + return Account.findById( + query, + logger.queryCallbackFactory(TAG, "account", query) + ); } /** * @function findByEmail - * @param {String} email + * @param {String} email * @return {DocumentQuery} The document query will resolve to either account or null. * @description Find an account by email. */ function findByEmail(email) { - const query = { - email: email - }; + const query = { + email: email + }; - return findOne(query); + return findOne(query); } /** @@ -38,12 +41,12 @@ function findByEmail(email) { * @return {Account | null} either account or null */ async function getAccountIfValid(email, password) { - const account = await findByEmail(email); + const account = await findByEmail(email); - if (!!account && account.comparePassword(password)) { - return account; - } - return null; + if (!!account && account.comparePassword(password)) { + return account; + } + return null; } /** @@ -53,7 +56,7 @@ async function getAccountIfValid(email, password) { * @description Hashes password with bcrypt. */ function hashPassword(password) { - return bcrypt.hashSync(password, 10); + return bcrypt.hashSync(password, 10); } /** @@ -63,9 +66,12 @@ function hashPassword(password) { * @description Finds an account by some query. */ function findOne(query) { - const TAG = `[Account Service # findOne ]:`; + const TAG = `[Account Service # findOne ]:`; - return Account.findOne(query, logger.queryCallbackFactory(TAG, "account", query)); + return Account.findOne( + query, + logger.queryCallbackFactory(TAG, "account", query) + ); } /** @@ -75,28 +81,32 @@ function findOne(query) { * @description Adds a new account to database. */ function addOneAccount(accountDetails) { - const TAG = `[Account Service # addOneAccount ]:`; + const TAG = `[Account Service # addOneAccount ]:`; - const account = new Account(accountDetails); + const account = new Account(accountDetails); - return account.save(); + return account.save(); } /** * @function updateOne * @param {ObjectId} id - * @param {{_id?: ObjectId, firstName?: string, lastName?: string, email?: string, password?: string, dietaryRestrictions?: string, shirtSize?: string}} accountDetails + * @param {{_id?: ObjectId, firstName?: string, lastName?: string, email?: string, password?: string, dietaryRestrictions?: string, shirtSize?: string}} accountDetails * @return {DocumentQuery} The document query will resolve to either account or null. * @description Changes account information to the specified information in accountDetails. */ function updateOne(id, accountDetails) { - const TAG = `[Account Service # updateOne ]:`; + const TAG = `[Account Service # updateOne ]:`; - const query = { - _id: id - }; + const query = { + _id: id + }; - return Account.findOneAndUpdate(query, accountDetails, logger.updateCallbackFactory(TAG, "account")); + return Account.findOneAndUpdate( + query, + accountDetails, + logger.updateCallbackFactory(TAG, "account") + ); } /** @@ -105,20 +115,19 @@ function updateOne(id, accountDetails) { * @param {string} newPassword the new password for the account (in plain-text). */ function updatePassword(id, newPassword) { - const hashed = hashPassword(newPassword); - return updateOne(id, { - password: hashed - }); + const hashed = hashPassword(newPassword); + return updateOne(id, { + password: hashed + }); } - module.exports = { - findOne: findOne, - findById: findById, - findByEmail: findByEmail, - addOneAccount: addOneAccount, - getAccountIfValid: getAccountIfValid, - hashPassword: hashPassword, - updateOne: updateOne, - updatePassword: updatePassword -}; \ No newline at end of file + findOne: findOne, + findById: findById, + findByEmail: findByEmail, + addOneAccount: addOneAccount, + getAccountIfValid: getAccountIfValid, + hashPassword: hashPassword, + updateOne: updateOne, + updatePassword: updatePassword +}; diff --git a/services/hacker.service.js b/services/hacker.service.js index 5993b8b0..6324d612 100644 --- a/services/hacker.service.js +++ b/services/hacker.service.js @@ -15,11 +15,11 @@ const QRCode = require("qrcode"); * @description Adds a new hacker to database. */ function createHacker(hackerDetails) { - const TAG = `[Hacker Service # createHacker]:`; + const TAG = `[Hacker Service # createHacker]:`; - const hacker = new Hacker(hackerDetails); + const hacker = new Hacker(hackerDetails); - return hacker.save(); + return hacker.save(); } /** @@ -30,13 +30,17 @@ function createHacker(hackerDetails) { * @description Update an account specified by its mongoId with information specified by hackerDetails. */ function updateOne(id, hackerDetails) { - const TAG = `[Hacker Service # update ]:`; + const TAG = `[Hacker Service # update ]:`; - const query = { - _id: id - }; + const query = { + _id: id + }; - return Hacker.findOneAndUpdate(query, hackerDetails, logger.updateCallbackFactory(TAG, "hacker")); + return Hacker.findOneAndUpdate( + query, + hackerDetails, + logger.updateCallbackFactory(TAG, "hacker") + ); } /** @@ -46,9 +50,9 @@ function updateOne(id, hackerDetails) { * @description Finds an hacker by the id, which is the mongoId. */ function findById(id) { - const TAG = `[Hacker Service # findById ]:`; + const TAG = `[Hacker Service # findById ]:`; - return Hacker.findById(id, logger.queryCallbackFactory(TAG, "hacker", id)); + return Hacker.findById(id, logger.queryCallbackFactory(TAG, "hacker", id)); } /** @@ -59,14 +63,18 @@ function findById(id) { * @description Finds an hacker by some query. */ async function findIds(queries) { - const TAG = `[Hacker Service # findIds ]:`; - let ids = []; - - for (const query of queries) { - let currId = await Hacker.findOne(query, "_id", logger.queryCallbackFactory(TAG, "hacker", query)); - ids.push(currId); - } - return ids; + const TAG = `[Hacker Service # findIds ]:`; + let ids = []; + + for (const query of queries) { + let currId = await Hacker.findOne( + query, + "_id", + logger.queryCallbackFactory(TAG, "hacker", query) + ); + ids.push(currId); + } + return ids; } /** @@ -75,26 +83,29 @@ async function findIds(queries) { * @return {DocumentQuery} A hacker document queried by accountId */ function findByAccountId(accountId) { - const TAG = `[ Hacker Service # findByAccountId ]:`; - - const query = { - accountId: accountId - }; + const TAG = `[ Hacker Service # findByAccountId ]:`; + const query = { + accountId: accountId + }; + console.log(query); - return Hacker.findOne(query, logger.updateCallbackFactory(TAG, "hacker")); + return Hacker.findOne(query, logger.updateCallbackFactory(TAG, "hacker")); } async function getStatsAllHackersCached() { - const TAG = `[ hacker Service # getStatsAll ]`; - if (cache.get(Constants.CACHE_KEY_STATS) !== null) { - logger.info(`${TAG} Getting cached stats`); - return cache.get(Constants.CACHE_KEY_STATS); - } - const allHackers = await Hacker.find({}, logger.updateCallbackFactory(TAG, "hacker")).populate({ - path: "accountId", - }); - cache.put(Constants.CACHE_KEY_STATS, stats, Constants.CACHE_TIMEOUT_STATS); //set a time-out of 5 minutes - return getStats(allHackers); + const TAG = `[ hacker Service # getStatsAll ]`; + if (cache.get(Constants.CACHE_KEY_STATS) !== null) { + logger.info(`${TAG} Getting cached stats`); + return cache.get(Constants.CACHE_KEY_STATS); + } + const allHackers = await Hacker.find( + {}, + logger.updateCallbackFactory(TAG, "hacker") + ).populate({ + path: "accountId" + }); + cache.put(Constants.CACHE_KEY_STATS, stats, Constants.CACHE_TIMEOUT_STATS); //set a time-out of 5 minutes + return getStats(allHackers); } /** @@ -102,10 +113,10 @@ async function getStatsAllHackersCached() { * @param {string} str The string to be encoded in the QR code. */ async function generateQRCode(str) { - const response = await QRCode.toDataURL(str, { - scale: 4 - }); - return response; + const response = await QRCode.toDataURL(str, { + scale: 4 + }); + return response; } /** @@ -115,67 +126,95 @@ async function generateQRCode(str) { * @param {string} id The ID of the hacker to view */ function generateHackerViewLink(httpOrHttps, domain, id) { - const link = `${httpOrHttps}://${domain}/application/view/${id}`; - return link; + const link = `${httpOrHttps}://${domain}/application/view/${id}`; + return link; } function getStats(hackers) { - const TAG = `[ hacker Service # getStats ]`; - const stats = { - total: 0, - status: {}, - school: {}, - degree: {}, - gender: {}, - needsBus: {}, - ethnicity: {}, - jobInterest: {}, - major: {}, - graduationYear: {}, - dietaryRestrictions: {}, - shirtSize: {}, - age: {} - }; - - hackers.forEach((hacker) => { - if (!hacker.accountId) { - // user is no longer with us for some reason :( - return; - } - stats.total += 1; - stats.status[hacker.status] = (stats.status[hacker.status]) ? stats.status[hacker.status] + 1 : 1; - stats.school[hacker.school] = (stats.school[hacker.school]) ? stats.school[hacker.school] + 1 : 1; - stats.degree[hacker.degree] = (stats.degree[hacker.degree]) ? stats.degree[hacker.degree] + 1 : 1; - stats.gender[hacker.gender] = (stats.gender[hacker.gender]) ? stats.gender[hacker.gender] + 1 : 1; - stats.needsBus[hacker.needsBus] = (stats.needsBus[hacker.needsBus]) ? stats.needsBus[hacker.needsBus] + 1 : 1; - - for (const ethnicity of hacker.ethnicity) { - stats.ethnicity[ethnicity] = (stats.ethnicity[ethnicity]) ? stats.ethnicity[ethnicity] + 1 : 1; - } - - stats.jobInterest[hacker.application.jobInterest] = (stats.jobInterest[hacker.application.jobInterest]) ? stats.jobInterest[hacker.application.jobInterest] + 1 : 1; - stats.major[hacker.major] = (stats.major[hacker.major]) ? stats.major[hacker.major] + 1 : 1; - stats.graduationYear[hacker.graduationYear] = (stats.graduationYear[hacker.graduationYear]) ? stats.graduationYear[hacker.graduationYear] + 1 : 1; - - for (const dietaryRestrictions of hacker.accountId.dietaryRestrictions) { - stats.dietaryRestrictions[dietaryRestrictions] = (stats.dietaryRestrictions[dietaryRestrictions]) ? stats.dietaryRestrictions[dietaryRestrictions] + 1 : 1; - } - stats.shirtSize[hacker.accountId.shirtSize] = (stats.shirtSize[hacker.accountId.shirtSize]) ? stats.shirtSize[hacker.accountId.shirtSize] + 1 : 1; - const age = hacker.accountId.getAge(); - stats.age[age] = (stats.age[age]) ? stats.age[age] + 1 : 1; - }); - return stats; -} + const TAG = `[ hacker Service # getStats ]`; + const stats = { + total: 0, + status: {}, + school: {}, + degree: {}, + gender: {}, + needsBus: {}, + ethnicity: {}, + jobInterest: {}, + major: {}, + graduationYear: {}, + dietaryRestrictions: {}, + shirtSize: {}, + age: {} + }; + + hackers.forEach(hacker => { + if (!hacker.accountId) { + // user is no longer with us for some reason :( + return; + } + stats.total += 1; + stats.status[hacker.status] = stats.status[hacker.status] + ? stats.status[hacker.status] + 1 + : 1; + stats.school[hacker.school] = stats.school[hacker.school] + ? stats.school[hacker.school] + 1 + : 1; + stats.degree[hacker.degree] = stats.degree[hacker.degree] + ? stats.degree[hacker.degree] + 1 + : 1; + stats.gender[hacker.gender] = stats.gender[hacker.gender] + ? stats.gender[hacker.gender] + 1 + : 1; + stats.needsBus[hacker.needsBus] = stats.needsBus[hacker.needsBus] + ? stats.needsBus[hacker.needsBus] + 1 + : 1; + + for (const ethnicity of hacker.ethnicity) { + stats.ethnicity[ethnicity] = stats.ethnicity[ethnicity] + ? stats.ethnicity[ethnicity] + 1 + : 1; + } + stats.jobInterest[hacker.application.jobInterest] = stats.jobInterest[ + hacker.application.jobInterest + ] + ? stats.jobInterest[hacker.application.jobInterest] + 1 + : 1; + stats.major[hacker.major] = stats.major[hacker.major] + ? stats.major[hacker.major] + 1 + : 1; + stats.graduationYear[hacker.graduationYear] = stats.graduationYear[ + hacker.graduationYear + ] + ? stats.graduationYear[hacker.graduationYear] + 1 + : 1; + + for (const dietaryRestrictions of hacker.accountId.dietaryRestrictions) { + stats.dietaryRestrictions[dietaryRestrictions] = stats + .dietaryRestrictions[dietaryRestrictions] + ? stats.dietaryRestrictions[dietaryRestrictions] + 1 + : 1; + } + stats.shirtSize[hacker.accountId.shirtSize] = stats.shirtSize[ + hacker.accountId.shirtSize + ] + ? stats.shirtSize[hacker.accountId.shirtSize] + 1 + : 1; + const age = hacker.accountId.getAge(); + stats.age[age] = stats.age[age] ? stats.age[age] + 1 : 1; + }); + return stats; +} module.exports = { - createHacker: createHacker, - findById: findById, - updateOne: updateOne, - findIds: findIds, - findByAccountId: findByAccountId, - getStats: getStats, - getStatsAllHackersCached: getStatsAllHackersCached, - generateQRCode: generateQRCode, - generateHackerViewLink: generateHackerViewLink, -}; \ No newline at end of file + createHacker: createHacker, + findById: findById, + updateOne: updateOne, + findIds: findIds, + findByAccountId: findByAccountId, + getStats: getStats, + getStatsAllHackersCached: getStatsAllHackersCached, + generateQRCode: generateQRCode, + generateHackerViewLink: generateHackerViewLink +}; From 795832d7178d29bc7216d32489647cae8cee34e4 Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Fri, 29 Nov 2019 20:39:43 -0500 Subject: [PATCH 170/243] minor changes to validation schema --- middlewares/validators/hacker.validator.js | 8 ------- middlewares/validators/validator.helper.js | 27 ++++++++++++++++------ models/hacker.model.js | 6 ++++- services/hacker.service.js | 1 - 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js index 90fc942a..27fd7d2d 100644 --- a/middlewares/validators/hacker.validator.js +++ b/middlewares/validators/hacker.validator.js @@ -6,15 +6,7 @@ module.exports = { newHackerValidator: [ // status will be added automatically VALIDATOR.mongoIdValidator("body", "accountId", false), - // VALIDATOR.stringValidator("body", "school", false), - // VALIDATOR.stringValidator("body", "degree", false), - // VALIDATOR.stringValidator("body", "gender", false), - // VALIDATOR.booleanValidator("body", "needsBus", false), VALIDATOR.applicationValidator("body", "application", false), - // VALIDATOR.alphaArrayValidator("body", "ethnicity", false), - // VALIDATOR.alphaArrayValidator("body", "major", false), - // VALIDATOR.integerValidator("body", "graduationYear", false, 2019, 2030), - // VALIDATOR.booleanValidator("body", "codeOfConduct", false, true), VALIDATOR.mongoIdValidator("body", "teamId", true) ], diff --git a/middlewares/validators/validator.helper.js b/middlewares/validators/validator.helper.js index 7548369d..c674e2d1 100644 --- a/middlewares/validators/validator.helper.js +++ b/middlewares/validators/validator.helper.js @@ -390,7 +390,8 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { ethnicity: false, bus: false, graduationYear: false, - codeOfConduct: false, + codeOfConduct_MLH: false, + codeOfConduct_MCHACKS: false, github: false, dribbble: false, personal: false, @@ -446,9 +447,14 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { 2019, 2030 ); - hasValid.codeOfConduct = booleanValidator( + hasValid.codeOfConduct_MLH = booleanValidator( "body", - "application.accomodation.needsBus", + "application.other.codeOfConduct_MLH", + false + ); + hasValid.codeOfConduct_MCHACKS = booleanValidator( + "body", + "appliction.other.codeOfConduct_MCHACKS", false ); const jobInterests = Constants.JOB_INTERESTS; @@ -489,7 +495,8 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { hasValid.graduationYear && hasValid.ethnicity && hasValid.bus && - hasValid.codeOfConduct && + hasValid.codeOfConduct_MLH && + hasValid.codeOfConduct_MCHACKS && hasValid.github && hasValid.dribbble && hasValid.personal && @@ -544,9 +551,14 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { 2019, 2030 ); - hasValid.codeOfConduct = booleanValidator( + hasValid.codeOfConduct_MLH = booleanValidator( "body", - "application.accomodation.needsBus", + "application.other.codeOfConduct_MLH", + false + ); + hasValid.codeOfConduct_MCHACKS = booleanValidator( + "body", + "appliction.other.codeOfConduct_MCHACKS", false ); const jobInterests = Constants.JOB_INTERESTS; @@ -587,7 +599,8 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { hasValid.graduationYear && hasValid.ethnicity && hasValid.bus && - hasValid.codeOfConduct && + hasValid.codeOfConduct_MLH && + hasValid.codeOfConduct_MCHACKS && hasValid.github && hasValid.dribbble && hasValid.personal && diff --git a/models/hacker.model.js b/models/hacker.model.js index df7e5408..dd9a75ac 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -101,7 +101,11 @@ const HackerSchema = new mongoose.Schema({ gender: { type: String }, - codeOfConduct: { + codeOfConduct_MLH: { + type: Boolean, + required: true + }, + codeOfConduct_MCHACKS: { type: Boolean, required: true } diff --git a/services/hacker.service.js b/services/hacker.service.js index 6324d612..14b33fbb 100644 --- a/services/hacker.service.js +++ b/services/hacker.service.js @@ -87,7 +87,6 @@ function findByAccountId(accountId) { const query = { accountId: accountId }; - console.log(query); return Hacker.findOne(query, logger.updateCallbackFactory(TAG, "hacker")); } From 8391fba2cff127b7131c815b0c8d925a913391e4 Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Sat, 30 Nov 2019 11:40:27 -0500 Subject: [PATCH 171/243] Changed parsing of hacker and validation of application --- controllers/hacker.controller.js | 105 ++-- middlewares/hacker.middleware.js | 29 +- middlewares/validators/validator.helper.js | 13 + models/hacker.model.js | 15 +- routes/api/hacker.js | 673 +++++++++++---------- services/hacker.service.js | 4 +- services/storage.service.js | 157 ++--- 7 files changed, 498 insertions(+), 498 deletions(-) diff --git a/controllers/hacker.controller.js b/controllers/hacker.controller.js index fb2182c6..cecd9449 100644 --- a/controllers/hacker.controller.js +++ b/controllers/hacker.controller.js @@ -1,7 +1,7 @@ "use strict"; const Constants = { - Success: require("../constants/success.constant"), - Error: require("../constants/error.constant"), + Success: require("../constants/success.constant"), + Error: require("../constants/error.constant") }; /** @@ -12,24 +12,24 @@ const Constants = { * @description Returns the JSON of hacker object located in req.body.hacker */ function showHacker(req, res) { - return res.status(200).json({ - message: Constants.Success.HACKER_READ, - data: req.body.hacker.toJSON() - }); + return res.status(200).json({ + message: Constants.Success.HACKER_READ, + data: req.body.hacker.toJSON() + }); } /** * @function createdHacker - * @param {{body: {hacker: {_id: ObjectId, accountId: ObjectId, school: string, gender: string, needsBus: boolean, application: {Object}}}}} req + * @param {{body: {hacker: {_id: ObjectId, accountId: ObjectId, status: string, application: {Object}}}}} req * @param {*} res * @return {JSON} Success status * @description returns success message */ function createdHacker(req, res) { - return res.status(200).json({ - message: Constants.Success.HACKER_CREATE, - data: req.body.hacker.toJSON() - }); + return res.status(200).json({ + message: Constants.Success.HACKER_CREATE, + data: req.body.hacker.toJSON() + }); } /** @@ -37,69 +37,68 @@ function createdHacker(req, res) { * @param {{params: {id: ObjectId}, body: {Object}}} req * @param {*} res * @return {JSON} Success or error status - * @description + * @description * Change a hacker's information based on the hacker's mongoID specified in req.params.id. * The id is moved to req.body.id from req.params.id by validation. * Returns a 200 status for an updated hacker. * The new information is located in req.body. */ function updatedHacker(req, res) { - return res.status(200).json({ - message: Constants.Success.HACKER_UPDATE, - data: req.body - }); + return res.status(200).json({ + message: Constants.Success.HACKER_UPDATE, + data: req.body + }); } function uploadedResume(req, res) { - return res.status(200).json({ - message: Constants.Success.RESUME_UPLOAD, - data: { - filename: req.body.gcfilename - } - }); + return res.status(200).json({ + message: Constants.Success.RESUME_UPLOAD, + data: { + filename: req.body.gcfilename + } + }); } function downloadedResume(req, res) { - return res.status(200).json({ - message: Constants.Success.RESUME_DOWNLOAD, - data: { - id: req.body.id, - resume: req.body.resume - } - }); + return res.status(200).json({ + message: Constants.Success.RESUME_DOWNLOAD, + data: { + id: req.body.id, + resume: req.body.gcfilename + } + }); } function gotStats(req, res) { - return res.status(200).json({ - message: "Retrieved stats", - data: { - stats: req.body.stats, - } - }); - + return res.status(200).json({ + message: "Retrieved stats", + data: { + stats: req.body.stats + } + }); } function sentWeekOfEmail(req, res) { - return res.status(200).json({ - message: Constants.Success.HACKER_SENT_WEEK_OF, - data: {} - }); + return res.status(200).json({ + message: Constants.Success.HACKER_SENT_WEEK_OF, + data: {} + }); } function sentDayOfEmail(req, res) { - return res.status(200).json({ - message: Constants.Success.HACKER_SENT_DAY_OF, - data: {} - }); + return res.status(200).json({ + message: Constants.Success.HACKER_SENT_DAY_OF, + data: {} + }); } module.exports = { - updatedHacker: updatedHacker, - createdHacker: createdHacker, - uploadedResume: uploadedResume, - downloadedResume: downloadedResume, - showHacker: showHacker, - gotStats: gotStats, - sentWeekOfEmail: sentWeekOfEmail, - sentDayOfEmail: sentDayOfEmail -}; \ No newline at end of file + updatedHacker: updatedHacker, + createdHacker: createdHacker, + uploadedResume: uploadedResume, + downloadedResume: downloadedResume, + showHacker: showHacker, + gotStats: gotStats, + sentWeekOfEmail: sentWeekOfEmail, + sentDayOfEmail: sentDayOfEmail +}; diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 684f1e19..9d191d4c 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -44,32 +44,13 @@ function parseHacker(req, res, next) { const hackerDetails = { _id: mongoose.Types.ObjectId(), accountId: req.body.accountId, - school: req.body.school, - degree: req.body.degree, - gender: req.body.gender, - needsBus: req.body.needsBus, application: req.body.application, - - ethnicity: req.body.ethnicity, - major: req.body.major, - graduationYear: req.body.graduationYear, - codeOfConduct: req.body.codeOfConduct, - teamId: req.body.teamId }; req.body.token = req.body.authorization; delete req.body.accountId; - delete req.body.school; - delete req.body.degree; - delete req.body.gender; - delete req.body.needsBus; delete req.body.application; - delete req.body.authorization; - delete req.body.ethnicity; - delete req.body.major; - delete req.body.graduationYear; - delete req.body.codeOfConduct; delete req.body.teamId; req.body.hackerDetails = hackerDetails; @@ -241,7 +222,7 @@ async function uploadResume(req, res, next) { req.body.gcfilename = gcfilename; await Services.Hacker.updateOne(req.hacker.id, { $set: { - "application.portfolioURL.resume": gcfilename + "application.general.URL.resume": gcfilename } }); return next(); @@ -258,11 +239,12 @@ async function downloadResume(req, res, next) { if ( hacker && hacker.application && - hacker.application.portfolioURL && - hacker.application.portfolioURL.resume + hacker.application.general && + hacker.application.general.URL && + hacker.application.general.URL.resume ) { req.body.resume = await Services.Storage.download( - hacker.application.portfolioURL.resume + hacker.application.general.URL.resume ); } else { return next({ @@ -523,7 +505,6 @@ async function createHacker(req, res, next) { } }); } - const hacker = await Services.Hacker.createHacker(hackerDetails); if (!!hacker) { diff --git a/middlewares/validators/validator.helper.js b/middlewares/validators/validator.helper.js index c674e2d1..7ca5a91e 100644 --- a/middlewares/validators/validator.helper.js +++ b/middlewares/validators/validator.helper.js @@ -389,6 +389,7 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { gender: false, ethnicity: false, bus: false, + gender: false, graduationYear: false, codeOfConduct_MLH: false, codeOfConduct_MCHACKS: false, @@ -440,6 +441,11 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { "application.other.ethnicity", false ); + hasValid.gender = stringValidator( + "body", + "application.other.gender", + false + ); hasValid.graduationYear = integerValidator( "body", "application.general.graduationYear", @@ -494,6 +500,7 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { hasValid.fieldOfStudy && hasValid.graduationYear && hasValid.ethnicity && + hasValid.gender && hasValid.bus && hasValid.codeOfConduct_MLH && hasValid.codeOfConduct_MCHACKS && @@ -544,6 +551,11 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { "application.other.ethnicity", false ); + hasValid.gender = stringValidator( + "body", + "application.other.gender", + false + ); hasValid.graduationYear = integerValidator( "body", "application.general.graduationYear", @@ -598,6 +610,7 @@ function applicationValidator(fieldLocation, fieldname, optional = true) { hasValid.fieldOfStudy && hasValid.graduationYear && hasValid.ethnicity && + hasValid.gender && hasValid.bus && hasValid.codeOfConduct_MLH && hasValid.codeOfConduct_MCHACKS && diff --git a/models/hacker.model.js b/models/hacker.model.js index dd9a75ac..9c78cefd 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -1,5 +1,4 @@ "use strict"; - const Constants = require("../constants/general.constant"); const mongoose = require("mongoose"); //describes the data type @@ -45,8 +44,7 @@ const HackerSchema = new mongoose.Schema({ URL: { //gcloud bucket link resume: { - type: String, - default: "" + type: String }, github: { type: String @@ -79,12 +77,14 @@ const HackerSchema = new mongoose.Schema({ //"Why do you want to come to our hackathon?" question1: { type: String, - default: "" + default: "", + required: true }, // "Some Q" question2: { type: String, - default: "" + default: "", + required: true } }, other: { @@ -97,9 +97,9 @@ const HackerSchema = new mongoose.Schema({ ], required: true }, - //no enum for this gender: { - type: String + type: String, + required: true }, codeOfConduct_MLH: { type: Boolean, @@ -133,6 +133,7 @@ HackerSchema.methods.toJSON = function() { }; HackerSchema.methods.isApplicationComplete = function() { const hs = this.toObject(); + console.log(hs); const portfolioDone = !!hs.application.general.URL.resume; const jobInterestDone = !!hs.application.general.jobInterest; const question1Done = !!hs.application.shortAnswer.question1; diff --git a/routes/api/hacker.js b/routes/api/hacker.js index b0289e35..e3518966 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -1,32 +1,32 @@ "use strict"; const express = require("express"); const Controllers = { - Hacker: require("../../controllers/hacker.controller") + Hacker: require("../../controllers/hacker.controller") }; const Middleware = { - Validator: { - /* Insert the require statement to the validator file here */ - Hacker: require("../../middlewares/validators/hacker.validator"), - RouteParam: require("../../middlewares/validators/routeParam.validator") - }, - /* Insert all of ther middleware require statements here */ - parseBody: require("../../middlewares/parse-body.middleware"), - Util: require("../../middlewares/util.middleware"), - Hacker: require("../../middlewares/hacker.middleware"), - Auth: require("../../middlewares/auth.middleware"), - Search: require("../../middlewares/search.middleware") + Validator: { + /* Insert the require statement to the validator file here */ + Hacker: require("../../middlewares/validators/hacker.validator"), + RouteParam: require("../../middlewares/validators/routeParam.validator") + }, + /* Insert all of ther middleware require statements here */ + parseBody: require("../../middlewares/parse-body.middleware"), + Util: require("../../middlewares/util.middleware"), + Hacker: require("../../middlewares/hacker.middleware"), + Auth: require("../../middlewares/auth.middleware"), + Search: require("../../middlewares/search.middleware") }; const Services = { - Hacker: require("../../services/hacker.service"), - Account: require("../../services/account.service") + Hacker: require("../../services/hacker.service"), + Account: require("../../services/account.service") }; const CONSTANTS = require("../../constants/general.constant"); module.exports = { - activate: function(apiRouter) { - const hackerRouter = express.Router(); + activate: function(apiRouter) { + const hackerRouter = express.Router(); - /** + /** * @api {get} /hacker/self get information about own hacker * @apiName self * @apiGroup Hacker @@ -70,15 +70,15 @@ module.exports = { * @apiErrorExample {object} Error-Response: * {"message": "Hacker not found", "data": {}} */ - hackerRouter.route("/self").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), + hackerRouter.route("/self").get( + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), - Middleware.Hacker.findSelf, - Controllers.Hacker.showHacker - ); + Middleware.Hacker.findSelf, + Controllers.Hacker.showHacker + ); - /** + /** * @api {post} /hacker/ create a new hacker * @apiName createHacker * @apiGroup Hacker @@ -121,7 +121,7 @@ module.exports = { "portfolioURL":{ "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", "github":"https://github.com/abcd", - "dropler":"https://dribbble.com/abcd", + "dribbble":"https://dribbble.com/abcd", "personal":"https://www.hi.com/", "linkedIn":"https://linkedin.com/in/abcd", "other":"https://github.com/hackmcgill/hackerAPI/issues/168" @@ -148,28 +148,28 @@ module.exports = { * @apiErrorExample {object} Error-Response: * {"message": "Error while creating hacker", "data": {}} */ - hackerRouter.route("/").post( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), + hackerRouter.route("/").post( + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.newHackerValidator, + Middleware.Validator.Hacker.newHackerValidator, - Middleware.parseBody.middleware, - // validate type - Middleware.Hacker.validateConfirmedStatus, - // validate that the accountId is not being used for any other thing - Middleware.Hacker.checkDuplicateAccountLinks, + Middleware.parseBody.middleware, + // validate type + Middleware.Hacker.validateConfirmedStatus, + // validate that the accountId is not being used for any other thing + Middleware.Hacker.checkDuplicateAccountLinks, - Middleware.Hacker.parseHacker, + Middleware.Hacker.parseHacker, - Middleware.Hacker.addDefaultStatus, - Middleware.Auth.createRoleBindings(CONSTANTS.HACKER), - Middleware.Hacker.createHacker, - Middleware.Hacker.sendAppliedStatusEmail, - Controllers.Hacker.createdHacker - ); + Middleware.Hacker.addDefaultStatus, + Middleware.Auth.createRoleBindings(CONSTANTS.HACKER), + Middleware.Hacker.createHacker, + Middleware.Hacker.sendAppliedStatusEmail, + Controllers.Hacker.createdHacker + ); - /** + /** * @api {get} /hacker/stats * Gets the stats of all of the hackers who have applied. * @apiName getHackerStats @@ -204,86 +204,90 @@ module.exports = { * } * */ - hackerRouter.route("/stats").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.statsValidator, - Middleware.parseBody.middleware, - Middleware.Search.setExpandTrue, - Middleware.Search.parseQuery, - Middleware.Search.executeQuery, - Middleware.Hacker.getStats, - Controllers.Hacker.gotStats - ); - - /** - * @api {patch} /hacker/status/:id update a hacker's status - * @apiName patchHackerStatus - * @apiGroup Hacker - * @apiVersion 0.0.9 - * - * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in") - * @apiSuccess {string} message Success message - * @apiSuccess {object} data Hacker object - * @apiSuccessExample {object} Success-Response: - * { - * "message": "Changed hacker information", - * "data": { - * "status": "Accepted" - * } - * } - * @apiPermission Administrator - */ - hackerRouter.route("/status/:id").patch( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.Hacker.updateStatusValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, - Middleware.Hacker.updateHacker, - Middleware.Hacker.sendStatusUpdateEmail, - Controllers.Hacker.updatedHacker - ); - - /** - * @api {patch} /hacker/checkin/:id update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed. - * @apiName checkinHacker - * @apiGroup Hacker - * @apiVersion 0.0.9 - * @apiParam (body) {string} [status] Check-in status. "Checked-in" - * @apiSuccess {string} message Success message - * @apiSuccess {object} data Hacker object - * @apiSuccessExample {object} Success-Response: - * { - * "message": "Changed hacker information", - * "data": { - * "status": "Checked-in" - * } - * } - * @apiPermission Administrator - * @apiPermission Volunteer - */ - hackerRouter.route("/checkin/:id").patch( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, - - Middleware.Hacker.checkStatus([ - CONSTANTS.HACKER_STATUS_ACCEPTED, - CONSTANTS.HACKER_STATUS_CONFIRMED - ]), - Middleware.Hacker.parseCheckIn, - Middleware.Hacker.updateHacker, - - Middleware.Hacker.sendStatusUpdateEmail, - Controllers.Hacker.updatedHacker - ); - - /** + hackerRouter + .route("/stats") + .get( + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Validator.Hacker.statsValidator, + Middleware.parseBody.middleware, + Middleware.Search.setExpandTrue, + Middleware.Search.parseQuery, + Middleware.Search.executeQuery, + Middleware.Hacker.getStats, + Controllers.Hacker.gotStats + ); + + /** + * @api {patch} /hacker/status/:id update a hacker's status + * @apiName patchHackerStatus + * @apiGroup Hacker + * @apiVersion 0.0.9 + * + * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in") + * @apiSuccess {string} message Success message + * @apiSuccess {object} data Hacker object + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Changed hacker information", + * "data": { + * "status": "Accepted" + * } + * } + * @apiPermission Administrator + */ + hackerRouter + .route("/status/:id") + .patch( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + Middleware.Validator.Hacker.updateStatusValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, + Middleware.Hacker.updateHacker, + Middleware.Hacker.sendStatusUpdateEmail, + Controllers.Hacker.updatedHacker + ); + + /** + * @api {patch} /hacker/checkin/:id update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed. + * @apiName checkinHacker + * @apiGroup Hacker + * @apiVersion 0.0.9 + * @apiParam (body) {string} [status] Check-in status. "Checked-in" + * @apiSuccess {string} message Success message + * @apiSuccess {object} data Hacker object + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Changed hacker information", + * "data": { + * "status": "Checked-in" + * } + * } + * @apiPermission Administrator + * @apiPermission Volunteer + */ + hackerRouter.route("/checkin/:id").patch( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, + + Middleware.Hacker.checkStatus([ + CONSTANTS.HACKER_STATUS_ACCEPTED, + CONSTANTS.HACKER_STATUS_CONFIRMED + ]), + Middleware.Hacker.parseCheckIn, + Middleware.Hacker.updateHacker, + + Middleware.Hacker.sendStatusUpdateEmail, + Controllers.Hacker.updatedHacker + ); + + /** * @api {patch} /hacker/:id update a hacker's information. * @apiDescription This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id. * @apiName patchHacker @@ -302,7 +306,7 @@ module.exports = { "portfolioURL":{ "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", "github":"https://github.com/abcd", - "dropler":"https://dribbble.com/abcd", + "dribbble":"https://dribbble.com/abcd", "personal":"https://www.hi.com/", "linkedIn":"https://linkedin.com/in/abcd", "other":"https://github.com/hackmcgill/hackerAPI/issues/168" @@ -324,7 +328,7 @@ module.exports = { "portfolioURL":{ "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", "github":"https://github.com/abcd", - "dropler":"https://dribbble.com/abcd", + "dribbble":"https://dribbble.com/abcd", "personal":"https://www.hi.com/", "linkedIn":"https://linkedin.com/in/abcd", "other":"https://github.com/hackmcgill/hackerAPI/issues/168" @@ -349,22 +353,22 @@ module.exports = { * @apiErrorExample {object} Error-Response: * {"message": "Error while updating hacker", "data": {}} */ - hackerRouter.route("/:id").patch( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + hackerRouter.route("/:id").patch( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.Hacker.updateHackerValidator, + Middleware.Validator.Hacker.updateHackerValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, - Middleware.Hacker.updateHacker, - Middleware.Hacker.updateStatusIfApplicationCompleted, - Controllers.Hacker.updatedHacker - ); + Middleware.Hacker.updateHacker, + Middleware.Hacker.updateStatusIfApplicationCompleted, + Controllers.Hacker.updatedHacker + ); - /** + /** * @api {get} /hacker/:id get a hacker's information * @apiName getHacker * @apiGroup Hacker @@ -410,18 +414,18 @@ module.exports = { * @apiErrorExample {object} Error-Response: * {"message": "Hacker not found", "data": {}} */ - hackerRouter.route("/:id").get( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + hackerRouter.route("/:id").get( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.parseBody.middleware, + Middleware.parseBody.middleware, - Middleware.Hacker.findById, - Controllers.Hacker.showHacker - ); + Middleware.Hacker.findById, + Controllers.Hacker.showHacker + ); - /** + /** * @api {get} /hacker/email/:email get a hacker's information * @apiName getHacker * @apiGroup Hacker @@ -467,193 +471,194 @@ module.exports = { * @apiErrorExample {object} Error-Response: * {"message": "Hacker not found", "data": {}} */ - hackerRouter.route("/email/:email").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Account.findByEmail]), - - Middleware.Validator.RouteParam.emailValidator, - Middleware.parseBody.middleware, - - Middleware.Hacker.findByEmail, - Controllers.Hacker.showHacker - ); - - hackerRouter.route("/resume/:id") - /** - * @api {post} /hacker/resume/:id upload or update resume for a hacker. - * @apiName postHackerResume - * @apiGroup Hacker - * @apiVersion 0.0.8 - * @apiDescription NOTE: This must be sent via multipart/form-data POST request - * - * @apiParam (param) {ObjectId} id Hacker id - * @apiParam (body) {File} resume The uploaded file. - * - * @apiSuccess {String} message Success message - * @apiSuccess {Object} data Location in the bucket that the file was stored. - * @apiSuccessExample {json} Success-Response: - * HTTP/1.1 200 OK - * { - * message: "Uploaded resume", - * data: { - * filename: "resumes/1535032624768-507f191e810c19729de860ea" - * } - * } - * - * @apiPermission Must be logged in, and the account id must be linked to the hacker. - */ - .post( - //TODO: authenticate middleware - Middleware.Validator.Hacker.uploadResumeValidator, - Middleware.parseBody.middleware, - //verify that the hacker entity contains the account id - Middleware.Hacker.ensureAccountLinkedToHacker, - //load resume into memory - Middleware.Util.Multer.single("resume"), - //upload resume to storage and update hacker profile - Middleware.Hacker.uploadResume, - //controller response - Controllers.Hacker.uploadedResume - ) - /** - * @api {get} /hacker/resume:id get the resume for a hacker. - * @apiName getHackerResume - * @apiGroup Hacker - * @apiVersion 0.0.8 - * - * @apiParam (param) {ObjectId} id Hacker id - * - * @apiSuccess {String} message Success message - * @apiSuccessExample {json} Success-Response: - * HTTP/1.1 200 OK - * { - * message: "Downloaded resume", - * data: { - * id: "507f191e810c19729de860ea", - * resume: [Buffer] - * } - * } - * @apiError {String} message "Resume does not exist" - * @apiErrorExample {json} Error-Response: - * HTTP/1.1 404 - * { - * message: "Resume not found", - * data: {} - * } - * @apiSampleRequest off - * @apiPermission Must be logged in, and the account id must be linked to the hacker. - */ - .get( - //TODO: authenticate middleware - Middleware.Validator.Hacker.downloadResumeValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.downloadResume, - Controllers.Hacker.downloadedResume - ); - - /** - * @api {patch} /hacker/confirmation/:id - * Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'. - * @apiName patchHackerConfirmed - * @apiGroup Hacker - * @apiVersion 0.0.9 - * - * @apiParam (body) {string} [status] The new status of the hacker. "Accepted", "Confirmed", or "Cancelled" - * @apiSuccess {string} message Success message - * @apiSuccess {object} data Hacker object - * @apiSuccessExample {object} Success-Response: - * { - * "message": "Changed hacker information", - * "data": { - * "status": "Confirmed" - * } - * } - * @apiPermission Administrator - * @apiPermission Hacker - */ - hackerRouter.route("/confirmation/:id").patch( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - - Middleware.Validator.Hacker.updateConfirmationValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, - - Middleware.Hacker.checkStatus([ - CONSTANTS.HACKER_STATUS_ACCEPTED, - CONSTANTS.HACKER_STATUS_CONFIRMED, - CONSTANTS.HACKER_STATUS_CANCELLED - ]), - - Middleware.Hacker.parseConfirmation, - Middleware.Hacker.updateHacker, - - Middleware.Hacker.sendStatusUpdateEmail, - Controllers.Hacker.updatedHacker - ); - - /** - * @api {post} /hacker/email/weekOf/:id - * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. - * @apiName postHackerSendWeekOfEmail - * @apiGroup Hacker - * @apiVersion 0.0.9 - * - * @apiParam (param) {string} [status] The hacker ID - * @apiSuccess {string} message Success message - * @apiSuccess {object} data empty - * @apiSuccessExample {object} Success-Response: - * { - * "message": "Hacker week-of email sent.", - * "data": {} - * } - * @apiPermission Administrator - */ - hackerRouter.route("/email/weekOf/:id").post( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - - Middleware.parseBody.middleware, - Middleware.Hacker.findById, - Middleware.Hacker.checkStatus([ - CONSTANTS.HACKER_STATUS_CONFIRMED, - CONSTANTS.HACKER_STATUS_CHECKED_IN - ]), - Middleware.Hacker.sendWeekOfEmail, - Controllers.Hacker.sentWeekOfEmail - ); - - /** - * @api {post} /hacker/email/weekOf/:id - * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. - * @apiName postHackerSendWeekOfEmail - * @apiGroup Hacker - * @apiVersion 0.0.9 - * - * @apiParam (param) {string} [status] The hacker ID - * @apiSuccess {string} message Success message - * @apiSuccess {object} data empty - * @apiSuccessExample {object} Success-Response: - * { - * "message": "Hacker week-of email sent.", - * "data": {} - * } - * @apiPermission Administrator - */ - hackerRouter.route("/email/dayOf/:id").post( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - - Middleware.parseBody.middleware, - Middleware.Hacker.findById, - Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CHECKED_IN]), - Middleware.Hacker.sendDayOfEmail, - Controllers.Hacker.sentDayOfEmail - ); - - apiRouter.use("/hacker", hackerRouter); - } + hackerRouter.route("/email/:email").get( + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Account.findByEmail]), + + Middleware.Validator.RouteParam.emailValidator, + Middleware.parseBody.middleware, + + Middleware.Hacker.findByEmail, + Controllers.Hacker.showHacker + ); + + hackerRouter + .route("/resume/:id") + /** + * @api {post} /hacker/resume/:id upload or update resume for a hacker. + * @apiName postHackerResume + * @apiGroup Hacker + * @apiVersion 0.0.8 + * @apiDescription NOTE: This must be sent via multipart/form-data POST request + * + * @apiParam (param) {ObjectId} id Hacker id + * @apiParam (body) {File} resume The uploaded file. + * + * @apiSuccess {String} message Success message + * @apiSuccess {Object} data Location in the bucket that the file was stored. + * @apiSuccessExample {json} Success-Response: + * HTTP/1.1 200 OK + * { + * message: "Uploaded resume", + * data: { + * filename: "resumes/1535032624768-507f191e810c19729de860ea" + * } + * } + * + * @apiPermission Must be logged in, and the account id must be linked to the hacker. + */ + .post( + //TODO: authenticate middleware + Middleware.Validator.Hacker.uploadResumeValidator, + Middleware.parseBody.middleware, + //verify that the hacker entity contains the account id + Middleware.Hacker.ensureAccountLinkedToHacker, + //load resume into memory + Middleware.Util.Multer.single("resume"), + //upload resume to storage and update hacker profile + Middleware.Hacker.uploadResume, + //controller response + Controllers.Hacker.uploadedResume + ) + /** + * @api {get} /hacker/resume:id get the resume for a hacker. + * @apiName getHackerResume + * @apiGroup Hacker + * @apiVersion 0.0.8 + * + * @apiParam (param) {ObjectId} id Hacker id + * + * @apiSuccess {String} message Success message + * @apiSuccessExample {json} Success-Response: + * HTTP/1.1 200 OK + * { + * message: "Downloaded resume", + * data: { + * id: "507f191e810c19729de860ea", + * resume: [Buffer] + * } + * } + * @apiError {String} message "Resume does not exist" + * @apiErrorExample {json} Error-Response: + * HTTP/1.1 404 + * { + * message: "Resume not found", + * data: {} + * } + * @apiSampleRequest off + * @apiPermission Must be logged in, and the account id must be linked to the hacker. + */ + .get( + //TODO: authenticate middleware + Middleware.Validator.Hacker.downloadResumeValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.downloadResume, + Controllers.Hacker.downloadedResume + ); + + /** + * @api {patch} /hacker/confirmation/:id + * Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'. + * @apiName patchHackerConfirmed + * @apiGroup Hacker + * @apiVersion 0.0.9 + * + * @apiParam (body) {string} [status] The new status of the hacker. "Accepted", "Confirmed", or "Cancelled" + * @apiSuccess {string} message Success message + * @apiSuccess {object} data Hacker object + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Changed hacker information", + * "data": { + * "status": "Confirmed" + * } + * } + * @apiPermission Administrator + * @apiPermission Hacker + */ + hackerRouter.route("/confirmation/:id").patch( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + + Middleware.Validator.Hacker.updateConfirmationValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, + + Middleware.Hacker.checkStatus([ + CONSTANTS.HACKER_STATUS_ACCEPTED, + CONSTANTS.HACKER_STATUS_CONFIRMED, + CONSTANTS.HACKER_STATUS_CANCELLED + ]), + + Middleware.Hacker.parseConfirmation, + Middleware.Hacker.updateHacker, + + Middleware.Hacker.sendStatusUpdateEmail, + Controllers.Hacker.updatedHacker + ); + + /** + * @api {post} /hacker/email/weekOf/:id + * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. + * @apiName postHackerSendWeekOfEmail + * @apiGroup Hacker + * @apiVersion 0.0.9 + * + * @apiParam (param) {string} [status] The hacker ID + * @apiSuccess {string} message Success message + * @apiSuccess {object} data empty + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Hacker week-of email sent.", + * "data": {} + * } + * @apiPermission Administrator + */ + hackerRouter.route("/email/weekOf/:id").post( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + + Middleware.parseBody.middleware, + Middleware.Hacker.findById, + Middleware.Hacker.checkStatus([ + CONSTANTS.HACKER_STATUS_CONFIRMED, + CONSTANTS.HACKER_STATUS_CHECKED_IN + ]), + Middleware.Hacker.sendWeekOfEmail, + Controllers.Hacker.sentWeekOfEmail + ); + + /** + * @api {post} /hacker/email/weekOf/:id + * @apiDescription Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in. + * @apiName postHackerSendWeekOfEmail + * @apiGroup Hacker + * @apiVersion 0.0.9 + * + * @apiParam (param) {string} [status] The hacker ID + * @apiSuccess {string} message Success message + * @apiSuccess {object} data empty + * @apiSuccessExample {object} Success-Response: + * { + * "message": "Hacker week-of email sent.", + * "data": {} + * } + * @apiPermission Administrator + */ + hackerRouter.route("/email/dayOf/:id").post( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + + Middleware.parseBody.middleware, + Middleware.Hacker.findById, + Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CHECKED_IN]), + Middleware.Hacker.sendDayOfEmail, + Controllers.Hacker.sentDayOfEmail + ); + + apiRouter.use("/hacker", hackerRouter); + } }; diff --git a/services/hacker.service.js b/services/hacker.service.js index 14b33fbb..355a579e 100644 --- a/services/hacker.service.js +++ b/services/hacker.service.js @@ -10,7 +10,7 @@ const QRCode = require("qrcode"); /** * @function createHacker - * @param {{_id: ObjectId, accountId: ObjectId, school: string, gender: string, needsBus: boolean, application: {Object}}} hackerDetails + * @param {{_id: ObjectId, accountId: ObjectId, application: {Object}}} hackerDetails * @return {Promise} The promise will resolve to a hacker object if save is successful. * @description Adds a new hacker to database. */ @@ -25,7 +25,7 @@ function createHacker(hackerDetails) { /** * @function updateOne * @param {ObjectId} id - * @param {{_id?: ObjectId, accountId?: ObjectId, school?: string, gender?: string, needsBus?: boolean, application?: {Object}, teamId?: ObjectId}} hackerDetails + * @param {{_id?: ObjectId, accountId?: ObjectId, application?: {Object}, teamId?: ObjectId}} hackerDetails * @return {DocumentQuery} The document query will resolve to hacker or null. * @description Update an account specified by its mongoId with information specified by hackerDetails. */ diff --git a/services/storage.service.js b/services/storage.service.js index 027c44cb..c7614239 100644 --- a/services/storage.service.js +++ b/services/storage.service.js @@ -1,87 +1,88 @@ "use strict"; // Imports the Google Cloud client library -const GStorage = require('@google-cloud/storage'); +const GStorage = require("@google-cloud/storage"); const Logger = require("./logger.service"); class StorageService { - constructor() { - this.bucketName = process.env.BUCKET_NAME; - try { - this.storage = new GStorage.Storage(); - } catch (error) { - Logger.error(error); - } - this.bucket = this.storage.bucket(this.bucketName); + constructor() { + this.bucketName = process.env.BUCKET_NAME; + try { + this.storage = new GStorage.Storage(); + } catch (error) { + Logger.error(error); } + this.bucket = this.storage.bucket(this.bucketName); + } - /** - * Upload a file to storage. - * @param {{mimetype:string,buffer:Buffer}} file Multer file object - * @param {string} gcfilename the location in the bucket that you want the file stored. - * @returns {Promise} the address of the file that was uploaded - */ - upload(file, gcfilename) { - const blob = this.bucket.file(gcfilename); - const blobStream = blob.createWriteStream({ - metadata: { - contentType: file.mimetype - }, - resumable: false - }); - const _this = this; - return new Promise(function (resolve, reject) { - blobStream.on("finish", () => { - resolve(_this.getPublicUrl(gcfilename)); - }); - blobStream.on("error", reject); - //write the file data into the stream, and end it. - blobStream.end(file.buffer); - }); - } - /** - * Download file from storage. - * @param {string} filename path to file in bucket - * @returns {Promise<[Buffer]>} the file data that was returned - */ - download(filename) { - const file = this.bucket.file(filename); - return new Promise((resolve, reject) => { - file.exists().then((doesExist) => { - if (doesExist) { - file.download() - .then(resolve) - .catch(reject); - } else { - reject("file does not exist"); - } - }); - }); - } - /** - * Delete a file - * @param {*} filename the file that you want to delete - * @returns {Promise<[ApiResponse]>} - */ - delete(filename) { - const file = this.bucket.file(filename); - return file.delete(); - } + /** + * Upload a file to storage. + * @param {{mimetype:string,buffer:Buffer}} file Multer file object + * @param {string} gcfilename the location in the bucket that you want the file stored. + * @returns {Promise} the address of the file that was uploaded + */ + upload(file, gcfilename) { + const blob = this.bucket.file(gcfilename); + const blobStream = blob.createWriteStream({ + metadata: { + contentType: file.mimetype + }, + resumable: false + }); + const _this = this; + return new Promise(function(resolve, reject) { + blobStream.on("finish", () => { + resolve(_this.getPublicUrl(gcfilename)); + }); + blobStream.on("error", reject); + //write the file data into the stream, and end it. + blobStream.end(file.buffer); + }); + } + /** + * Download file from storage. + * @param {string} filename path to file in bucket + * @returns {Promise<[Buffer]>} the file data that was returned + */ + download(filename) { + const file = this.bucket.file(filename); + return new Promise((resolve, reject) => { + file.exists().then(doesExist => { + if (doesExist) { + file + .download() + .then(resolve) + .catch(reject); + } else { + reject("file does not exist"); + } + }); + }); + } + /** + * Delete a file + * @param {*} filename the file that you want to delete + * @returns {Promise<[ApiResponse]>} + */ + delete(filename) { + const file = this.bucket.file(filename); + return file.delete(); + } - /** - * - * @param {*} filename the file that you want to check exists - * @returns {Promise<[Boolean]>} - */ - exists(filename) { - const file = this.bucket.file(filename); - return file.exists(); - } - /** - * Get the public URL of the file - * @param {string} filename the path of the file - */ - getPublicUrl(filename) { - return `https://storage.googleapis.com/${this.bucket.name}/${filename}`; - } + /** + * + * @param {*} filename the file that you want to check exists + * @returns {Promise<[Boolean]>} + */ + exists(filename) { + const file = this.bucket.file(filename); + return file.exists(); + } + /** + * Get the public URL of the file + * @param {string} filename the path of the file + */ + getPublicUrl(filename) { + return `https://storage.googleapis.com/${this.bucket.name}/${filename}`; + } } -module.exports = new StorageService(); \ No newline at end of file +module.exports = new StorageService(); From 2cf5f06d1711ac20a9879deabc89d4772a9d30ab Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Sun, 1 Dec 2019 11:43:52 -0500 Subject: [PATCH 172/243] Fixed all tests --- docs/api/api_data.js | 6378 ++++++++++++++++-------------- docs/api/api_data.json | 2047 ++++++---- middlewares/auth.middleware.js | 722 ++-- middlewares/hacker.middleware.js | 5 +- models/hacker.model.js | 3 +- package-lock.json | 2 +- package.json | 100 +- routes/api/hacker.js | 256 +- scripts/batch_scripts.py | 12 +- services/hacker.service.js | 47 +- tests/account.test.js | 1084 ++--- tests/hacker.test.js | 1878 ++++----- tests/search.service.spec.js | 486 +-- tests/util/hacker.test.util.js | 843 ++-- 14 files changed, 7581 insertions(+), 6282 deletions(-) diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 3bd69968..a0b78b6b 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1,3086 +1,3530 @@ define({ - "api": [{ - "type": "post", - "url": "/account/", - "title": "create a new account", - "name": "create", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "firstName", - "description": "

First name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "lastName", - "description": "

Last name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "pronoun", - "description": "

the pronoun of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "email", - "description": "

Email of the account.

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "dietaryRestrictions", - "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "password", - "description": "

The password of the account.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "birthDate", - "description": "

a Date parsable string.

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" - } - ], - "header": [{ - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/" - }] - }, - { - "type": "get", - "url": "/account/:id", - "title": "gets information from an account with mongoid ':id'", - "name": "getAccount", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] - }, - { - "type": "get", - "url": "/account/invite", - "title": "Get all of the invites.", - "name": "getAllInvites", - "group": "Account", - "version": "0.0.8", - "description": "

Get all of the invites that currently exist in the database.

", - "success": { - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] - }, - { - "type": "post", - "url": "/account/invite", - "title": "invites a user to create an account with the specified accountType", - "name": "inviteAccount", - "group": "Account", - "version": "0.0.8", - "description": "

sends link with token to be used with the account/create route

", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "email", - "description": "

email of the account to be created and where to send the link

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "accountType", - "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

Error object

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] - }, - { - "type": "get", - "url": "/account/self", - "title": "get information about own account", - "name": "self", - "group": "Account", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty object

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/self" - }] - }, + api: [ { - "type": "patch", - "url": "/account/:id", - "title": "update an account's information", - "name": "updateOneUser", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "firstName", - "description": "

First name of the account creator.

" + type: "post", + url: "/account/", + title: "create a new account", + name: "create", + group: "Account", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: false, + field: "firstName", + description: "

First name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "lastName", + description: "

Last name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "pronoun", + description: "

the pronoun of the account creator.

" }, { - "group": "body", - "type": "String", - "optional": true, - "field": "lastName", - "description": "

Last name of the account creator.

" + group: "body", + type: "String", + optional: false, + field: "email", + description: "

Email of the account.

" }, { - "group": "body", - "type": "String", - "optional": true, - "field": "pronoun", - "description": "

the pronoun of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "email", - "description": "

Email of the account.

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "dietaryRestrictions", - "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "birthDate", - "description": "

a Date parsable string.

" - }, - { - "group": "body", - "type": "Number", - "optional": true, - "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" - } - ] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" + group: "body", + type: "String[]", + optional: false, + field: "dietaryRestrictions", + description: + "

Any dietary restrictions for the user. 'None' if there are no restrictions

" }, { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" + group: "body", + type: "String", + optional: false, + field: "shirtSize", + description: + "

Size of the shirt that the user will receive.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "password", + description: "

The password of the account.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "birthDate", + description: "

a Date parsable string.

" + }, + { + group: "body", + type: "Number", + optional: false, + field: "phoneNumber", + description: + "

the user's phone number, represented as a string.

" + } + ], + header: [ + { + group: "header", + type: "JWT", + optional: true, + field: "token", + description: "

the user's invite token.

" } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - }] + examples: [ + { + title: "Request-Example:", + content: + '{ \n "firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "password":"hunter2",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n "shirtSize":"S",\n "birthDate":"10/30/1997"\n}', + type: "json" + } + ] }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] - }, - { - "type": "patch", - "url": "/auth/password/change", - "title": "change password for logged in user", - "name": "changePassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "oldPassword", - "description": "

The current password of the user

" - }, - { - "group": "Parameter", - "type": "String", - "optional": false, - "field": "newPassword", - "description": "

The new password of the user

" - } - ] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] - }, - "permission": [{ - "name": ": Must be logged in" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/change" - }] - }, - { - "type": "post", - "url": "/auth/confirm/:token", - "title": "confirm account using the JWT in :token", - "name": "confirmAccount", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/:token" - }] - }, - { - "type": "post", - "url": "/auth/password/forgot", - "title": "forgot password route", - "name": "forgotPassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - }] - }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/forgot" - }] - }, - { - "type": "get", - "url": "/auth/rolebindings/:id", - "title": "retrieve rolebindings for a user given by their user id :id", - "name": "getRoleBindings", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Rolebindings object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" - }] - }, - { - "type": "get", - "url": "/auth/roles", - "title": "get roles", - "name": "getRoles", - "description": "

get all roles that exist in the database

", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - }] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/roles" - }] - }, - { - "type": "post", - "url": "/auth/login", - "title": "login to the service", - "name": "login", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "string", - "optional": false, - "field": "email", - "description": "

Account email

" - }, - { - "group": "Parameter", - "type": "string", - "optional": false, - "field": "password", - "description": "

Account password

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - }] - }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/login" - }] - }, - { - "type": "get", - "url": "/auth/logout", - "title": "logout of service", - "name": "logout", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - }] - }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/logout" - }] - }, - { - "type": "get", - "url": "/auth/confirm/resend", - "title": "resend confirmation token", - "name": "resendConfirmAccount", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", - "type": "json" - }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ { - "title": "Error-Response:", - "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", - "type": "json" + title: "Success-Response: ", + content: + '{\n "message": "Account creation successful", \n "data": {\n "id": ObjectId("5bff8b9f3274cf001bc71048"),\n \t"firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n \t"shirtSize":"S",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" } ] }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/resend" - }] - }, - { - "type": "post", - "url": "/auth/password/reset", - "title": "reset password", - "name": "resetPassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - }] - }, - "header": { - "fields": { - "Header": [{ - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - }] - }, - "examples": [{ - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] - }, - "permission": [{ - "name": ": must have authentication token" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/reset" - }] - }, - { - "type": "patch", - "url": "/hacker/checkin/:id", - "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", - "name": "checkinHacker", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] }, + examples: [ + { + title: "Error-Response: ", + content: + '{\n "message": "Account already exists", \n "data": {\n "route": "/"\n }\n}', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ { - "name": "Volunteer" + url: "https://api.mchacks.ca/api/account/" } - ], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" - }] + ] }, { - "type": "post", - "url": "/hacker/", - "title": "create a new hacker", - "name": "createHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

ObjectID of the respective account

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "school", - "description": "

Name of the school the hacker goes to

" - }, + type: "get", + url: "/account/:id", + title: "gets information from an account with mongoid ':id'", + name: "getAccount", + group: "Account", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

MongoId of an account

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ { - "group": "body", - "type": "String", - "optional": false, - "field": "gender", - "description": "

Gender of the hacker

" + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" }, { - "group": "body", - "type": "Boolean", - "optional": false, - "field": "needsBus", - "description": "

Whether the hacker requires a bus for transportation

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "ethnicity", - "description": "

the ethnicities of the hacker

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "major", - "description": "

the major of the hacker

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "graduationYear", - "description": "

the graduation year of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": false, - "field": "codeOfConduct", - "description": "

acceptance of the code of conduct

" - }, - { - "group": "body", - "type": "Json", - "optional": false, - "field": "application", - "description": "

The hacker's application. Resume and jobInterest fields are required.

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - }] + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Account found by user id", \n "data": {\n "id": ObjectId("5bff8b9f3274cf001bc71048"),\n "firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n "shirtSize":"S",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" }, { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - }] + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Account not found", "data": {}}', + type: "object" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/" - }] - }, - { - "type": "get", - "url": "/hacker/email/:email", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" - }] - }, - { - "type": "get", - "url": "/hacker/:id", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] - }, - { - "type": "get", - "url": "/hacker/resume:id", - "title": "get the resume for a hacker.", - "name": "getHackerResume", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }] - }, - "examples": [{ - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - }] - }, - "examples": [{ - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker" + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/:id" + } + ] }, { - "type": "get", - "url": "/hacker/stats", - "title": "Gets the stats of all of the hackers who have applied.", - "name": "getHackerStats", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "query": [{ - "group": "query", - "type": "String", - "optional": false, - "field": "model", - "description": "

the model to be searched (Only hacker supported)

" - }, - { - "group": "query", - "type": "Array", - "optional": false, - "field": "q", - "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/stats" - }] + type: "get", + url: "/account/invite", + title: "Get all of the invites.", + name: "getAllInvites", + group: "Account", + version: "0.0.8", + description: + "

Get all of the invites that currently exist in the database.

", + success: { + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Invite retrieval successful.", \n "data": [{\n "email":"abc@def.com",\n "accountType":"Hacker"\n }]\n }', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/invite" + } + ] }, { - "type": "patch", - "url": "/hacker/:id", - "title": "update a hacker's information.", - "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", - "name": "patchHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "school", - "description": "

Name of the school the hacker goes to

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "gender", - "description": "

Gender of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": true, - "field": "needsBus", - "description": "

Whether the hacker requires a bus for transportation

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "ethnicity", - "description": "

the ethnicities of the hacker

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "major", - "description": "

the major of the hacker

" - }, - { - "group": "body", - "type": "Number", - "optional": true, - "field": "graduationYear", - "description": "

the graduation year of the hacker

" - }, - { - "group": "body", - "type": "Json", - "optional": true, - "field": "application", - "description": "

The hacker's application

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" + type: "post", + url: "/account/invite", + title: + "invites a user to create an account with the specified accountType", + name: "inviteAccount", + group: "Account", + version: "0.0.8", + description: + "

sends link with token to be used with the account/create route

", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: true, + field: "email", + description: + "

email of the account to be created and where to send the link

" + }, + { + group: "body", + type: "String", + optional: true, + field: "accountType", + description: + "

the type of the account which the user can create, for sponsor this should specify tier as well

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - }] + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully invited user", \n "data": {}\n }', + type: "object" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] - }, - { - "type": "patch", - "url": "/hacker/confirmation/:id", - "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.", - "name": "patchHackerConfirmed", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

Error object

" + } + ] }, + examples: [ + { + title: "Error-Response:", + content: + '{\n "message": "Invalid Authentication",\n "data": {\n "route": "/invite"\n }\n }', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ { - "name": "Hacker" + url: "https://api.mchacks.ca/api/account/invite" } - ], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - }] - }, - { - "type": "patch", - "url": "/hacker/status/:id", - "title": "update a hacker's status", - "name": "patchHackerStatus", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/status/:id" - }] - }, - { - "type": "post", - "url": "/hacker/resume/:id", - "title": "upload or update resume for a hacker.", - "name": "postHackerResume", - "group": "Hacker", - "version": "0.0.8", - "description": "

NOTE: This must be sent via multipart/form-data POST request

", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }], - "body": [{ - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Location in the bucket that the file was stored.

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/resume/:id" - }] - }, - { - "type": "post", - "url": "/hacker/email/weekOf/:id", - "title": "", - "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", - "name": "postHackerSendWeekOfEmail", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] - }, - { - "type": "post", - "url": "/hacker/email/weekOf/:id", - "title": "", - "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", - "name": "postHackerSendWeekOfEmail", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] - }, - { - "type": "get", - "url": "/sponsor/self", - "title": "get information about logged in sponsor", - "name": "self", - "group": "Hacker", - "version": "1.4.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] - }, - "permission": [{ - "name": ": Sponsor" - }], - "filename": "routes/api/sponsor.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/self" - }] - }, - { - "type": "get", - "url": "/hacker/self", - "title": "get information about own hacker", - "name": "self", - "group": "Hacker", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/self" - }] - }, - { - "type": "get", - "url": "/", - "title": "version", - "version": "0.0.8", - "name": "index", - "group": "Index", - "permission": [{ - "name": "public" - }], - "filename": "routes/index.js", - "groupTitle": "Index", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/" - }] + ] }, { - "type": "post", - "url": "/api/role/", - "title": "create a new role", - "name": "createRole", - "group": "Role", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "name", - "description": "

Name of the route

" - }, - { - "group": "body", - "type": "Route[]", - "optional": false, - "field": "routes", - "description": "

The routes that this role gives access to

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Role object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/role.js", - "groupTitle": "Role", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/api/role/" - }] + type: "get", + url: "/account/self", + title: "get information about own account", + name: "self", + group: "Account", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Account found by user email", \n "data": {\n \t"id": ObjectId("5bff8b9f3274cf001bc71048"),\n \t"firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n \t"shirtSize":"S",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty object

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Account not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/self" + } + ] }, { - "type": "get", - "url": "/search/", - "title": "provide a specific query for any defined model", - "name": "search", - "group": "Search", - "version": "0.0.8", - "parameter": { - "fields": { - "query": [{ - "group": "query", - "type": "String", - "optional": false, - "field": "model", - "description": "

the model to be searched

" + type: "patch", + url: "/account/:id", + title: "update an account's information", + name: "updateOneUser", + group: "Account", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: true, + field: "firstName", + description: "

First name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "lastName", + description: "

Last name of the account creator.

" }, { - "group": "query", - "type": "Array", - "optional": false, - "field": "q", - "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + group: "body", + type: "String", + optional: true, + field: "pronoun", + description: "

the pronoun of the account creator.

" }, { - "group": "query", - "type": "String", - "optional": false, - "field": "sort", - "description": "

either "asc" or "desc"

" + group: "body", + type: "String", + optional: true, + field: "email", + description: "

Email of the account.

" }, { - "group": "query", - "type": "number", - "optional": false, - "field": "page", - "description": "

the page number that you would like

" + group: "body", + type: "String[]", + optional: true, + field: "dietaryRestrictions", + description: + "

Any dietary restrictions for the user. 'None' if there are no restrictions

" }, { - "group": "query", - "type": "number", - "optional": false, - "field": "limit", - "description": "

the maximum number of results that you would like returned

" + group: "body", + type: "String", + optional: true, + field: "shirtSize", + description: + "

Size of the shirt that the user will receive.

" }, { - "group": "query", - "type": "any", - "optional": false, - "field": "sort_by", - "description": "

any parameter you want to sort the results by

" + group: "body", + type: "String", + optional: true, + field: "birthDate", + description: "

a Date parsable string.

" }, { - "group": "query", - "type": "boolean", - "optional": false, - "field": "expand", - "description": "

whether you want to expand sub documents within the results

" + group: "body", + type: "Number", + optional: true, + field: "phoneNumber", + description: + "

the user's phone number, represented as a string.

" } ] - } + }, + examples: [ + { + title: "Request-Example:", + content: '{ "shirtSize": "M" }', + type: "json" + } + ] }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" }, { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Results

" + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", - "type": "object" - }, + examples: [ { - "title": "Success-Response:", - "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", - "type": "object" + title: "Success-Response: ", + content: + '{\n "message": "Changed account information", \n "data": {\n "id": ObjectId("5bff8b9f3274cf001bc71048"),\n \t"firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n \t"shirtSize":"M",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" } ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" }, { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - }] + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while updating account", "data": {}}', + type: "object" + } + ] }, - "filename": "routes/api/search.js", - "groupTitle": "Search", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/search/" - }] - }, - { - "type": "get", - "url": "/settings/", - "title": "Get the settings for the current hackathon", - "name": "getSettings", - "group": "Settings", - "version": "1.1.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Settings Object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "public" - }], - "filename": "routes/api/settings.js", - "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] - }, - { - "type": "patch", - "url": "/settings/", - "title": "Patch the settings for the current hackathon", - "name": "patchSettings", - "group": "Settings", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "Date", - "optional": true, - "field": "openTime", - "description": "

The opening time for the hackathon.

" - }, - { - "group": "body", - "type": "Date", - "optional": true, - "field": "closeTime", - "description": "

The closing time for the hackathon.

" - }, - { - "group": "body", - "type": "Date", - "optional": true, - "field": "confirmTime", - "description": "

The deadline for confirmation for the hackathon.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Settings Object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrators" - }], - "filename": "routes/api/settings.js", - "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/:id" + } + ] }, { - "type": "post", - "url": "/sponsor/", - "title": "create a new sponsor", - "name": "createSponsor", - "group": "Sponsor", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

ObjectID of the respective account.

" - }, + type: "patch", + url: "/auth/password/change", + title: "change password for logged in user", + name: "changePassword", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ { - "group": "body", - "type": "Number", - "optional": false, - "field": "tier", - "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" + group: "Parameter", + type: "String", + optional: false, + field: "oldPassword", + description: "

The current password of the user

" }, { - "group": "body", - "type": "String", - "optional": false, - "field": "company", - "description": "

Name of the company.

" - }, + group: "Parameter", + type: "String", + optional: false, + field: "newPassword", + description: "

The new password of the user

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: + '{ \n "oldPassword": "password12345",\n "newPassword": "password123456"\n}', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ { - "group": "body", - "type": "String", - "optional": false, - "field": "contractURL", - "description": "

URL link to the contract with the company.

" + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" }, { - "group": "body", - "type": "MongoID[]", - "optional": false, - "field": "nominees", - "description": "

Array of accounts that the company wish to nominate as hackers.

" + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: '{"message": "Successfully reset password", "data": {}}', + type: "json" + } + ] + }, + permission: [ + { + name: ": Must be logged in" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/password/change" + } + ] + }, + { + type: "post", + url: "/auth/confirm/:token", + title: "confirm account using the JWT in :token", + name: "confirmAccount", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "JWT", + description: "

for confirming the account

" } ] } }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" }, { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + examples: [ + { + title: "Success-Response:", + content: + '{"message": "Successfully confirmed account", "data": {}}', + type: "json" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" }, { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - }] + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Invalid token for confirming account, "data": {}}', + type: "object" + } + ] }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] }, { - "type": "get", - "url": "/sponsor/:id", - "title": "get a sponsor's information", - "name": "getSponsor", - "group": "Sponsor", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/:id" - }] + type: "post", + url: "/auth/password/forgot", + title: "forgot password route", + name: "forgotPassword", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "email", + description: "

the email address of the account

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: '{ "email": "myemail@mchacks.ca" }', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: '{"message": "Sent reset email", "data": {}}', + type: "json" + } + ] + }, + permission: [ + { + name: ": public" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/password/forgot" + } + ] }, { - "type": "patch", - "url": "/sponsor/", - "title": "update a sponsor", - "name": "patchSponsor", - "group": "Sponsor", - "version": "1.3.0", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - }], - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "company", - "description": "

Name of the company.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "contractURL", - "description": "

URL link to the contract with the company.

" - }, - { - "group": "body", - "type": "ObjectId[]", - "optional": false, - "field": "nominees", - "description": "

Array of accounts that the company wish to nominate as hackers.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + type: "get", + url: "/auth/rolebindings/:id", + title: "retrieve rolebindings for a user given by their user id :id", + name: "getRoleBindings", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

MongoId of an account

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Rolebindings object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved role bindings",\n "data": {\n accountId:"5beca4ab2e069a34f91697b2"\n id:"5beca4ae2e069a34f91698b1"\n roles: [\n {\n _id:"5beca4ab2e069a34f91697d9",\n name:"hacker",\n routes: [\n {_id: "5beca4ae2e069a34f9169852", requestType: "POST", uri: "/api/auth/login"},\n {_id: "5beca4ae2e069a34f9169851", requestType: "POST", uri: "/api/auth/logout"},\n {_id: "5beca4ae2e069a34f9169850", requestType: "GET", uri: "/api/auth/rolebindings/:self"},\n {_id: "5beca4ae2e069a34f916984f", requestType: "GET", uri: "/api/account/self"},\n {_id: "5beca4ae2e069a34f916984e", requestType: "GET", uri: "/api/account/:self"},\n {_id: "5beca4ae2e069a34f916984d", requestType: "PATCH", uri: "/api/account/:self"},\n {_id: "5beca4ae2e069a34f916984c", requestType: "POST", uri: "/api/hacker/"},\n {_id: "5beca4ae2e069a34f916984b", requestType: "GET", uri: "/api/hacker/:self"},\n {_id: "5beca4ae2e069a34f916984a", requestType: "GET", uri: "/api/hacker/:self/resume"},\n {_id: "5beca4ae2e069a34f9169849", requestType: "PATCH", uri: "/api/hacker/:self"}\n ]\n }\n ]\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Role Bindings not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] }, { - "type": "post", - "url": "/team/", - "title": "create a new team consisting of only the logged in user", - "name": "createTeam", - "group": "Team", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "name", - "description": "

Name of the team.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "devpostURL", - "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "projectName", - "description": "

Name of the team.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/" - }] - }, + type: "get", + url: "/auth/roles", + title: "get roles", + name: "getRoles", + description: "

get all roles that exist in the database

", + group: "Authentication", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{"message": "Sucessfully retrieved all roles", "data":\n[{name: "GodStaff", routes: Array(27), id: "5bee20ef3ca9dd4754382880"},\n {name: "Hacker", routes: Array(10), id: "5bee20ef3ca9dd4754382881"},\n {name: "Volunteer", routes: Array(4), id: "5bee20ef3ca9dd4754382882"}]', + type: "json" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/roles" + } + ] + }, + { + type: "post", + url: "/auth/login", + title: "login to the service", + name: "login", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "string", + optional: false, + field: "email", + description: "

Account email

" + }, + { + group: "Parameter", + type: "string", + optional: false, + field: "password", + description: "

Account password

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: '{"message": "Successfully logged in", "data": {}}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Invalid Authentication", "data": {}}', + type: "object" + } + ] + }, + permission: [ + { + name: ": public" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/login" + } + ] + }, + { + type: "get", + url: "/auth/logout", + title: "logout of service", + name: "logout", + group: "Authentication", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: '{"message": "Successfully logged out", "data": {}}', + type: "object" + } + ] + }, + permission: [ + { + name: ": public" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/logout" + } + ] + }, + { + type: "get", + url: "/auth/confirm/resend", + title: "resend confirmation token", + name: "resendConfirmAccount", + group: "Authentication", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{"message": "Successfully resent confirmation email", "data": {}}', + type: "json" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: + ' HTTP/1.1 422\n{"message": "Account already confirmed", "data": {}}', + type: "json" + }, + { + title: "Error-Response:", + content: + ' HTTP/1.1 428\n{"message": "Account confirmation token does not exist", "data": {}}', + type: "json" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] + }, + { + type: "post", + url: "/auth/password/reset", + title: "reset password", + name: "resetPassword", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "password", + description: "

the password of the account

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: '{ "password": "hunter2" }', + type: "json" + } + ] + }, + header: { + fields: { + Header: [ + { + group: "Header", + type: "String", + optional: false, + field: "Authentication", + description: + "

the token that was provided in the reset password email

" + } + ] + }, + examples: [ + { + title: "Header-Example:", + content: + '{\n "X-Reset-Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"\n}', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: '{"message": "Successfully reset password", "data": {}}', + type: "json" + } + ] + }, + permission: [ + { + name: ": must have authentication token" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/password/reset" + } + ] + }, + { + type: "patch", + url: "/hacker/checkin/:id", + title: + "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", + name: "checkinHacker", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "status", + description: "

Check-in status. "Checked-in"

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "status": "Checked-in"\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + }, + { + name: "Volunteer" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] + }, + { + type: "post", + url: "/hacker/", + title: "create a new hacker", + name: "createHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "MongoID", + optional: false, + field: "accountId", + description: "

ObjectID of the respective account

" + }, + { + group: "body", + type: "Json", + optional: false, + field: "application", + description: + "

The hacker's application. Resume and jobInterest fields are required.

" + } + ] + }, + examples: [ + { + title: "application: ", + content: + '{\n "application":{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n}', + type: "Json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker creation successful", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n }\n}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while creating hacker", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/" + } + ] + }, + { + type: "get", + url: "/hacker/email/:email", + title: "get a hacker's information", + name: "getHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "String", + optional: false, + field: "email", + description: "

a hacker's unique email

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved hacker information", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Hacker not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/email/:email" + } + ] + }, + { + type: "get", + url: "/hacker/:id", + title: "get a hacker's information", + name: "getHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "String", + optional: false, + field: "id", + description: "

a hacker's unique mongoID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved hacker information", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Hacker not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + type: "get", + url: "/hacker/resume:id", + title: "get the resume for a hacker.", + name: "getHackerResume", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

Hacker id

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + 'HTTP/1.1 200 OK \n{ \n message: "Downloaded resume", \n data: { \n id: "507f191e810c19729de860ea", \n resume: [Buffer] \n } \n}', + type: "json" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

"Resume does not exist"

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: + 'HTTP/1.1 404 \n{ \n message: "Resume not found", \n data: {} \n}', + type: "json" + } + ] + }, + permission: [ + { + name: + "Must be logged in, and the account id must be linked to the hacker." + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker" + }, + { + type: "get", + url: "/hacker/stats", + title: "Gets the stats of all of the hackers who have applied.", + name: "getHackerStats", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + query: [ + { + group: "query", + type: "String", + optional: false, + field: "model", + description: + "

the model to be searched (Only hacker supported)

" + }, + { + group: "query", + type: "Array", + optional: false, + field: "q", + description: + "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Retrieved stats",\n "data": {\n "stats" : {\n "total": 10,\n "status": { "Applied": 10 },\n "school": { "McGill University": 3, "Harvard University": 7 },\n degree: { "Undergraduate": 10 },\n gender: { "Male": 1, "Female": 9 },\n needsBus: { "true": 7, "false": 3 },\n ethnicity: { "White": 10, },\n jobInterest: { "Internship": 10 },\n major: { "Computer Science": 10 },\n graduationYear: { "2019": 10 },\n dietaryRestrictions: { "None": 10 },\n shirtSize: { "M": 3, "XL": 7 },\n age: { "22": 10 }\n }\n }\n}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/stats" + } + ] + }, + { + type: "patch", + url: "/hacker/:id", + title: "update a hacker's information.", + description: + "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", + name: "patchHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: true, + field: "school", + description: "

Name of the school the hacker goes to

" + }, + { + group: "body", + type: "String", + optional: true, + field: "gender", + description: "

Gender of the hacker

" + }, + { + group: "body", + type: "Boolean", + optional: true, + field: "needsBus", + description: + "

Whether the hacker requires a bus for transportation

" + }, + { + group: "body", + type: "String[]", + optional: true, + field: "ethnicity", + description: "

the ethnicities of the hacker

" + }, + { + group: "body", + type: "String[]", + optional: true, + field: "major", + description: "

the major of the hacker

" + }, + { + group: "body", + type: "Number", + optional: true, + field: "graduationYear", + description: "

the graduation year of the hacker

" + }, + { + group: "body", + type: "Json", + optional: true, + field: "application", + description: "

The hacker's application

" + } + ] + }, + examples: [ + { + title: "application: ", + content: + '{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n }', + type: "Json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while updating hacker", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + type: "patch", + url: "/hacker/confirmation/:id", + title: + "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.", + name: "patchHackerConfirmed", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "status", + description: + "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "status": "Confirmed"\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + }, + { + name: "Hacker" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] + }, + { + type: "patch", + url: "/hacker/status/:id", + title: "update a hacker's status", + name: "patchHackerStatus", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "status", + description: + "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "status": "Accepted"\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/status/:id" + } + ] + }, + { + type: "post", + url: "/hacker/resume/:id", + title: "upload or update resume for a hacker.", + name: "postHackerResume", + group: "Hacker", + version: "0.0.8", + description: + "

NOTE: This must be sent via multipart/form-data POST request

", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

Hacker id

" + } + ], + body: [ + { + group: "body", + type: "File", + optional: false, + field: "resume", + description: "

The uploaded file.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: + "

Location in the bucket that the file was stored.

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + 'HTTP/1.1 200 OK\n{\n message: "Uploaded resume", \n data: {\n filename: "resumes/1535032624768-507f191e810c19729de860ea"\n }\n}', + type: "json" + } + ] + }, + permission: [ + { + name: + "Must be logged in, and the account id must be linked to the hacker." + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] + }, + { + type: "post", + url: "/hacker/email/weekOf/:id", + title: "", + description: + "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + name: "postHackerSendWeekOfEmail", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + param: [ + { + group: "param", + type: "string", + optional: true, + field: "status", + description: "

The hacker ID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker week-of email sent.", \n "data": {}\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + type: "post", + url: "/hacker/email/weekOf/:id", + title: "", + description: + "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + name: "postHackerSendWeekOfEmail", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + param: [ + { + group: "param", + type: "string", + optional: true, + field: "status", + description: "

The hacker ID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker week-of email sent.", \n "data": {}\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + type: "get", + url: "/sponsor/self", + title: "get information about logged in sponsor", + name: "self", + group: "Hacker", + version: "1.4.1", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved sponsor information", \n "data": {\n "id": "5bff4d736f86be0a41badb91",\n "accountId": "5bff4d736f86be0a41badb99",\n "tier": 3,\n "company": "companyName",\n "contractURL": "https://www.contractHere.com",\n "nominees": ["5bff4d736f86be0a41badb93","5bff4d736f86be0a41badb94"]\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Sponsor not found", "data": {}}', + type: "object" + } + ] + }, + permission: [ + { + name: ": Sponsor" + } + ], + filename: "routes/api/sponsor.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/self" + } + ] + }, + { + type: "get", + url: "/hacker/self", + title: "get information about own hacker", + name: "self", + group: "Hacker", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker found by logged in account id", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "URL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":["Accounting"],\n "graduationYear":2019,\n "codeOfConduct":true,\n } \n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Hacker not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/self" + } + ] + }, + { + type: "get", + url: "/", + title: "version", + version: "0.0.8", + name: "index", + group: "Index", + permission: [ + { + name: "public" + } + ], + filename: "routes/index.js", + groupTitle: "Index", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/" + } + ] + }, + { + type: "post", + url: "/api/role/", + title: "create a new role", + name: "createRole", + group: "Role", + version: "1.1.1", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: false, + field: "name", + description: "

Name of the route

" + }, + { + group: "body", + type: "Route[]", + optional: false, + field: "routes", + description: "

The routes that this role gives access to

" + } + ] + }, + examples: [ + { + title: "application: ", + content: + '{\n "name": "routename",\n "routes": [\n {\n uri: "/api/hacker/"\n requestType: "POST"\n }\n ]\n}', + type: "Json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Role object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Role creation successful", \n "data": {\n "name": "routename",\n "routes": [\n {\n uri: "/api/hacker/"\n requestType: "POST"\n }\n ]\n }\n}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while creating role", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/role.js", + groupTitle: "Role", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/api/role/" + } + ] + }, + { + type: "get", + url: "/search/", + title: "provide a specific query for any defined model", + name: "search", + group: "Search", + version: "0.0.8", + parameter: { + fields: { + query: [ + { + group: "query", + type: "String", + optional: false, + field: "model", + description: "

the model to be searched

" + }, + { + group: "query", + type: "Array", + optional: false, + field: "q", + description: + "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + }, + { + group: "query", + type: "String", + optional: false, + field: "sort", + description: "

either "asc" or "desc"

" + }, + { + group: "query", + type: "number", + optional: false, + field: "page", + description: "

the page number that you would like

" + }, + { + group: "query", + type: "number", + optional: false, + field: "limit", + description: + "

the maximum number of results that you would like returned

" + }, + { + group: "query", + type: "any", + optional: false, + field: "sort_by", + description: + "

any parameter you want to sort the results by

" + }, + { + group: "query", + type: "boolean", + optional: false, + field: "expand", + description: + "

whether you want to expand sub documents within the results

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Results

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{\n "message": "Successfully executed query, returning all results",\n "data": [\n {...}\n ]\n }', + type: "object" + }, + { + title: "Success-Response:", + content: + '{\n "message": "No results found.",\n "data": {}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: '{"message": "Validation failed", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/search.js", + groupTitle: "Search", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/search/" + } + ] + }, + { + type: "get", + url: "/settings/", + title: "Get the settings for the current hackathon", + name: "getSettings", + group: "Settings", + version: "1.1.1", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Settings Object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Settings creation successful.", \n "data": {\n "settings": {\n openTime: "Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)",\n closeTime: "Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)",\n confirmTime: "Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)"\n }\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "public" + } + ], + filename: "routes/api/settings.js", + groupTitle: "Settings", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + type: "patch", + url: "/settings/", + title: "Patch the settings for the current hackathon", + name: "patchSettings", + group: "Settings", + version: "1.1.1", + parameter: { + fields: { + body: [ + { + group: "body", + type: "Date", + optional: true, + field: "openTime", + description: "

The opening time for the hackathon.

" + }, + { + group: "body", + type: "Date", + optional: true, + field: "closeTime", + description: "

The closing time for the hackathon.

" + }, + { + group: "body", + type: "Date", + optional: true, + field: "confirmTime", + description: + "

The deadline for confirmation for the hackathon.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Settings Object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Settings patch successful.", \n "data": {\n "settings": {\n openTime: "Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)",\n closeTime: "Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)",\n confirmTime: "Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)"\n }\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrators" + } + ], + filename: "routes/api/settings.js", + groupTitle: "Settings", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + type: "post", + url: "/sponsor/", + title: "create a new sponsor", + name: "createSponsor", + group: "Sponsor", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "MongoID", + optional: false, + field: "accountId", + description: "

ObjectID of the respective account.

" + }, + { + group: "body", + type: "Number", + optional: false, + field: "tier", + description: + "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "company", + description: "

Name of the company.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "contractURL", + description: "

URL link to the contract with the company.

" + }, + { + group: "body", + type: "MongoID[]", + optional: false, + field: "nominees", + description: + "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Sponsor creation successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while creating sponsor", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/sponsor.js", + groupTitle: "Sponsor", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + type: "get", + url: "/sponsor/:id", + title: "get a sponsor's information", + name: "getSponsor", + group: "Sponsor", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "string", + optional: false, + field: "id", + description: "

a sponsor's unique mongoID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved sponsor information", \n "data": {\n "id": "5bff4d736f86be0a41badb91",\n "accountId": "5bff4d736f86be0a41badb99",\n "tier": 3,\n "company": "companyName",\n "contractURL": "https://www.contractHere.com",\n "nominees": ["5bff4d736f86be0a41badb93","5bff4d736f86be0a41badb94"]\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Sponsor not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/sponsor.js", + groupTitle: "Sponsor", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/:id" + } + ] + }, + { + type: "patch", + url: "/sponsor/", + title: "update a sponsor", + name: "patchSponsor", + group: "Sponsor", + version: "1.3.0", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

ObjectID of the sponsor

" + } + ], + body: [ + { + group: "body", + type: "String", + optional: false, + field: "company", + description: "

Name of the company.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "contractURL", + description: "

URL link to the contract with the company.

" + }, + { + group: "body", + type: "ObjectId[]", + optional: false, + field: "nominees", + description: + "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Sponsor update successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while updating sponsor", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/sponsor.js", + groupTitle: "Sponsor", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/" + } + ] + }, { - "type": "patch", - "url": "/team/leave/", - "title": "Allows a logged in hacker to leave current team", - "name": "deleteSelfFromTeam", - "group": "Team", - "version": "1.1.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

{}

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/leave/" - }] + type: "post", + url: "/team/", + title: "create a new team consisting of only the logged in user", + name: "createTeam", + group: "Team", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: false, + field: "name", + description: "

Name of the team.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "devpostURL", + description: + "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "projectName", + description: "

Name of the team.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Team object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team creation successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Error while creating team", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/" + } + ] + }, + { + type: "patch", + url: "/team/leave/", + title: "Allows a logged in hacker to leave current team", + name: "deleteSelfFromTeam", + group: "Team", + version: "1.1.1", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

{}

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Removal from team successful.", \n "data": {}\n}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/leave/" + } + ] }, { - "type": "get", - "url": "/team/:id", - "title": "get a team's information", - "name": "getTeam", - "group": "Team", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:id" - }] + type: "get", + url: "/team/:id", + title: "get a team's information", + name: "getTeam", + group: "Team", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

MongoId of the team

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Team object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team retrieval successful", \n "data": { \n "team": {\n "name":"foo",\n "members": [\n ObjectId(\'...\')\n ],\n "devpostURL": "www.devpost.com/foo",\n "projectName": "fooey"\n },\n "members": [\n {\n "firstName": "John",\n "lastName": "Doe"\n }\n ],\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Team not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/:id" + } + ] }, { - "type": "patch", - "url": "/team/join/", - "title": "Allows a logged in hacker to join a team by name", - "name": "patchJoinTeam", - "group": "Team", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

{}

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/join/" - }] + type: "patch", + url: "/team/join/", + title: "Allows a logged in hacker to join a team by name", + name: "patchJoinTeam", + group: "Team", + version: "1.1.1", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "name", + description: "

Name of the team to join

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

{}

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team join successful.", \n "data": {}\n}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/join/" + } + ] }, { - "type": "patch", - "url": "/team/:hackerId", - "title": "Update a team's information. The team is specified by the hacker belonging to it.", - "name": "patchTeam", - "group": "Team", - "version": "0.0.8", - "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Query input that caused the error.

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:hackerId" - }] + type: "patch", + url: "/team/:hackerId", + title: + "Update a team's information. The team is specified by the hacker belonging to it.", + name: "patchTeam", + group: "Team", + version: "0.0.8", + description: + "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "hackerId", + description: "

a hacker's unique Id

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Team object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team update successful.", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

Query input that caused the error.

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Team not found", "data": {teamId}}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/:hackerId" + } + ] }, { - "type": "post", - "url": "/volunteer/", - "title": "create a new volunteer", - "name": "createVolunteer", - "group": "Volunteer", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Volunteer object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/volunteer.js", - "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/" - }] + type: "post", + url: "/volunteer/", + title: "create a new volunteer", + name: "createVolunteer", + group: "Volunteer", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "MongoID", + optional: false, + field: "accountId", + description: "

MongoID of the account of the volunteer

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Volunteer object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Volunteer creation successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while creating volunteer", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/volunteer.js", + groupTitle: "Volunteer", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/volunteer/" + } + ] }, { - "type": "get", - "url": "/volunteer/:id", - "title": "get a volunteer's information", - "name": "getVolunteer", - "group": "Volunteer", - "version": "1.3.0", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Volunteer object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/volunteer.js", - "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/:id" - }] + type: "get", + url: "/volunteer/:id", + title: "get a volunteer's information", + name: "getVolunteer", + group: "Volunteer", + version: "1.3.0", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

a volunteer's unique mongoID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Volunteer object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved volunteer information", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Volunteer not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/volunteer.js", + groupTitle: "Volunteer", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/volunteer/:id" + } + ] } ] -}); \ No newline at end of file +}); diff --git a/docs/api/api_data.json b/docs/api/api_data.json index b6d16068..99bc13f7 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1,4 +1,5 @@ -[{ +[ + { "type": "post", "url": "/account/", "title": "create a new account", @@ -7,7 +8,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -71,23 +73,28 @@ "description": "

the user's phone number, represented as a string.

" } ], - "header": [{ - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - }] + "header": [ + { + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -103,15 +110,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -127,17 +137,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/" + } + ] }, { "type": "get", @@ -148,18 +162,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -175,15 +192,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -199,17 +219,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] }, { "type": "get", @@ -220,17 +244,21 @@ "version": "0.0.8", "description": "

Get all of the invites that currently exist in the database.

", "success": { - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] }, { "type": "post", @@ -242,7 +270,8 @@ "description": "

sends link with token to be used with the account/create route

", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -261,7 +290,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -277,15 +307,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -301,17 +334,21 @@ } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] }, { "type": "get", @@ -322,7 +359,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -338,15 +376,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -362,17 +403,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/self" + } + ] }, { "type": "patch", @@ -383,7 +428,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -441,15 +487,18 @@ } ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"shirtSize\": \"M\" }", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -465,15 +514,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -489,17 +541,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] }, { "type": "patch", @@ -510,7 +566,8 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ + "Parameter": [ + { "group": "Parameter", "type": "String", "optional": false, @@ -526,15 +583,18 @@ } ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -550,20 +610,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": Must be logged in" - }], + "permission": [ + { + "name": ": Must be logged in" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/change" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/change" + } + ] }, { "type": "post", @@ -574,18 +640,21 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -601,15 +670,18 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -625,17 +697,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/:token" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] }, { "type": "post", @@ -646,23 +722,28 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + } + ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -678,20 +759,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/forgot" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/forgot" + } + ] }, { "type": "get", @@ -702,18 +789,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -729,15 +819,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -753,17 +846,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] }, { "type": "get", @@ -775,7 +872,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -791,17 +889,21 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/roles" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/roles" + } + ] }, { "type": "post", @@ -812,7 +914,8 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ + "Parameter": [ + { "group": "Parameter", "type": "string", "optional": false, @@ -831,7 +934,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -847,15 +951,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -871,20 +978,26 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/login" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/login" + } + ] }, { "type": "get", @@ -895,7 +1008,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -911,20 +1025,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/logout" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/logout" + } + ] }, { "type": "get", @@ -935,7 +1055,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -951,15 +1072,18 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -975,7 +1099,8 @@ } ] }, - "examples": [{ + "examples": [ + { "title": "Error-Response:", "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", "type": "json" @@ -989,9 +1114,11 @@ }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/resend" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] }, { "type": "post", @@ -1002,39 +1129,48 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + } + ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" + } + ] }, "header": { "fields": { - "Header": [{ - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - }] + "Header": [ + { + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + } + ] }, - "examples": [{ - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - }] + "examples": [ + { + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1050,20 +1186,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": must have authentication token" - }], + "permission": [ + { + "name": ": must have authentication token" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/reset" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/reset" + } + ] }, { "type": "patch", @@ -1074,18 +1216,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1101,13 +1246,16 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ + "permission": [ + { "name": "Administrator" }, { @@ -1116,9 +1264,11 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] }, { "type": "post", @@ -1129,7 +1279,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "MongoID", "optional": false, @@ -1194,15 +1345,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1218,15 +1372,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -1242,17 +1399,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/" + } + ] }, { "type": "get", @@ -1263,18 +1424,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - }] + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1290,15 +1454,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1314,17 +1481,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/:email" + } + ] }, { "type": "get", @@ -1335,18 +1506,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1362,15 +1536,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1386,17 +1563,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] }, { "type": "get", @@ -1407,50 +1588,62 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ] } }, "success": { "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }] + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + } + ] }, - "examples": [{ - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - }] - }, - "examples": [{ - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker" }, @@ -1463,7 +1656,8 @@ "version": "0.0.9", "parameter": { "fields": { - "query": [{ + "query": [ + { "group": "query", "type": "String", "optional": false, @@ -1482,7 +1676,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1498,17 +1693,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/stats" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/stats" + } + ] }, { "type": "patch", @@ -1520,7 +1719,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -1571,15 +1771,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1595,15 +1798,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -1619,17 +1825,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] }, { "type": "patch", @@ -1640,18 +1850,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1667,13 +1880,16 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ + "permission": [ + { "name": "Administrator" }, { @@ -1682,9 +1898,11 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] }, { "type": "patch", @@ -1695,18 +1913,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1722,20 +1943,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/status/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/status/:id" + } + ] }, { "type": "post", @@ -1747,25 +1974,30 @@ "description": "

NOTE: This must be sent via multipart/form-data POST request

", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }], - "body": [{ - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ], + "body": [ + { + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1781,20 +2013,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" + } + ] }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/resume/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] }, { "type": "post", @@ -1806,18 +2044,21 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1833,20 +2074,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] }, { "type": "post", @@ -1858,18 +2105,21 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1885,20 +2135,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] }, { "type": "get", @@ -1909,7 +2165,8 @@ "version": "1.4.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1925,15 +2182,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1949,20 +2209,26 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": Sponsor" - }], + "permission": [ + { + "name": ": Sponsor" + } + ], "filename": "routes/api/sponsor.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/self" + } + ] }, { "type": "get", @@ -1973,7 +2239,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1989,15 +2256,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2013,17 +2283,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/self" + } + ] }, { "type": "get", @@ -2032,14 +2306,18 @@ "version": "0.0.8", "name": "index", "group": "Index", - "permission": [{ - "name": "public" - }], + "permission": [ + { + "name": "public" + } + ], "filename": "routes/index.js", "groupTitle": "Index", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/" + } + ] }, { "type": "post", @@ -2050,7 +2328,8 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2066,15 +2345,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2090,15 +2372,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2114,17 +2399,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/role.js", "groupTitle": "Role", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/api/role/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/api/role/" + } + ] }, { "type": "get", @@ -2135,7 +2424,8 @@ "version": "0.0.8", "parameter": { "fields": { - "query": [{ + "query": [ + { "group": "query", "type": "String", "optional": false, @@ -2189,7 +2479,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2205,7 +2496,8 @@ } ] }, - "examples": [{ + "examples": [ + { "title": "Success-Response:", "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", "type": "object" @@ -2219,7 +2511,8 @@ }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2235,17 +2528,21 @@ } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/search.js", "groupTitle": "Search", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/search/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/search/" + } + ] }, { "type": "get", @@ -2256,7 +2553,8 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2272,20 +2570,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "public" - }], + "permission": [ + { + "name": "public" + } + ], "filename": "routes/api/settings.js", "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] }, { "type": "patch", @@ -2296,7 +2600,8 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "Date", "optional": true, @@ -2322,7 +2627,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2338,20 +2644,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrators" - }], + "permission": [ + { + "name": "Administrators" + } + ], "filename": "routes/api/settings.js", "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] }, { "type": "post", @@ -2362,7 +2674,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "MongoID", "optional": false, @@ -2402,7 +2715,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2418,15 +2732,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2442,17 +2759,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] }, { "type": "get", @@ -2463,18 +2784,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2490,15 +2814,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2514,17 +2841,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/:id" + } + ] }, { "type": "patch", @@ -2535,14 +2866,17 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - }], - "body": [{ + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + } + ], + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2568,7 +2902,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2584,15 +2919,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2608,17 +2946,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] }, { "type": "post", @@ -2629,7 +2971,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2655,7 +2998,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2671,15 +3015,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2695,17 +3042,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/" + } + ] }, { "type": "patch", @@ -2716,7 +3067,8 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2732,17 +3084,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/leave/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/leave/" + } + ] }, { "type": "get", @@ -2753,18 +3109,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2780,15 +3139,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2804,17 +3166,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:id" + } + ] }, { "type": "patch", @@ -2825,18 +3191,21 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2852,17 +3221,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/join/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/join/" + } + ] }, { "type": "patch", @@ -2874,18 +3247,21 @@ "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2901,15 +3277,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2925,17 +3304,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:hackerId" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:hackerId" + } + ] }, { "type": "post", @@ -2946,18 +3329,21 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - }] + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2973,15 +3359,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2997,17 +3386,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/" + } + ] }, { "type": "get", @@ -3018,18 +3411,21 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -3045,15 +3441,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -3069,16 +3468,20 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/:id" + } + ] } -] \ No newline at end of file +] diff --git a/middlewares/auth.middleware.js b/middlewares/auth.middleware.js index 2b42f181..9fda8800 100644 --- a/middlewares/auth.middleware.js +++ b/middlewares/auth.middleware.js @@ -3,61 +3,60 @@ const jwt = require("jsonwebtoken"); const passport = require("passport"); const Services = { - Auth: require("../services/auth.service"), - ResetPasswordToken: require("../services/resetPassword.service"), - Account: require("../services/account.service"), - Email: require("../services/email.service"), - AccountConfirmation: require("../services/accountConfirmation.service"), - Role: require("../services/role.service"), - RoleBinding: require("../services/roleBinding.service"), - Env: require("../services/env.service") + Auth: require("../services/auth.service"), + ResetPasswordToken: require("../services/resetPassword.service"), + Account: require("../services/account.service"), + Email: require("../services/email.service"), + AccountConfirmation: require("../services/accountConfirmation.service"), + Role: require("../services/role.service"), + RoleBinding: require("../services/roleBinding.service"), + Env: require("../services/env.service") }; const Middleware = { - Util: require("./util.middleware") + Util: require("./util.middleware") }; const Constants = { - General: require("../constants/general.constant"), - Error: require("../constants/error.constant"), - Role: require("../constants/role.constant") + General: require("../constants/general.constant"), + Error: require("../constants/error.constant"), + Role: require("../constants/role.constant") }; /** * @param {*} req * @param {*} res - * @param {(err?)=>void} next - * Calls passport.authenticate with a custom error handler. Errors during authentication will return res with a generic 500 error, + * @param {(err?)=>void} next + * Calls passport.authenticate with a custom error handler. Errors during authentication will return res with a generic 500 error, * Failed authentication returns a AUTH 401 error, and errors during login will return res with a LOGIN 500 error. */ function login(req, res, next) { - passport.authenticate("emailAndPass", - function (err, user) { - if (err) { - return next({ - status: 500, - message: Constants.Error.GENERIC_500_MESSAGE, - error: {} - }); - } - if (!user) { - return next({ - status: 401, - message: Constants.Error.AUTH_401_MESSAGE, - error: {} - }); - } - req.login(user, (loginErr) => { - if (loginErr) { - return next({ - status: 500, - message: Constants.Error.LOGIN_500_MESSAGE, - error: {} - }); - } - return next(); - }); - })(req, res, next); + passport.authenticate("emailAndPass", function(err, user) { + if (err) { + return next({ + status: 500, + message: Constants.Error.GENERIC_500_MESSAGE, + error: {} + }); + } + if (!user) { + return next({ + status: 401, + message: Constants.Error.AUTH_401_MESSAGE, + error: {} + }); + } + req.login(user, loginErr => { + if (loginErr) { + return next({ + status: 500, + message: Constants.Error.LOGIN_500_MESSAGE, + error: {} + }); + } + return next(); + }); + })(req, res, next); } /** @@ -65,19 +64,19 @@ function login(req, res, next) { * Calls next() if the user is properly authenticated. */ function ensureAuthenticated() { - return function (req, res, next) { - if (req.isUnauthenticated()) { - return next({ - status: 401, - message: Constants.Error.AUTH_401_MESSAGE, - error: { - route: req.path - } - }); - } else { - return next(); + return function(req, res, next) { + if (req.isUnauthenticated()) { + return next({ + status: 401, + message: Constants.Error.AUTH_401_MESSAGE, + error: { + route: req.path } - }; + }); + } else { + return next(); + } + }; } /** @@ -86,101 +85,120 @@ function ensureAuthenticated() { * Calls next() if the user is properly authorized. */ function ensureAuthorized(findByIdFns) { - return function (req, res, next) { - Services.Auth.ensureAuthorized(req, findByIdFns).then( - (auth) => { - if (!auth) { - return next({ - status: 403, - message: Constants.Error.AUTH_403_MESSAGE, - error: { - route: req.path - } - }); - } else { - return next(); - } - }, - (err) => { - return next(err); + return function(req, res, next) { + Services.Auth.ensureAuthorized(req, findByIdFns).then( + auth => { + if (!auth) { + return next({ + status: 403, + message: Constants.Error.AUTH_403_MESSAGE, + error: { + route: req.path } - ); - }; + }); + } else { + return next(); + } + }, + err => { + return next(err); + } + ); + }; } /** * Middleware which retrieves the rolebindings for an account - * @param {{body: {param: {id:string}}}} req - * @param {*} res - * @param {(err?)=>void} next + * @param {{body: {param: {id:string}}}} req + * @param {*} res + * @param {(err?)=>void} next */ async function retrieveRoleBindings(req, res, next) { - const roleBindings = await Services.RoleBinding.getRoleBindingForAcct(req.params.id); - if (!roleBindings) { - return next({ - status: 404, - message: "Role Bindings not found" - }) - } - req.roleBindings = roleBindings; - return next(); + const roleBindings = await Services.RoleBinding.getRoleBindingForAcct( + req.params.id + ); + if (!roleBindings) { + return next({ + status: 404, + message: "Role Bindings not found" + }); + } + req.roleBindings = roleBindings; + return next(); } /** * Checks that the oldPassword is the current password for the logged in user. If the password is correct, * then updates the password to the string in newPassword. - * @param {{user: {email: string}, body: {oldPassword: string, newPassword: string}} req - * @param {*} res - * @param {*} next + * @param {{user: {email: string}, body: {oldPassword: string, newPassword: string}} req + * @param {*} res + * @param {*} next */ async function changePassword(req, res, next) { - const acc = await Services.Account.getAccountIfValid(req.user.email, req.body.oldPassword); - // user's old password is correct - if (!!acc) { - req.body.account = await Services.Account.updatePassword(req.user.id, req.body.newPassword); - return next(); - } else { - return next({ - status: 401, - message: Constants.Error.AUTH_401_MESSAGE, - }); - } + const acc = await Services.Account.getAccountIfValid( + req.user.email, + req.body.oldPassword + ); + // user's old password is correct + if (!!acc) { + req.body.account = await Services.Account.updatePassword( + req.user.id, + req.body.newPassword + ); + return next(); + } else { + return next({ + status: 401, + message: Constants.Error.AUTH_401_MESSAGE + }); + } } /** * Middleware that sends an email to reset the password for the inputted email address. * @param {{body: {email:String}}} req the request object - * @param {*} res - * @param {(err?)=>void} next + * @param {*} res + * @param {(err?)=>void} next */ async function sendResetPasswordEmailMiddleware(req, res, next) { - const user = await Services.Account.findByEmail(req.body.email); - if (user) { - //create the reset password token - await Services.ResetPasswordToken.create(user.id); - //find the thing we just created - const ResetPasswordTokenModel = await Services.ResetPasswordToken.findByAccountId(user.id); - //generate email - const token = Services.ResetPasswordToken.generateToken(ResetPasswordTokenModel.id, user.id); - const address = Services.Env.isProduction() ? process.env.FRONTEND_ADDRESS_DEPLOY : process.env.FRONTEND_ADDRESS_DEV; - const mailData = Services.ResetPasswordToken.generateResetPasswordEmail(address, req.body.email, token); - if (mailData !== undefined) { - Services.Email.send(mailData, (err) => { - if (err) { - return next(err); - } else { - return next(); - } - }); + const user = await Services.Account.findByEmail(req.body.email); + if (user) { + //create the reset password token + await Services.ResetPasswordToken.create(user.id); + //find the thing we just created + const ResetPasswordTokenModel = await Services.ResetPasswordToken.findByAccountId( + user.id + ); + //generate email + const token = Services.ResetPasswordToken.generateToken( + ResetPasswordTokenModel.id, + user.id + ); + const address = Services.Env.isProduction() + ? process.env.FRONTEND_ADDRESS_DEPLOY + : process.env.FRONTEND_ADDRESS_DEV; + const mailData = Services.ResetPasswordToken.generateResetPasswordEmail( + address, + req.body.email, + token + ); + if (mailData !== undefined) { + Services.Email.send(mailData, err => { + if (err) { + return next(err); } else { - return next({ - message: Constants.Error.EMAIL_500_MESSAGE, - }); + return next(); } + }); } else { - //Didn't find the user, but we don't want to throw an error because someone might be trying to see who has an account. - return next(); + return next({ + message: Constants.Error.EMAIL_500_MESSAGE + }); } + } else { + //Didn't find the user, but we don't want to throw an error because someone might be trying to see who has an account. + return next(); + } } /** @@ -192,28 +210,44 @@ async function sendResetPasswordEmailMiddleware(req, res, next) { * @param {(err?)=>void} next */ async function sendConfirmAccountEmailMiddleware(req, res, next) { - const account = req.body.account; - if (account.confirmed) { + const account = req.body.account; + if (account.confirmed) { + return next(); + } + await Services.AccountConfirmation.create( + Constants.General.HACKER, + account.email, + account.id + ); + const accountConfirmationToken = await Services.AccountConfirmation.findByAccountId( + account.id + ); + const token = Services.AccountConfirmation.generateToken( + accountConfirmationToken.id, + account.id + ); + const address = Services.Env.isProduction() + ? process.env.FRONTEND_ADDRESS_DEPLOY + : process.env.FRONTEND_ADDRESS_DEV; + const mailData = Services.AccountConfirmation.generateAccountConfirmationEmail( + address, + account.email, + Constants.General.HACKER, + token + ); + if (mailData !== undefined) { + Services.Email.send(mailData, err => { + if (err) { + return next(err); + } else { return next(); - } - await Services.AccountConfirmation.create(Constants.General.HACKER, account.email, account.id); - const accountConfirmationToken = await Services.AccountConfirmation.findByAccountId(account.id); - const token = Services.AccountConfirmation.generateToken(accountConfirmationToken.id, account.id); - const address = Services.Env.isProduction() ? process.env.FRONTEND_ADDRESS_DEPLOY : process.env.FRONTEND_ADDRESS_DEV; - const mailData = Services.AccountConfirmation.generateAccountConfirmationEmail(address, account.email, Constants.General.HACKER, token); - if (mailData !== undefined) { - Services.Email.send(mailData, (err) => { - if (err) { - return next(err); - } else { - return next(); - } - }); - } else { - return next({ - message: Constants.Error.EMAIL_500_MESSAGE, - }); - } + } + }); + } else { + return next({ + message: Constants.Error.EMAIL_500_MESSAGE + }); + } } /** @@ -223,193 +257,229 @@ async function sendConfirmAccountEmailMiddleware(req, res, next) { * @param {(err?)=>void} next */ async function resendConfirmAccountEmail(req, res, next) { - const account = await Services.Account.findById(req.user.id); - if (account.confirmed) { - return next({ - status: 422, - message: "Account already confirmed" - }); - } - const accountConfirmationToken = await Services.AccountConfirmation.findByAccountId(account.id); - if (!accountConfirmationToken) { - return next({ - status: 428, - message: "Account confirmation token does not exist" - }); - } - const token = Services.AccountConfirmation.generateToken(accountConfirmationToken.id, account.id); - const address = Services.Env.isProduction() ? process.env.FRONTEND_ADDRESS_DEPLOY : process.env.FRONTEND_ADDRESS_DEV; - const mailData = Services.AccountConfirmation.generateAccountConfirmationEmail(address, account.email, accountConfirmationToken.accountType, token); - if (mailData !== undefined) { - Services.Email.send(mailData, (err) => { - if (err) { - return next(err); - } else { - return next(); - } - }); - } else { - return next({ - message: "Error while generating email" - }); - } + const account = await Services.Account.findById(req.user.id); + if (account.confirmed) { + return next({ + status: 422, + message: "Account already confirmed" + }); + } + const accountConfirmationToken = await Services.AccountConfirmation.findByAccountId( + account.id + ); + if (!accountConfirmationToken) { + return next({ + status: 428, + message: "Account confirmation token does not exist" + }); + } + const token = Services.AccountConfirmation.generateToken( + accountConfirmationToken.id, + account.id + ); + const address = Services.Env.isProduction() + ? process.env.FRONTEND_ADDRESS_DEPLOY + : process.env.FRONTEND_ADDRESS_DEV; + const mailData = Services.AccountConfirmation.generateAccountConfirmationEmail( + address, + account.email, + accountConfirmationToken.accountType, + token + ); + if (mailData !== undefined) { + Services.Email.send(mailData, err => { + if (err) { + return next(err); + } else { + return next(); + } + }); + } else { + return next({ + message: "Error while generating email" + }); + } } /** * Attempts to parse the jwt token that is found in req.body.token using process.env.JWT_RESET_PWD_SECRET as the key. * Places the parsed object into req.body.decodedToken. - * @param {{body:{token:string}}} req - * @param {any} res - * @param {(err?)=>void} next + * @param {{body:{token:string}}} req + * @param {any} res + * @param {(err?)=>void} next */ function parseResetToken(req, res, next) { - jwt.verify(req.body['x-reset-token'], process.env.JWT_RESET_PWD_SECRET, function (err, decoded) { - if (err) { - return next(err); - } else { - req.body.decodedToken = decoded; - return next(); - } - }); + jwt.verify( + req.body["x-reset-token"], + process.env.JWT_RESET_PWD_SECRET, + function(err, decoded) { + if (err) { + return next(err); + } else { + req.body.decodedToken = decoded; + return next(); + } + } + ); } /** * Attempts to parse the jwt token that is found in req.body.token using process.env.JWT_CONFIRM_ACC_SECRET as the key. * Places the parsed object into req.body.decodedToken * If the token does not exist it just continues flow - * @param {{body:{token:string}}} req - * @param {any} res - * @param {(err?)=>void} next + * @param {{body:{token:string}}} req + * @param {any} res + * @param {(err?)=>void} next */ function parseAccountConfirmationToken(req, res, next) { - if (!!req.body.token) { - jwt.verify(req.body.token, process.env.JWT_CONFIRM_ACC_SECRET, function (err, decoded) { - if (err) { - return next(err); - } else { - req.body.decodedToken = decoded; - } - }); - } - return next(); + if (!!req.body.token) { + jwt.verify(req.body.token, process.env.JWT_CONFIRM_ACC_SECRET, function( + err, + decoded + ) { + if (err) { + return next(err); + } else { + req.body.decodedToken = decoded; + } + }); + } + return next(); } /** * Returns the type of account based on the confirmation token - * @param {{body:{decodedToken:{accountConfirmationId:string, accountId:string}}}} req - * @param {any} res - * @param {(err?)=>void} next + * @param {{body:{decodedToken:{accountConfirmationId:string, accountId:string}}}} req + * @param {any} res + * @param {(err?)=>void} next */ async function getAccountTypeFromConfirmationToken(req, res, next) { - const confirmationObj = await Services.AccountConfirmation.findById(req.body.decodedToken.accountConfirmationId); - if (confirmationObj) { - req.body.accountType = confirmationObj.accountType; - return next(); - } else { - //Either the token was already used, it's invalid, or user does not exist. - return next({ - status: 401, - message: Constants.Error.ACCOUNT_TOKEN_401_MESSAGE, - error: {} - }); - } + const confirmationObj = await Services.AccountConfirmation.findById( + req.body.decodedToken.accountConfirmationId + ); + if (confirmationObj) { + req.body.accountType = confirmationObj.accountType; + return next(); + } else { + //Either the token was already used, it's invalid, or user does not exist. + return next({ + status: 401, + message: Constants.Error.ACCOUNT_TOKEN_401_MESSAGE, + error: {} + }); + } } /** * Verifies that the resetId exists, and that the accountId exists. - * @param {{body:{decodedToken:{resetId:string, accountId:string}}}} req - * @param {any} res - * @param {(err?)=>void} next + * @param {{body:{decodedToken:{resetId:string, accountId:string}}}} req + * @param {any} res + * @param {(err?)=>void} next */ async function validateResetToken(req, res, next) { - const resetObj = await Services.ResetPasswordToken.findById(req.body.decodedToken.resetId); - const userObj = await Services.Account.findById(req.body.decodedToken.accountId); - if (resetObj && userObj) { - req.body.user = userObj; - return next(); - } else { - //Either the token was already used, it's invalid, or user does not exist. - return next({ - status: 401, - message: Constants.Error.ACCOUNT_TOKEN_401_MESSAGE, - error: {} - }); - } + const resetObj = await Services.ResetPasswordToken.findById( + req.body.decodedToken.resetId + ); + const userObj = await Services.Account.findById( + req.body.decodedToken.accountId + ); + if (resetObj && userObj) { + req.body.user = userObj; + return next(); + } else { + //Either the token was already used, it's invalid, or user does not exist. + return next({ + status: 401, + message: Constants.Error.ACCOUNT_TOKEN_401_MESSAGE, + error: {} + }); + } } /** * Verifies that the confirm account exists, and that the accountId exists. - * @param {{body:{decodedToken:{accountConfirmationId: String, accountId: String}}}} req - * @param {any} res - * @param {(err?)=>void} next + * @param {{body:{decodedToken:{accountConfirmationId: String, accountId: String}}}} req + * @param {any} res + * @param {(err?)=>void} next */ async function validateConfirmationToken(req, res, next) { - const confirmationObj = await Services.AccountConfirmation.findById(req.body.decodedToken.accountConfirmationId); - const userObj = await Services.Account.findById(req.body.decodedToken.accountId); - if (confirmationObj && userObj && (confirmationObj.accountId == userObj.id)) { - userObj.confirmed = true; - userObj.accountType = confirmationObj.accountType; - await Services.Account.updateOne(confirmationObj.accountId, userObj); - req.body.user = userObj; - return next(); - } else { - //Either the token was already used, it's invalid, or user does not exist. - return next({ - status: 401, - message: Constants.Error.ACCOUNT_TOKEN_401_MESSAGE, - error: {} - }); - } + const confirmationObj = await Services.AccountConfirmation.findById( + req.body.decodedToken.accountConfirmationId + ); + const userObj = await Services.Account.findById( + req.body.decodedToken.accountId + ); + if (confirmationObj && userObj && confirmationObj.accountId == userObj.id) { + userObj.confirmed = true; + userObj.accountType = confirmationObj.accountType; + await Services.Account.updateOne(confirmationObj.accountId, userObj); + req.body.user = userObj; + return next(); + } else { + //Either the token was already used, it's invalid, or user does not exist. + return next({ + status: 401, + message: Constants.Error.ACCOUNT_TOKEN_401_MESSAGE, + error: {} + }); + } } /** - * - * @param {body: {decodedToken:{accountConfirmationId: String}}} req - * @param {*} res - * @param {*} next + * + * @param {body: {decodedToken:{accountConfirmationId: String}}} req + * @param {*} res + * @param {*} next */ async function validateConfirmationTokenWithoutAccount(req, res, next) { - if (!!req.body.decodedToken) { - const confirmationObj = await Services.AccountConfirmation.findById(req.body.decodedToken.accountConfirmationId); - if (!confirmationObj.accountId) { - req.body.accountDetails.confirmed = true; - req.body.accountDetails.accountType = confirmationObj.accountType; - } + if (!!req.body.decodedToken) { + const confirmationObj = await Services.AccountConfirmation.findById( + req.body.decodedToken.accountConfirmationId + ); + if (!confirmationObj.accountId) { + req.body.accountDetails.confirmed = true; + req.body.accountDetails.accountType = confirmationObj.accountType; } - return next(); + } + return next(); } - /** * Middleware that deletes the reset token in the db * @param {{body: {decodedToken:{resetId:String}}}} req the request object - * @param {*} res - * @param {(err?)=>void} next + * @param {*} res + * @param {(err?)=>void} next */ function deleteResetToken(req, res, next) { - Services.ResetPasswordToken.deleteToken(req.body.decodedToken.resetId).then( - () => { - return next(); - }, - (err) => { - return next(err); - } - ); + Services.ResetPasswordToken.deleteToken(req.body.decodedToken.resetId).then( + () => { + return next(); + }, + err => { + return next(err); + } + ); } /** * Middleware that creates rolebinding to access POST route for respective account * @param {{body: {account:{accountType:String, id: ObjectId}}}} req the request object - * @param {*} res - * @param {(err?)=>void} next + * @param {*} res + * @param {(err?)=>void} next */ async function addCreationRoleBindings(req, res, next) { - // Get the default role for the account type given - const roleName = Constants.General.POST_ROLES[req.body.account.accountType]; - await Services.RoleBinding.createRoleBindingByRoleName(req.body.account.id, roleName); - // Add default account role bindings - await Services.RoleBinding.createRoleBindingByRoleName(req.body.account.id, Constants.Role.accountRole.name); - return next(); + // Get the default role for the account type given + const roleName = Constants.General.POST_ROLES[req.body.account.accountType]; + await Services.RoleBinding.createRoleBindingByRoleName( + req.body.account.id, + roleName + ); + // Add default account role bindings + await Services.RoleBinding.createRoleBindingByRoleName( + req.body.account.id, + Constants.Role.accountRole.name + ); + return next(); } /** @@ -417,54 +487,76 @@ async function addCreationRoleBindings(req, res, next) { * @param {string} roleName name of the role to be added to account */ function createRoleBindings(roleName = undefined) { - return Middleware.Util.asyncMiddleware(async (req, res, next) => { - await Services.RoleBinding.createRoleBindingByRoleName(req.user.id, roleName); - return next(); - }); + return Middleware.Util.asyncMiddleware(async (req, res, next) => { + await Services.RoleBinding.createRoleBindingByRoleName( + req.user.id, + roleName + ); + return next(); + }); } /** - * Adds a rolebinding between the user and the role with the name stored in 'accountType'. - * @param {{user: {id: ObjectId, accountType: string}}} req - * @param {*} res - * @param {(err?) => void} next + * Adds a rolebinding between the user and the role with the name stored in 'accountType'. + * @param {{user: {id: ObjectId, accountType: string}}} req + * @param {*} res + * @param {(err?) => void} next */ async function addAccountTypeRoleBinding(req, res, next) { - await Services.RoleBinding.createRoleBindingByRoleName(req.user.id, req.user.accountType); - return next(); + await Services.RoleBinding.createRoleBindingByRoleName( + req.user.id, + req.user.accountType + ); + return next(); } /** * Middleware to retrieve all the roles in the database - * @param {*} req - * @param {*} res - * @param {(err?) => void } next + * @param {*} req + * @param {*} res + * @param {(err?) => void } next */ async function retrieveRoles(req, res, next) { - const roles = await Services.Role.getAll(); - req.roles = roles; - return next(); + const roles = await Services.Role.getAll(); + req.roles = roles; + return next(); } module.exports = { - //for each route, set up an authentication middleware for that route - login: login, - ensureAuthenticated: ensureAuthenticated, - ensureAuthorized: ensureAuthorized, - sendResetPasswordEmailMiddleware: Middleware.Util.asyncMiddleware(sendResetPasswordEmailMiddleware), - parseResetToken: parseResetToken, - validateResetToken: Middleware.Util.asyncMiddleware(validateResetToken), - deleteResetToken: deleteResetToken, - sendConfirmAccountEmailMiddleware: Middleware.Util.asyncMiddleware(sendConfirmAccountEmailMiddleware), - parseAccountConfirmationToken: parseAccountConfirmationToken, - validateConfirmationToken: Middleware.Util.asyncMiddleware(validateConfirmationToken), - getAccountTypeFromConfirmationToken: Middleware.Util.asyncMiddleware(getAccountTypeFromConfirmationToken), - validateConfirmationTokenWithoutAccount: Middleware.Util.asyncMiddleware(validateConfirmationTokenWithoutAccount), - createRoleBindings: createRoleBindings, - addAccountTypeRoleBinding: Middleware.Util.asyncMiddleware(addAccountTypeRoleBinding), - addCreationRoleBindings: Middleware.Util.asyncMiddleware(addCreationRoleBindings), - resendConfirmAccountEmail: Middleware.Util.asyncMiddleware(resendConfirmAccountEmail), - retrieveRoleBindings: Middleware.Util.asyncMiddleware(retrieveRoleBindings), - retrieveRoles: Middleware.Util.asyncMiddleware(retrieveRoles), - changePassword: Middleware.Util.asyncMiddleware(changePassword), -}; \ No newline at end of file + //for each route, set up an authentication middleware for that route + login: login, + ensureAuthenticated: ensureAuthenticated, + ensureAuthorized: ensureAuthorized, + sendResetPasswordEmailMiddleware: Middleware.Util.asyncMiddleware( + sendResetPasswordEmailMiddleware + ), + parseResetToken: parseResetToken, + validateResetToken: Middleware.Util.asyncMiddleware(validateResetToken), + deleteResetToken: deleteResetToken, + sendConfirmAccountEmailMiddleware: Middleware.Util.asyncMiddleware( + sendConfirmAccountEmailMiddleware + ), + parseAccountConfirmationToken: parseAccountConfirmationToken, + validateConfirmationToken: Middleware.Util.asyncMiddleware( + validateConfirmationToken + ), + getAccountTypeFromConfirmationToken: Middleware.Util.asyncMiddleware( + getAccountTypeFromConfirmationToken + ), + validateConfirmationTokenWithoutAccount: Middleware.Util.asyncMiddleware( + validateConfirmationTokenWithoutAccount + ), + createRoleBindings: createRoleBindings, + addAccountTypeRoleBinding: Middleware.Util.asyncMiddleware( + addAccountTypeRoleBinding + ), + addCreationRoleBindings: Middleware.Util.asyncMiddleware( + addCreationRoleBindings + ), + resendConfirmAccountEmail: Middleware.Util.asyncMiddleware( + resendConfirmAccountEmail + ), + retrieveRoleBindings: Middleware.Util.asyncMiddleware(retrieveRoleBindings), + retrieveRoles: Middleware.Util.asyncMiddleware(retrieveRoles), + changePassword: Middleware.Util.asyncMiddleware(changePassword) +}; diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 9d191d4c..36f564d5 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -37,7 +37,7 @@ function parsePatch(req, res, next) { * @param {(err?)=>void} next * @return {void} * @description - * Moves accountId, school, degree, gender, needsBus, application from req.body to req.body.hackerDetails. + * Moves accountId, application from req.body to req.body.hackerDetails. * Adds _id to hackerDetails. */ function parseHacker(req, res, next) { @@ -217,7 +217,7 @@ function ensureAccountLinkedToHacker(req, res, next) { * @param {(err?)=>void} next */ async function uploadResume(req, res, next) { - const gcfilename = `resumes/${Date.now()}-${req.hacker.id}`; + const gcfilename = `resume/${Date.now()}-${req.hacker.id}`; await Services.Storage.upload(req.file, gcfilename); req.body.gcfilename = gcfilename; await Services.Hacker.updateOne(req.hacker.id, { @@ -456,6 +456,7 @@ function checkStatus(statuses) { * @param {*} next */ async function updateHacker(req, res, next) { + console.log("does it reach?"); const hacker = await Services.Hacker.updateOne(req.params.id, req.body); if (hacker) { const acct = await Services.Account.findById(hacker.accountId); diff --git a/models/hacker.model.js b/models/hacker.model.js index 9c78cefd..f977b3ec 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -111,7 +111,8 @@ const HackerSchema = new mongoose.Schema({ } }, accomodation: { - needsBus: Boolean + needsBus: Boolean, + default: false }, team: { type: mongoose.Schema.Types.ObjectId, diff --git a/package-lock.json b/package-lock.json index ad884d92..deef321c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hackboard", - "version": "0.0.0", + "version": "0.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e745de4a..a94a1464 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,52 @@ { - "name": "hackboard", - "version": "0.0.0", - "private": true, - "scripts": { - "start": "NODE_ENV=deployment node ./bin/www.js", - "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", - "development": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", - "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", - "seed": "NODE_ENV=development node ./seed/index.js", - "docs": "apidoc -i ./routes -o ./docs/api/" - }, - "dependencies": { - "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.5.0", - "@sendgrid/mail": "^6.4.0", - "bcrypt": "^3.0.6", - "cookie-parser": "~1.4.4", - "cookie-session": "^2.0.0-beta.3", - "cors": "^2.8.5", - "cryptiles": "^4.1.3", - "debug": "~4.1.1", - "dotenv": "^8.2.0", - "express": "~4.17.1", - "express-validator": "^6.2.0", - "express-winston": "^2.6.0", - "handlebars": "^4.4.3", - "jsonwebtoken": "^8.5.1", - "memory-cache": "^0.2.0", - "mongoose": "^5.7.5", - "multer": "^1.4.2", - "passport": "^0.4.0", - "passport-local": "^1.0.0", - "q": "^1.5.1", - "qrcode": "^1.4.2", - "winston": "^2.4.4" - }, - "devDependencies": { - "@types/express": "^4.17.1", - "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.21", - "@types/multer": "^1.3.10", - "apidoc": "^0.17.7", - "chai": "^4.2.0", - "chai-http": "^4.3.0", - "jshint": "^2.10.2", - "jslint": "^0.12.1", - "mocha": "^6.2.1", - "nodemon": "^1.19.4" - } + "name": "hackboard", + "version": "0.0.0", + "private": true, + "scripts": { + "start": "NODE_ENV=deployment node ./bin/www.js", + "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", + "development": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", + "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", + "seed": "NODE_ENV=test node ./seed/index.js", + "docs": "apidoc -i ./routes -o ./docs/api/" + }, + "dependencies": { + "@google-cloud/logging-winston": "^0.11.1", + "@google-cloud/storage": "^3.5.0", + "@sendgrid/mail": "^6.4.0", + "bcrypt": "^3.0.6", + "cookie-parser": "~1.4.4", + "cookie-session": "^2.0.0-beta.3", + "cors": "^2.8.5", + "cryptiles": "^4.1.3", + "debug": "~4.1.1", + "dotenv": "^8.2.0", + "express": "~4.17.1", + "express-validator": "^6.2.0", + "express-winston": "^2.6.0", + "handlebars": "^4.4.3", + "jsonwebtoken": "^8.5.1", + "memory-cache": "^0.2.0", + "mongoose": "^5.7.5", + "multer": "^1.4.2", + "passport": "^0.4.0", + "passport-local": "^1.0.0", + "q": "^1.5.1", + "qrcode": "^1.4.2", + "winston": "^2.4.4" + }, + "devDependencies": { + "@types/express": "^4.17.1", + "@types/google-cloud__storage": "^1.7.2", + "@types/mongodb": "^3.3.1", + "@types/mongoose": "^5.5.21", + "@types/multer": "^1.3.10", + "apidoc": "^0.17.7", + "chai": "^4.2.0", + "chai-http": "^4.3.0", + "jshint": "^2.10.2", + "jslint": "^0.12.1", + "mocha": "^6.2.1", + "nodemon": "^1.19.4" + } } diff --git a/routes/api/hacker.js b/routes/api/hacker.js index e3518966..65bbd8db 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -40,7 +40,7 @@ module.exports = { "data": { "id":"5bff4d736f86be0a41badb91", "application":{ - "portfolioURL":{ + "URL":{ "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", "github":"https://github.com/abcd", "dropler":"https://dribbble.com/abcd", @@ -96,7 +96,13 @@ module.exports = { * @apiParamExample {Json} application: * { "application":{ - "portfolioURL":{ + "general":{ + "school": "McGill University", + "degree": "Undergraduate", + "fieldOfStudy": "Computer Science", + "graduationYear": "2021", + "jobInterest":"Internship", + "URL":{ "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", "github":"https://github.com/abcd", "dropler":"https://dribbble.com/abcd", @@ -104,10 +110,24 @@ module.exports = { "linkedIn":"https://linkedin.com/in/abcd", "other":"https://github.com/hackmcgill/hackerAPI/issues/168" }, - "jobInterest":"Internship", + }, + "shortAnswer": { "skills":["Javascript","Typescript"], + "question1": "I love McHacks", + "question2":"Pls accept me", "comments":"hi!", - "essay":"Pls accept me" + }, + "other:" { + "gender": "male", + "ethnicity": "Asian or Pacific Islander", + "codeOfConduct_MLH": true, + "codeOfConduct_MCHACKS": true, + } + "accomodation": { + "needsBus": "false" + }, + } + * } * * @apiSuccess {string} message Success message @@ -118,29 +138,37 @@ module.exports = { * "data": { "id":"5bff4d736f86be0a41badb91", "application":{ - "portfolioURL":{ - "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", - "github":"https://github.com/abcd", - "dribbble":"https://dribbble.com/abcd", - "personal":"https://www.hi.com/", - "linkedIn":"https://linkedin.com/in/abcd", - "other":"https://github.com/hackmcgill/hackerAPI/issues/168" - }, + "general":{ + "school": "McGill University", + "degree": "Undergraduate", + "fieldOfStudy": "Computer Science", + "graduationYear": "2021", "jobInterest":"Internship", + "URL":{ + "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", + "github":"https://github.com/abcd", + "dropler":"https://dribbble.com/abcd", + "personal":"https://www.hi.com/", + "linkedIn":"https://linkedin.com/in/abcd", + "other":"https://github.com/hackmcgill/hackerAPI/issues/168" + }, + }, + "shortAnswer": { "skills":["Javascript","Typescript"], + "question1": "I love McHacks", + "question2":"Pls accept me", "comments":"hi!", - "essay":"Pls accept me" - }, - "status":"Applied", - "ethnicity":["White or Caucasian"," Asian or Pacific Islander"], - "accountId":"5bff2a35e533b0f6562b4998", - "school":"McPherson College", - "gender":"Female", - "needsBus":false, - "major":"Accounting", - "graduationYear":2019, - "codeOfConduct":true, - * } + }, + "other:" { + "gender": "male", + "ethnicity": "Asian or Pacific Islander", + "codeOfConduct_MLH": true, + "codeOfConduct_MCHACKS": true, + } + "accomodation": { + "needsBus": "false" + }, + } * } * @apiError {string} message Error message @@ -151,7 +179,6 @@ module.exports = { hackerRouter.route("/").post( Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.newHackerValidator, Middleware.parseBody.middleware, @@ -303,18 +330,38 @@ module.exports = { * @apiParam (body) {Json} [application] The hacker's application * @apiParamExample {Json} application: * { - "portfolioURL":{ + "application":{ + "general":{ + "school": "McGill University", + "degree": "Undergraduate", + "fieldOfStudy": "Computer Science", + "graduationYear": "2021", + "jobInterest":"Internship", + "URL":{ "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", "github":"https://github.com/abcd", - "dribbble":"https://dribbble.com/abcd", + "dropler":"https://dribbble.com/abcd", "personal":"https://www.hi.com/", "linkedIn":"https://linkedin.com/in/abcd", "other":"https://github.com/hackmcgill/hackerAPI/issues/168" + }, + }, + "shortAnswer": { + "skills":["Javascript","Typescript"], + "question1": "I love McHacks", + "question2":"Pls accept me", + "comments":"hi!", }, - "jobInterest":"Internship", - "skills":["Javascript","Typescript"], - "comments":"hi!", - "essay":"Pls accept me" + "other:" { + "gender": "male", + "ethnicity": "Asian or Pacific Islander", + "codeOfConduct_MLH": true, + "codeOfConduct_MCHACKS": true, + } + "accomodation": { + "needsBus": "false" + }, + } } * * @apiSuccess {string} message Success message @@ -324,29 +371,40 @@ module.exports = { * "message": "Changed hacker information", * "data": { "id":"5bff4d736f86be0a41badb91", - "application":{ - "portfolioURL":{ - "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", - "github":"https://github.com/abcd", - "dribbble":"https://dribbble.com/abcd", - "personal":"https://www.hi.com/", - "linkedIn":"https://linkedin.com/in/abcd", - "other":"https://github.com/hackmcgill/hackerAPI/issues/168" - }, + "status": "Applied", + "application":{ + "general":{ + "school": "McGill University", + "degree": "Undergraduate", + "fieldOfStudy": "Computer Science", + "graduationYear": "2021", "jobInterest":"Internship", + "URL":{ + "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", + "github":"https://github.com/abcd", + "dropler":"https://dribbble.com/abcd", + "personal":"https://www.hi.com/", + "linkedIn":"https://linkedin.com/in/abcd", + "other":"https://github.com/hackmcgill/hackerAPI/issues/168" + }, + }, + "shortAnswer": { "skills":["Javascript","Typescript"], + "question1": "I love McHacks", + "question2":"Pls accept me", "comments":"hi!", - "essay":"Pls accept me" - }, - "status":"Applied", - "ethnicity":["White or Caucasian"," Asian or Pacific Islander"], - "accountId":"5bff2a35e533b0f6562b4998", - "school":"McPherson College", - "gender":"Female", - "needsBus":false, - "major":"Accounting", - "graduationYear":2019, - "codeOfConduct":true, + }, + "other:" { + "gender": "male", + "ethnicity": "Asian or Pacific Islander", + "codeOfConduct_MLH": true, + "codeOfConduct_MCHACKS": true, + } + "accomodation": { + "needsBus": "false" + }, + } + } * } * @apiError {string} message Error message * @apiError {object} data empty @@ -383,29 +441,39 @@ module.exports = { "message": "Successfully retrieved hacker information", "data": { "id":"5bff4d736f86be0a41badb91", + "status": "Applied", "application":{ - "portfolioURL":{ - "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", - "github":"https://github.com/abcd", - "dropler":"https://dribbble.com/abcd", - "personal":"https://www.hi.com/", - "linkedIn":"https://linkedin.com/in/abcd", - "other":"https://github.com/hackmcgill/hackerAPI/issues/168" - }, + "general":{ + "school": "McGill University", + "degree": "Undergraduate", + "fieldOfStudy": "Computer Science", + "graduationYear": "2021", "jobInterest":"Internship", + "URL":{ + "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", + "github":"https://github.com/abcd", + "dropler":"https://dribbble.com/abcd", + "personal":"https://www.hi.com/", + "linkedIn":"https://linkedin.com/in/abcd", + "other":"https://github.com/hackmcgill/hackerAPI/issues/168" + }, + }, + "shortAnswer": { "skills":["Javascript","Typescript"], + "question1": "I love McHacks", + "question2":"Pls accept me", "comments":"hi!", - "essay":"Pls accept me" - }, - "status":"Applied", - "ethnicity":["White or Caucasian"," Asian or Pacific Islander"], - "accountId":"5bff2a35e533b0f6562b4998", - "school":"McPherson College", - "gender":"Female", - "needsBus":false, - "major":"Accounting", - "graduationYear":2019, - "codeOfConduct":true, + }, + "other:" { + "gender": "male", + "ethnicity": "Asian or Pacific Islander", + "codeOfConduct_MLH": true, + "codeOfConduct_MCHACKS": true, + } + "accomodation": { + "needsBus": "false" + }, + } } } @@ -440,29 +508,39 @@ module.exports = { "message": "Successfully retrieved hacker information", "data": { "id":"5bff4d736f86be0a41badb91", + "status": "Applied", "application":{ - "portfolioURL":{ - "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", - "github":"https://github.com/abcd", - "dropler":"https://dribbble.com/abcd", - "personal":"https://www.hi.com/", - "linkedIn":"https://linkedin.com/in/abcd", - "other":"https://github.com/hackmcgill/hackerAPI/issues/168" - }, + "general":{ + "school": "McGill University", + "degree": "Undergraduate", + "fieldOfStudy": "Computer Science", + "graduationYear": "2021", "jobInterest":"Internship", + "URL":{ + "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91", + "github":"https://github.com/abcd", + "dropler":"https://dribbble.com/abcd", + "personal":"https://www.hi.com/", + "linkedIn":"https://linkedin.com/in/abcd", + "other":"https://github.com/hackmcgill/hackerAPI/issues/168" + }, + }, + "shortAnswer": { "skills":["Javascript","Typescript"], + "question1": "I love McHacks", + "question2":"Pls accept me", "comments":"hi!", - "essay":"Pls accept me" - }, - "status":"Applied", - "ethnicity":["White or Caucasian"," Asian or Pacific Islander"], - "accountId":"5bff2a35e533b0f6562b4998", - "school":"McPherson College", - "gender":"Female", - "needsBus":false, - "major":"Accounting", - "graduationYear":2019, - "codeOfConduct":true, + }, + "other:" { + "gender": "male", + "ethnicity": "Asian or Pacific Islander", + "codeOfConduct_MLH": true, + "codeOfConduct_MCHACKS": true, + } + "accomodation": { + "needsBus": "false" + }, + } } } diff --git a/scripts/batch_scripts.py b/scripts/batch_scripts.py index cedeef75..58a359ec 100644 --- a/scripts/batch_scripts.py +++ b/scripts/batch_scripts.py @@ -392,12 +392,12 @@ def getHackers(): 'First Name': result['accountId']['firstName'], 'Last Name': result['accountId']['lastName'], 'Email': result['accountId']['email'], - 'School': result['school'], - 'Degree': result['degree'], - 'Graduation Year': result['graduationYear'], - 'Job Interest': result['application']['jobInterest'], - 'Github': result['application']['portfolioURL']['github'], - 'LinkedIn': result['application']['portfolioURL']['linkedIn'], + 'School': result['application']['general']['school'], + 'Degree': result['application']['general']['degree'], + 'Graduation Year': result['application']['general']['graduationYear'], + 'Job Interest': result['application']['general']['jobInterest'], + 'Github': result['application']['general']['URL']['github'], + 'LinkedIn': result['application']['general']['URL']['linkedIn'], }) diff --git a/services/hacker.service.js b/services/hacker.service.js index 355a579e..54f35d46 100644 --- a/services/hacker.service.js +++ b/services/hacker.service.js @@ -140,7 +140,7 @@ function getStats(hackers) { needsBus: {}, ethnicity: {}, jobInterest: {}, - major: {}, + fieldOfStudy: {}, graduationYear: {}, dietaryRestrictions: {}, shirtSize: {}, @@ -156,37 +156,44 @@ function getStats(hackers) { stats.status[hacker.status] = stats.status[hacker.status] ? stats.status[hacker.status] + 1 : 1; - stats.school[hacker.school] = stats.school[hacker.school] - ? stats.school[hacker.school] + 1 + stats.school[hacker.application.general.school] = stats.school[ + hacker.application.general.school + ] + ? stats.school[hacker.application.general.school] + 1 : 1; - stats.degree[hacker.degree] = stats.degree[hacker.degree] - ? stats.degree[hacker.degree] + 1 + stats.degree[hacker.application.general.degree] = stats.degree[ + hacker.application.general.degree + ] + ? stats.degree[hacker.application.general.degree] + 1 : 1; - stats.gender[hacker.gender] = stats.gender[hacker.gender] - ? stats.gender[hacker.gender] + 1 + stats.gender[hacker.application.other.gender] = stats.gender[ + hacker.application.other.gender + ] + ? stats.gender[hacker.application.other.gender] + 1 : 1; - stats.needsBus[hacker.needsBus] = stats.needsBus[hacker.needsBus] - ? stats.needsBus[hacker.needsBus] + 1 + stats.needsBus[hacker.application.accomodation.needsBus] = stats.needsBus[ + hacker.application.accomodation.needsBus + ] + ? stats.needsBus[hacker.application.accomodation.needsBus] + 1 : 1; - for (const ethnicity of hacker.ethnicity) { + for (const ethnicity of hacker.application.other.ethnicity) { stats.ethnicity[ethnicity] = stats.ethnicity[ethnicity] ? stats.ethnicity[ethnicity] + 1 : 1; } - stats.jobInterest[hacker.application.jobInterest] = stats.jobInterest[ - hacker.application.jobInterest - ] - ? stats.jobInterest[hacker.application.jobInterest] + 1 + stats.jobInterest[hacker.application.general.jobInterest] = stats + .jobInterest[hacker.application.general.jobInterest] + ? stats.jobInterest[hacker.application.general.jobInterest] + 1 : 1; - stats.major[hacker.major] = stats.major[hacker.major] - ? stats.major[hacker.major] + 1 + stats.fieldOfStudy[hacker.application.general.fieldOfStudy] = stats + .fieldOfStudy[hacker.application.general.fieldOfStudy] + ? stats.fieldOfStudy[hacker.application.general.fieldOfStudy] + 1 : 1; - stats.graduationYear[hacker.graduationYear] = stats.graduationYear[ - hacker.graduationYear - ] - ? stats.graduationYear[hacker.graduationYear] + 1 + stats.graduationYear[hacker.application.general.graduationYear] = stats + .graduationYear[hacker.application.general.graduationYear] + ? stats.graduationYear[hacker.application.general.graduationYear] + 1 : 1; for (const dietaryRestrictions of hacker.accountId.dietaryRestrictions) { diff --git a/tests/account.test.js b/tests/account.test.js index f718405f..8acc1624 100644 --- a/tests/account.test.js +++ b/tests/account.test.js @@ -7,17 +7,16 @@ const logger = require("../services/logger.service"); const Account = require("../models/account.model"); const should = chai.should(); const Constants = { - Error: require("../constants/error.constant"), - General: require("../constants/general.constant"), - Success: require("../constants/success.constant"), + Error: require("../constants/error.constant"), + General: require("../constants/general.constant"), + Success: require("../constants/success.constant") }; - const util = { - account: require("./util/account.test.util"), - auth: require("./util/auth.test.util"), - accountConfirmation: require("./util/accountConfirmation.test.util"), - reset: require("./util/resetPassword.test.util") + account: require("./util/account.test.util"), + auth: require("./util/auth.test.util"), + accountConfirmation: require("./util/accountConfirmation.test.util"), + reset: require("./util/resetPassword.test.util") }; const agent = chai.request.agent(server.app); // tokens @@ -39,567 +38,608 @@ const storedAccount3 = util.account.NonConfirmedAccount3; const newAccount0 = util.account.unlinkedAccounts.new[0]; - -describe("GET user account", function () { - // fail on authentication - it("should fail to list the user's account on /api/account/self GET due to authentication", function (done) { - chai.request(server.app) - .get("/api/account/self") - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); - }); - - // fail due to invalid login - it("should fail due to invalid password", function (done) { - agent.post("/api/auth/login").type("application/json").send({ - email: Admin0.email, - password: "FakePassword" - }).end((err, res) => { - res.should.have.status(401); +describe("GET user account", function() { + // fail on authentication + it("should fail to list the user's account on /api/account/self GET due to authentication", function(done) { + chai + .request(server.app) + .get("/api/account/self") + .end(function(err, res) { + console.log(res); + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + + // fail due to invalid login + it("should fail due to invalid password", function(done) { + agent + .post("/api/auth/login") + .type("application/json") + .send({ + email: Admin0.email, + password: "FakePassword" + }) + .end((err, res) => { + res.should.have.status(401); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + + // success case + it("should list the user's account on /api/account/self GET", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get("/api/account/self") + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(200); + res.should.be.json; res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + res.body.message.should.equal(Constants.Success.ACCOUNT_READ); + res.body.should.have.property("data"); + res.body.data.should.be.a("object"); + res.body.data.should.have.property("firstName"); + res.body.data.should.have.property("lastName"); + res.body.data.should.have.property("email"); + res.body.data.should.have.property("dietaryRestrictions"); + res.body.data.should.have.property("shirtSize"); done(); - }); + }) + ); }); - - // success case - it("should list the user's account on /api/account/self GET", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // success case - admin case + it("should list another account specified by id using admin priviledge on /api/account/:id/ GET", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/account/${teamHackerAccount0._id}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get("/api/account/self") - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_READ); - res.body.should.have.property("data"); - res.body.data.should.be.a("object"); - res.body.data.should.have.property("firstName"); - res.body.data.should.have.property("lastName"); - res.body.data.should.have.property("email"); - res.body.data.should.have.property("dietaryRestrictions"); - res.body.data.should.have.property("shirtSize"); - done(); - }); - }); - }); - - // success case - admin case - it("should list another account specified by id using admin priviledge on /api/account/:id/ GET", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get(`/api/account/${teamHackerAccount0._id}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_READ); - res.body.should.have.property("data"); - - // use acc.toStrippedJSON to deal with hidden passwords and convert _id to id - const acc = new Account(teamHackerAccount0); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(acc.toStrippedJSON())); - done(); - }); - }); + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_READ); + res.body.should.have.property("data"); + + // use acc.toStrippedJSON to deal with hidden passwords and convert _id to id + const acc = new Account(teamHackerAccount0); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(acc.toStrippedJSON()) + ); + done(); + }) + ); }); - // success case - user case - it("should list an account specified by id on /api/account/:id/ GET", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + // success case - user case + it("should list an account specified by id on /api/account/:id/ GET", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/account/${teamHackerAccount0._id}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/account/${teamHackerAccount0._id}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_READ); - res.body.should.have.property("data"); - - // use acc.toStrippedJSON to deal with hidden passwords and convert _id to id - const acc = new Account(teamHackerAccount0); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(acc.toStrippedJSON())); - done(); - }); - }); + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_READ); + res.body.should.have.property("data"); + + // use acc.toStrippedJSON to deal with hidden passwords and convert _id to id + const acc = new Account(teamHackerAccount0); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(acc.toStrippedJSON()) + ); + done(); + }) + ); }); - - // // fail case on authorization - it("should fail to list an account specified by id on /api/account/:id/ GET due to lack of authorization", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // // fail case on authorization + it("should fail to list an account specified by id on /api/account/:id/ GET due to lack of authorization", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/account/${Admin0._id}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/account/${Admin0._id}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); - done(); - }); - }); + done(); + }) + ); }); + }); }); -describe("POST create account", function () { - it("should SUCCEED and create a new account", function (done) { - chai.request(server.app) - .post(`/api/account/`) - .type("application/json") - .send(newAccount0) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_CREATE); - - // use acc.toStrippedJSON to deal with hidden passwords and convert _id to id - const acc = (new Account(newAccount0)).toStrippedJSON(); - // delete id as those are generated - delete acc.id; - delete res.body.data.id; - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(acc)); - done(); - }); - }); - - it("should FAIL to create an account because the email is already in use", function (done) { - chai.request(server.app) - .post(`/api/account/`) - .type("application/json") - .send(teamHackerAccount0) - .end(function (err, res) { - res.should.have.status(422); - done(); - }); - }); +describe("POST create account", function() { + it("should SUCCEED and create a new account", function(done) { + chai + .request(server.app) + .post(`/api/account/`) + .type("application/json") + .send(newAccount0) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_CREATE); + + // use acc.toStrippedJSON to deal with hidden passwords and convert _id to id + const acc = new Account(newAccount0).toStrippedJSON(); + // delete id as those are generated + delete acc.id; + delete res.body.data.id; + chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(acc)); + done(); + }); + }); + + it("should FAIL to create an account because the email is already in use", function(done) { + chai + .request(server.app) + .post(`/api/account/`) + .type("application/json") + .send(teamHackerAccount0) + .end(function(err, res) { + res.should.have.status(422); + done(); + }); + }); }); -describe("POST confirm account", function () { - it("should SUCCEED and confirm the account", function (done) { - chai.request(server.app) - .post(`/api/auth/confirm/${confirmationToken}`) - .type("application/json") - .end(function (err, res) { - res.should.have.status(200); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.AUTH_CONFIRM_ACCOUNT); - done(); - }); - }); - it("should FAIL confirming the account", function (done) { - chai.request(server.app) - .post(`/api/auth/confirm/${fakeToken}`) - .type("application/json") - .end(function (err, res) { - res.should.have.status(401); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.ACCOUNT_TOKEN_401_MESSAGE); - done(); - }); - }); - it("should FAIL to confirm account that has token with email but no account", function (done) { - chai.request(server.app) - .post(`/api/auth/confirm/${fakeToken}`) - .type("application/json") - .end(function (err, res) { - res.should.have.status(401); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.ACCOUNT_TOKEN_401_MESSAGE); - done(); - }); - }); +describe("POST confirm account", function() { + it("should SUCCEED and confirm the account", function(done) { + chai + .request(server.app) + .post(`/api/auth/confirm/${confirmationToken}`) + .type("application/json") + .end(function(err, res) { + res.should.have.status(200); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.AUTH_CONFIRM_ACCOUNT); + done(); + }); + }); + it("should FAIL confirming the account", function(done) { + chai + .request(server.app) + .post(`/api/auth/confirm/${fakeToken}`) + .type("application/json") + .end(function(err, res) { + res.should.have.status(401); + res.body.should.have.property("message"); + res.body.message.should.equal( + Constants.Error.ACCOUNT_TOKEN_401_MESSAGE + ); + done(); + }); + }); + it("should FAIL to confirm account that has token with email but no account", function(done) { + chai + .request(server.app) + .post(`/api/auth/confirm/${fakeToken}`) + .type("application/json") + .end(function(err, res) { + res.should.have.status(401); + res.body.should.have.property("message"); + res.body.message.should.equal( + Constants.Error.ACCOUNT_TOKEN_401_MESSAGE + ); + done(); + }); + }); }); -describe("PATCH update account", function () { - const updatedInfo = { - "_id": teamHackerAccount0._id, - "firstName": "new", - "lastName": "name" - }; - - const failUpdatedInfo = { - "_id": Admin0._id, - "firstName": "fail", - "lastName": "fail" - }; - - // fail on authentication - it("should fail to update an account due to authentication", function (done) { - chai.request(server.app) - .patch(`/api/account/${updatedInfo._id}`) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); - }); - - // succeed on :all case - it("should SUCCEED and use admin to update another account", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .patch(`/api/account/${updatedInfo._id}`) - .type("application/json") - .send(updatedInfo) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_UPDATE); - res.body.should.have.property("data"); - // Is this correct matching of data? - res.body.data.firstName.should.equal(updatedInfo.firstName); - res.body.data.lastName.should.equal(updatedInfo.lastName); - done(); - }); +describe("PATCH update account", function() { + const updatedInfo = { + _id: teamHackerAccount0._id, + firstName: "new", + lastName: "name" + }; + + const failUpdatedInfo = { + _id: Admin0._id, + firstName: "fail", + lastName: "fail" + }; + + // fail on authentication + it("should fail to update an account due to authentication", function(done) { + chai + .request(server.app) + .patch(`/api/account/${updatedInfo._id}`) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + + // succeed on :all case + it("should SUCCEED and use admin to update another account", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .patch(`/api/account/${updatedInfo._id}`) + .type("application/json") + .send(updatedInfo) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_UPDATE); + res.body.should.have.property("data"); + // Is this correct matching of data? + res.body.data.firstName.should.equal(updatedInfo.firstName); + res.body.data.lastName.should.equal(updatedInfo.lastName); + done(); }); }); - - // succeed on :self case - it("should SUCCEED and update the user's own account", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .patch(`/api/account/${updatedInfo._id}`) - .type("application/json") - .send(updatedInfo) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_UPDATE); - res.body.should.have.property("data"); - // Is this correct matching of data? - res.body.data.firstName.should.equal(updatedInfo.firstName); - res.body.data.lastName.should.equal(updatedInfo.lastName); - done(); - }); + }); + + // succeed on :self case + it("should SUCCEED and update the user's own account", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .patch(`/api/account/${updatedInfo._id}`) + .type("application/json") + .send(updatedInfo) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_UPDATE); + res.body.should.have.property("data"); + // Is this correct matching of data? + res.body.data.firstName.should.equal(updatedInfo.firstName); + res.body.data.lastName.should.equal(updatedInfo.lastName); + done(); }); }); - - // fail due to lack of authorization - it("should Fail to update an account due to lack of authorization", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .patch(`/api/account/${failUpdatedInfo._id}`) - .type("application/json") - .send(updatedInfo) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); + }); + + // fail due to lack of authorization + it("should Fail to update an account due to lack of authorization", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .patch(`/api/account/${failUpdatedInfo._id}`) + .type("application/json") + .send(updatedInfo) + .end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + + done(); }); }); + }); }); -describe("POST reset password", function () { - const password = { - "password": "NewPassword" - }; - it("should SUCCEED and change the password", function (done) { - chai.request(server.app) - .post("/api/auth/password/reset") - .type("application/json") - .set("X-Reset-Token", resetToken) - .send(password) - .end(function (err, res) { - res.should.have.status(200); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.AUTH_RESET_PASSWORD); - done(); - }); - }); +describe("POST reset password", function() { + const password = { + password: "NewPassword" + }; + it("should SUCCEED and change the password", function(done) { + chai + .request(server.app) + .post("/api/auth/password/reset") + .type("application/json") + .set("X-Reset-Token", resetToken) + .send(password) + .end(function(err, res) { + res.should.have.status(200); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.AUTH_RESET_PASSWORD); + done(); + }); + }); }); -describe("PATCH change password for logged in user", function () { - const successChangePassword = { - "oldPassword": Admin0.password, - "newPassword": "password12345" - }; - const failChangePassword = { - "oldPassword": "WrongPassword", - "newPassword": "password12345" - }; - // fail on authentication - it("should fail to change the user's password because they are not logged in", function (done) { - chai.request(server.app) - .patch("/api/auth/password/change") - .type("application/json") - .send(failChangePassword) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); - }); - // success case - it("should change the logged in user's password to a new password", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .patch("/api/auth/password/change") - .type("application/json") - .send(successChangePassword) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.AUTH_RESET_PASSWORD); - done(); - }); +describe("PATCH change password for logged in user", function() { + const successChangePassword = { + oldPassword: Admin0.password, + newPassword: "password12345" + }; + const failChangePassword = { + oldPassword: "WrongPassword", + newPassword: "password12345" + }; + // fail on authentication + it("should fail to change the user's password because they are not logged in", function(done) { + chai + .request(server.app) + .patch("/api/auth/password/change") + .type("application/json") + .send(failChangePassword) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + // success case + it("should change the logged in user's password to a new password", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .patch("/api/auth/password/change") + .type("application/json") + .send(successChangePassword) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.AUTH_RESET_PASSWORD); + done(); }); }); - // fail case because old password in incorrect - it("should fail to change the logged in user's password to a new password because old password is incorrect", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .patch("/api/auth/password/change") - .type("application/json") - .send(failChangePassword) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); + }); + // fail case because old password in incorrect + it("should fail to change the logged in user's password to a new password because old password is incorrect", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .patch("/api/auth/password/change") + .type("application/json") + .send(failChangePassword) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); }); }); + }); }); -describe("GET retrieve permissions", function () { - it("should SUCCEED and retrieve the rolebindings for the user", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .get("/api/auth/rolebindings/" + teamHackerAccount0._id) - .type("application/json") - .end(function (err, res) { - res.should.have.status(200); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.AUTH_GET_ROLE_BINDINGS); - res.body.should.have.property("data"); - res.body.data.should.be.a("object"); - res.body.data.should.have.property("roles"); - res.body.data.should.have.property("accountId"); - res.body.data.accountId.should.equal(teamHackerAccount0._id.toHexString()); - done(); - }); +describe("GET retrieve permissions", function() { + it("should SUCCEED and retrieve the rolebindings for the user", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .get("/api/auth/rolebindings/" + teamHackerAccount0._id) + .type("application/json") + .end(function(err, res) { + res.should.have.status(200); + res.body.should.have.property("message"); + res.body.message.should.equal( + Constants.Success.AUTH_GET_ROLE_BINDINGS + ); + res.body.should.have.property("data"); + res.body.data.should.be.a("object"); + res.body.data.should.have.property("roles"); + res.body.data.should.have.property("accountId"); + res.body.data.accountId.should.equal( + teamHackerAccount0._id.toHexString() + ); + done(); }); }); - it("should FAIL to retrieve the rolebindings as the account is not authenticated", function (done) { - chai.request(server.app) - .get("/api/auth/rolebindings/" + teamHackerAccount0._id) - .type("application/json") - .end(function (err, res) { - res.should.have.status(401); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); - }); + }); + it("should FAIL to retrieve the rolebindings as the account is not authenticated", function(done) { + chai + .request(server.app) + .get("/api/auth/rolebindings/" + teamHackerAccount0._id) + .type("application/json") + .end(function(err, res) { + res.should.have.status(401); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); }); -describe("GET resend confirmation email", function () { - it("should SUCCEED and resend the confirmation email", function (done) { - util.auth.login(agent, storedAccount1, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .get("/api/auth/confirm/resend") - .type("application/json") - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.AUTH_SEND_CONFIRMATION_EMAIL); - done(); - }); +describe("GET resend confirmation email", function() { + it("should SUCCEED and resend the confirmation email", function(done) { + util.auth.login(agent, storedAccount1, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .get("/api/auth/confirm/resend") + .type("application/json") + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal( + Constants.Success.AUTH_SEND_CONFIRMATION_EMAIL + ); + done(); }); }); - it("should FAIL as the account is already confirmed", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .get("/api/auth/confirm/resend") - .type("application/json") - .end(function (err, res) { - res.should.have.status(422); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal("Account already confirmed"); - done(); - }); + }); + it("should FAIL as the account is already confirmed", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .get("/api/auth/confirm/resend") + .type("application/json") + .end(function(err, res) { + res.should.have.status(422); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal("Account already confirmed"); + done(); }); }); - it("should FAIL as account confirmation token does not exist", function (done) { - util.auth.login(agent, storedAccount3, (error) => { - if (error) { - agent.close(); - return done(error); - } - agent - .get("/api/auth/confirm/resend") - .type("application/json") - .end(function (err, res) { - res.should.have.status(428); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal("Account confirmation token does not exist"); - done(); - }); + }); + it("should FAIL as account confirmation token does not exist", function(done) { + util.auth.login(agent, storedAccount3, error => { + if (error) { + agent.close(); + return done(error); + } + agent + .get("/api/auth/confirm/resend") + .type("application/json") + .end(function(err, res) { + res.should.have.status(428); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal( + "Account confirmation token does not exist" + ); + done(); }); }); + }); }); -describe("POST invite account", function () { - it("Should succeed to invite a user to create an account", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); +describe("POST invite account", function() { + it("Should succeed to invite a user to create an account", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .post("/api/account/invite") + .type("application/json") + .send({ + email: newAccount0.email, + accountType: Constants.General.VOLUNTEER + }) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .post("/api/account/invite") - .type("application/json") - .send({ - email: newAccount0.email, - accountType: Constants.General.VOLUNTEER - }) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_INVITE); - done(); - }); - }); + res.should.have.status(200); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_INVITE); + done(); + }) + ); }); + }); }); -describe("GET invites", function () { - it("Should FAIL to get all invites due to Authentication", function (done) { - chai.request(server.app) - .get("/api/account/invite") - .end(function (err, res) { - res.should.have.status(401); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); +describe("GET invites", function() { + it("Should FAIL to get all invites due to Authentication", function(done) { + chai + .request(server.app) + .get("/api/account/invite") + .end(function(err, res) { + res.should.have.status(401); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + it("Should FAIL to get all invites due to Authorization", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent.get("/api/account/invite").end(function(err, res) { + res.should.have.status(403); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + done(); + }); }); - it("Should FAIL to get all invites due to Authorization", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/account/invite") - .end(function (err, res) { - res.should.have.status(403); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - done(); - }); - }); + }); + it("Should SUCCEED to get all invites", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent.get("/api/account/invite").end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(200); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.ACCOUNT_GET_INVITES); + res.body.should.have.property("data"); + res.body.data.should.have.property("invites"); + res.body.data.invites.length.should.equal( + util.accountConfirmation.AccountConfirmationTokens.length + ); + done(); + }); }); - it("Should SUCCEED to get all invites", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/account/invite") - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.ACCOUNT_GET_INVITES); - res.body.should.have.property("data"); - res.body.data.should.have.property("invites"); - res.body.data.invites.length.should.equal(util.accountConfirmation.AccountConfirmationTokens.length); - done(); - }); - }); - }); -}); \ No newline at end of file + }); +}); diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 2953af27..28b45c4e 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -9,16 +9,16 @@ const Hacker = require("../models/hacker.model"); const fs = require("fs"); const path = require("path"); const Constants = { - Success: require("../constants/success.constant"), - General: require("../constants/general.constant"), - Error: require("../constants/error.constant"), + Success: require("../constants/success.constant"), + General: require("../constants/general.constant"), + Error: require("../constants/error.constant") }; const util = { - auth: require("./util/auth.test.util"), - hacker: require("./util/hacker.test.util"), - account: require("./util/account.test.util"), - accountConfirmation: require("./util/accountConfirmation.test.util") + auth: require("./util/auth.test.util"), + hacker: require("./util/hacker.test.util"), + account: require("./util/account.test.util"), + accountConfirmation: require("./util/accountConfirmation.test.util") }; const StorageService = require("../services/storage.service"); @@ -29,7 +29,6 @@ const volunteerAccount0 = util.account.volunteerAccounts.stored[0]; const newHackerAccount0 = util.account.hackerAccounts.new[0]; const newHacker0 = util.hacker.newHacker0; const invalidHacker0 = util.hacker.invalidHacker0; - const newHacker1 = util.hacker.newHacker1; const noTeamHackerAccount0 = util.account.hackerAccounts.stored.noTeam[0]; @@ -43,977 +42,1050 @@ const duplicateAccountLinkHacker0 = util.hacker.duplicateAccountLinkHacker0; const invalidHacker1 = util.hacker.invalidHacker1; -describe("GET hacker", function () { - // fail on authentication - it("should fail to list a hacker's information on /api/hacker/:id GET due to authentication", function (done) { - chai.request(server.app) - .get(`/api/hacker/` + TeamHacker0._id) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); +describe("GET hacker", function() { + // fail on authentication + it("should fail to list a hacker's information on /api/hacker/:id GET due to authentication", function(done) { + chai + .request(server.app) + .get(`/api/hacker/` + TeamHacker0._id) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + + // success case + it("should list the user's hacker info on /api/hacker/self GET", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent.get("/api/hacker/self").end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_READ); + res.body.should.have.property("data"); + + let hacker = new Hacker(TeamHacker0); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker.toJSON()) + ); + done(); + }); }); - - // success case - it("should list the user's hacker info on /api/hacker/self GET", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/hacker/self") - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_READ); - res.body.should.have.property("data"); - - let hacker = new Hacker(TeamHacker0); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker.toJSON())); - done(); - }); - }); + }); + + // fail case due to wrong account type + it("should fail to list the hacker info of an admin due to wrong account type /api/account/self GET", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent.get("/api/hacker/self").end(function(err, res) { + res.should.have.status(409); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_TYPE_409_MESSAGE); + done(); + }); }); - - // fail case due to wrong account type - it("should fail to list the hacker info of an admin due to wrong account type /api/account/self GET", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // succeed on admin case + it("should list a hacker's information using admin power on /api/hacker/:id GET", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/hacker/${TeamHacker0._id}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get("/api/hacker/self") - .end(function (err, res) { - res.should.have.status(409); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.ACCOUNT_TYPE_409_MESSAGE); - done(); - }); - }); + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_READ); + res.body.should.have.property("data"); + + let hacker = new Hacker(TeamHacker0); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker.toJSON()) + ); + + done(); + }) + ); }); - - // succeed on admin case - it("should list a hacker's information using admin power on /api/hacker/:id GET", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // succeed on :self case + it("should list the user's hacker information on /api/hacker/:id GET", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/hacker/${TeamHacker0._id}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/hacker/${TeamHacker0._id}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_READ); - res.body.should.have.property("data"); - - let hacker = new Hacker(TeamHacker0); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker.toJSON())); - - done(); - }); - }); + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_READ); + res.body.should.have.property("data"); + + let hacker = new Hacker(TeamHacker0); + + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker.toJSON()) + ); + + done(); + }) + ); }); - - // succeed on :self case - it("should list the user's hacker information on /api/hacker/:id GET", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // fail due to lack of authorization + it("should fail to list a hacker information due to lack of authorization on /api/hacker/:id GET", function(done) { + util.auth.login(agent, noTeamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/hacker/${TeamHacker0._id}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/hacker/${TeamHacker0._id}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_READ); - res.body.should.have.property("data"); - - let hacker = new Hacker(TeamHacker0); - - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker.toJSON())); - - done(); - }); - }); + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + + done(); + }) + ); }); - - // fail due to lack of authorization - it("should fail to list a hacker information due to lack of authorization on /api/hacker/:id GET", function (done) { - util.auth.login(agent, noTeamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get(`/api/hacker/${TeamHacker0._id}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); - }); - }); - - // fail due to lack of hacker - it("should fail to list an invalid hacker /api/hacker/:id GET", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get(`/api/hacker/${invalidHacker1._id}`) - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(404); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.HACKER_404_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); + }); + + // fail due to lack of hacker + it("should fail to list an invalid hacker /api/hacker/:id GET", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get(`/api/hacker/${invalidHacker1._id}`) + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(404); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.HACKER_404_MESSAGE); + res.body.should.have.property("data"); + + done(); }); }); - - // succeed on admin case - it("should list a hacker's information using admin power on /api/hacker/email/:email GET", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // succeed on admin case + it("should list a hacker's information using admin power on /api/hacker/email/:email GET", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/hacker/email/${teamHackerAccount0.email}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/hacker/email/${teamHackerAccount0.email}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_READ); - res.body.should.have.property("data"); - - let hacker = new Hacker(TeamHacker0); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker.toJSON())); - - done(); - }); - }); + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_READ); + res.body.should.have.property("data"); + + let hacker = new Hacker(TeamHacker0); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker.toJSON()) + ); + + done(); + }) + ); }); - - // succeed on :self case - it("should list the user's hacker information on /api/hacker/email/:email GET", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // succeed on :self case + it("should list the user's hacker information on /api/hacker/email/:email GET", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/hacker/email/${teamHackerAccount0.email}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/hacker/email/${teamHackerAccount0.email}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_READ); - res.body.should.have.property("data"); - - let hacker = new Hacker(TeamHacker0); - - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker.toJSON())); - - done(); - }); - }); + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_READ); + res.body.should.have.property("data"); + + let hacker = new Hacker(TeamHacker0); + + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker.toJSON()) + ); + + done(); + }) + ); }); - - // fail due to lack of authorization - it("should fail to list a hacker information due to lack of authorization on /api/hacker/email/:id GET", function (done) { - util.auth.login(agent, noTeamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); + }); + + // fail due to lack of authorization + it("should fail to list a hacker information due to lack of authorization on /api/hacker/email/:id GET", function(done) { + util.auth.login(agent, noTeamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get(`/api/hacker/email/${teamHackerAccount0.email}`) + // does not have password because of to stripped json + .end(function(err, res) { + if (err) { + return done(err); } - return agent - .get(`/api/hacker/email/${teamHackerAccount0.email}`) - // does not have password because of to stripped json - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); - }); + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + + done(); + }) + ); }); + }); }); -describe("POST create hacker", function () { - // fail on authentication - it("should fail to create a new hacker due to lack of authentication", - function (done) { - chai.request(server.app) - .post(`/api/hacker/`) - .type("application/json") - .send(newHacker1) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - - done(); - }); - }); - - // succeed on admin case - it("should SUCCEED and create a new hacker (with an account that has been confirmed) using admin credentials", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .post(`/api/hacker/`) - .type("application/json") - .send(newHacker0) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_CREATE); - res.body.should.have.property("data"); - - // create JSON version of model - // delete id as they will be different between model objects - // update status to be applied on the comparator hacker object - const hacker = (new Hacker(newHacker0)).toJSON(); - hacker.status = Constants.General.HACKER_STATUS_APPLIED; - delete res.body.data.id; - delete hacker.id; - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker)); - - done(); - }); +describe("POST create hacker", function() { + // fail on authentication + it("should fail to create a new hacker due to lack of authentication", function(done) { + chai + .request(server.app) + .post(`/api/hacker/`) + .type("application/json") + .send(newHacker1) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + + done(); + }); + }); + + // succeed on admin case + it("should SUCCEED and create a new hacker (with an account that has been confirmed) using admin credentials", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + + return done(error); + } + return agent + .post(`/api/hacker/`) + .type("application/json") + .send(newHacker0) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_CREATE); + res.body.should.have.property("data"); + + // create JSON version of model + // delete id as they will be different between model objects + // update status to be applied on the comparator hacker object + const hacker = new Hacker(newHacker0).toJSON(); + hacker.status = Constants.General.HACKER_STATUS_APPLIED; + delete res.body.data.id; + delete hacker.id; + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker), + "objects do not match" + ); + + done(); }); }); - - // succeed on user case - it("should SUCCEED and create a new hacker for user (with an account that has been confirmed)", function (done) { - util.auth.login(agent, newHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .post(`/api/hacker/`) - .type("application/json") - .send(newHacker0) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_CREATE); - res.body.should.have.property("data"); - - // create JSON version of model - // delete id as they will be different between model objects - // update status to be applied on the comparator hacker object - const hacker = (new Hacker(newHacker0)).toJSON(); - hacker.status = Constants.General.HACKER_STATUS_APPLIED; - delete res.body.data.id; - delete hacker.id; - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify(hacker)); - done(); - }); + }); + + // succeed on user case + it("should SUCCEED and create a new hacker for user (with an account that has been confirmed)", function(done) { + util.auth.login(agent, newHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .post(`/api/hacker/`) + .type("application/json") + .send(newHacker0) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_CREATE); + res.body.should.have.property("data"); + + // create JSON version of model + // delete id as they will be different between model objects + // update status to be applied on the comparator hacker object + const hacker = new Hacker(newHacker0).toJSON(); + hacker.status = Constants.General.HACKER_STATUS_APPLIED; + delete res.body.data.id; + delete hacker.id; + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify(hacker) + ); + done(); }); }); - - // should fail due to 'false' on code of conduct - it("should FAIL if the new hacker does not accept code of conduct", function (done) { - util.auth.login(agent, newHacker0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .post(`/api/hacker/`) - .type("application/json") - .send(invalidHacker0) - .end(function (err, res) { - res.should.have.status(422); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal("Validation failed"); - res.body.should.have.property("data"); - res.body.data.should.have.property("codeOfConduct"); - res.body.data.codeOfConduct.msg.should.equal("Must be equal to true"); - done(); - }); + }); + + // should fail due to 'false' on code of conduct + it("should FAIL if the new hacker does not accept code of conduct", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .post(`/api/hacker/`) + .type("application/json") + .send(invalidHacker0) + .end(function(err, res) { + console.log(res); + res.should.have.status(422); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal("Validation failed"); + res.body.should.have.property("data"); + res.body.data.should.have.property("application"); + res.body.data.application.should.have.property("other"); + res.body.data.application.other.should.have.property( + "codeOfConduct_MLH" + ); + res.body.data.application.other.should.have.property( + "codeOfConduct_MCHACKS" + ); + res.body.data.application.other.codeOfConduct_MLH.msg.should.equal( + "Must be equal to true" + ); + res.body.data.application.other.codeOfConduct_MCHACKS.msh.should.equal( + "Must be equal to true" + ); + done(); }); }); - - // fail on unconfirmed account, using admin - it("should FAIL to create a new hacker if the account hasn't been confirmed", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .post(`/api/hacker/`) - .type("application/json") - .send(util.hacker.unconfirmedAccountHacker0) - .end(function (err, res) { - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); - res.should.have.status(403); - done(); - }); + }); + + // fail on unconfirmed account, using admin + it("should FAIL to create a new hacker if the account hasn't been confirmed", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .post(`/api/hacker/`) + .type("application/json") + .send(util.hacker.unconfirmedAccountHacker0) + .end(function(err, res) { + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.ACCOUNT_403_MESSAGE); + res.should.have.status(403); + done(); }); }); - - // fail due to duplicate accountId - it("should FAIL to create new hacker due to duplicate account link", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .post(`/api/hacker/`) - .type("application/json") - .send(duplicateAccountLinkHacker0) - .end(function (err, res) { - res.should.have.status(409); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.HACKER_ID_409_MESSAGE); - res.body.should.have.property("data"); - done(); - }); + }); + + // fail due to duplicate accountId + it("should FAIL to create new hacker due to duplicate account link", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .post(`/api/hacker/`) + .type("application/json") + .send(duplicateAccountLinkHacker0) + .end(function(err, res) { + res.should.have.status(409); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.HACKER_ID_409_MESSAGE); + res.body.should.have.property("data"); + done(); }); }); - - // fail on invalid input - it("should FAIL to create new hacker due to invalid input", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .post(`/api/hacker/`) - .type("application/json") - .send(invalidHacker1) - .end(function (err, res) { - // replace with actual test comparisons after error handler is implemented - res.should.have.status(422); - done(); - }); + }); + + // fail on invalid input + it("should FAIL to create new hacker due to invalid input", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .post(`/api/hacker/`) + .type("application/json") + .send(invalidHacker1) + .end(function(err, res) { + // replace with actual test comparisons after error handler is implemented + res.should.have.status(422); + done(); }); }); + }); }); -describe("PATCH update one hacker", function () { - // fail on authentication - it("should fail to update a hacker on /api/hacker/:id GET due to authentication", function (done) { - chai.request(server.app) - .patch(`/api/hacker/${TeamHacker0._id}`) - .type("application/json") - .send({ - gender: "Other" - }) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); - }); - - // should succeed on admin case - it("should SUCCEED and update a hacker using admin power", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/${TeamHacker0._id}`) - .type("application/json") - .send({ - gender: "Other" - }) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_UPDATE); - res.body.should.have.property("data"); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - gender: "Other" - })); - done(); - }); +describe("PATCH update one hacker", function() { + // fail on authentication + it("should fail to update a hacker on /api/hacker/:id GET due to authentication", function(done) { + chai + .request(server.app) + .patch(`/api/hacker/${TeamHacker0._id}`) + .type("application/json") + .send({ + gender: "Other" + }) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); + + // should succeed on admin case + it("should SUCCEED and update a hacker using admin power", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + let app = TeamHacker0.application; + app.other.gender = "Other"; + return agent + .patch(`/api/hacker/${TeamHacker0._id}`) + .type("application/json") + .send({ + application: app + }) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_UPDATE); + res.body.should.have.property("data"); + chai.assert.equal( + JSON.stringify(res.body.data.application.other.gender), + '"Other"' + ); + done(); }); }); - - it("should SUCCEED and update a hacker STATUS as an Admin", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/status/${TeamHacker0._id}`) - .type("application/json") - .send({ - status: "Accepted" - }) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_UPDATE); - res.body.should.have.property("data"); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - status: "Accepted" - })); - done(); - }); + }); + + it("should SUCCEED and update a hacker STATUS as an Admin", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/status/${TeamHacker0._id}`) + .type("application/json") + .send({ + status: "Accepted" + }) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_UPDATE); + res.body.should.have.property("data"); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify({ + status: "Accepted" + }) + ); + done(); }); }); - - it("should FAIL and NOT update a hacker STATUS as a Hacker", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/status/${TeamHacker0._id}`) - .type("application/json") - .send({ - status: "Accepted" - }) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - done(); - }); + }); + + it("should FAIL and NOT update a hacker STATUS as a Hacker", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/status/${TeamHacker0._id}`) + .type("application/json") + .send({ + status: "Accepted" + }) + .end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); }); }); - - // volunteer should successfully checkin hacker - it("should SUCCEED and check in hacker as a volunteer", function (done) { - util.auth.login(agent, volunteerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/checkin/${TeamHacker0._id}`) - .type("application/json") - .send({ - status: "Checked-in" - }) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_UPDATE); - res.body.should.have.property("data"); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - status: "Checked-in" - })); - done(); - }); + }); + + // volunteer should successfully checkin hacker + it("should SUCCEED and check in hacker as a volunteer", function(done) { + util.auth.login(agent, volunteerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/checkin/${TeamHacker0._id}`) + .type("application/json") + .send({ + status: "Checked-in" + }) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_UPDATE); + res.body.should.have.property("data"); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify({ + status: "Checked-in" + }) + ); + done(); }); }); - - // hacker should fail to checkin hacker - it("should FAIL to check in hacker as a hacker", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/checkin/${TeamHacker0._id}`) - .type("application/json") - .send({ - status: "Checked-in" - }) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - done(); - }); + }); + + // hacker should fail to checkin hacker + it("should FAIL to check in hacker as a hacker", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/checkin/${TeamHacker0._id}`) + .type("application/json") + .send({ + status: "Checked-in" + }) + .end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); }); }); - - // should succeed on hacker case - it("should SUCCEED and update the user's hacker info", function (done) { - util.auth.login(agent, noTeamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/${noTeamHacker0._id}`) - .type("application/json") - .send({ - gender: "Other" - }) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_UPDATE); - res.body.should.have.property("data"); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - gender: "Other" - })); - done(); - }); + }); + + // should succeed on hacker case + it("should SUCCEED and update the user's hacker info", function(done) { + util.auth.login(agent, noTeamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + let app = noTeamHacker0.application; + app.other.gender = "Other"; + return agent + .patch(`/api/hacker/${noTeamHacker0._id}`) + .type("application/json") + .send({ + application: app + }) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_UPDATE); + res.body.should.have.property("data"); + chai.assert.equal( + JSON.stringify(res.body.data.application.other.gender), + '"Other"' + ); + done(); }); }); - - // should fail due to authorization - it("should Fail to update hacker info due to lack of authorization", function (done) { - util.auth.login(agent, noTeamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/${TeamHacker0._id}`) - .type("application/json") - .send({ - gender: "Other" - }) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); + }); + + // should fail due to authorization + it("should Fail to update hacker info due to lack of authorization", function(done) { + util.auth.login(agent, noTeamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/${TeamHacker0._id}`) + .type("application/json") + .send({ + gender: "Other" + }) + .end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + + done(); }); }); - - // fail due to lack of hacker - it("should fail to change an invalid hacker's info", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get(`/api/hacker/${invalidHacker1._id}`) - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(404); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.HACKER_404_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); + }); + + // fail due to lack of hacker + it("should fail to change an invalid hacker's info", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get(`/api/hacker/${invalidHacker1._id}`) + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(404); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.HACKER_404_MESSAGE); + res.body.should.have.property("data"); + + done(); }); }); + }); + + // Succeed and change accepted to confirm + it("should succeed for hacker to update their own status from accepted to confirmed", function(done) { + util.auth.login(agent, noTeamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/confirmation/${noTeamHacker0._id}`) + .type("application/json") + .send({ + confirm: true + }) + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_UPDATE); + res.body.should.have.property("data"); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify({ + status: Constants.General.HACKER_STATUS_CONFIRMED + }) + ); - // Succeed and change accepted to confirm - it("should succeed for hacker to update their own status from accepted to confirmed", function (done) { - util.auth.login(agent, noTeamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/confirmation/${noTeamHacker0._id}`) - .type("application/json") - .send({ - confirm: true - }) - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_UPDATE); - res.body.should.have.property("data"); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - status: Constants.General.HACKER_STATUS_CONFIRMED - })); - - done(); - }); + done(); }); }); + }); + + // Succeed and change confirmed to accepted + it("should succeed for hacker to update their own status from confirmed to accepted", function(done) { + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/confirmation/${TeamHacker0._id}`) + .type("application/json") + .send({ + confirm: false + }) + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_UPDATE); + res.body.should.have.property("data"); + chai.assert.equal( + JSON.stringify(res.body.data), + JSON.stringify({ + status: Constants.General.HACKER_STATUS_CANCELLED + }) + ); - // Succeed and change confirmed to accepted - it("should succeed for hacker to update their own status from confirmed to accepted", function (done) { - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/confirmation/${TeamHacker0._id}`) - .type("application/json") - .send({ - confirm: false - }) - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_UPDATE); - res.body.should.have.property("data"); - chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - status: Constants.General.HACKER_STATUS_CANCELLED - })); - - done(); - }); + done(); }); }); - - // fail for a hacker that's not accepted - it("should fail to update hacker status when hacker status is not accepted or confirmed", function (done) { - util.auth.login(agent, util.account.waitlistedHacker0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/confirmation/${util.hacker.waitlistedHacker0._id}`) - .type("application/json") - .send({ - confirm: true - }) - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(409); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.HACKER_STATUS_409_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); + }); + + // fail for a hacker that's not accepted + it("should fail to update hacker status when hacker status is not accepted or confirmed", function(done) { + util.auth.login(agent, util.account.waitlistedHacker0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/confirmation/${util.hacker.waitlistedHacker0._id}`) + .type("application/json") + .send({ + confirm: true + }) + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(409); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal( + Constants.Error.HACKER_STATUS_409_MESSAGE + ); + res.body.should.have.property("data"); + + done(); }); }); - - // fail for a hacker that's not accepted - it("should fail for hacker trying to confirm someone else", function (done) { - util.auth.login(agent, util.account.waitlistedHacker0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .patch(`/api/hacker/confirmation/${noTeamHacker0._id}`) - .type("application/json") - .send({ - confirm: true - }) - .end(function (err, res) { - if (err) { - return done(err); - } - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - - done(); - }); + }); + + // fail for a hacker that's not accepted + it("should fail for hacker trying to confirm someone else", function(done) { + util.auth.login(agent, util.account.waitlistedHacker0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/confirmation/${noTeamHacker0._id}`) + .type("application/json") + .send({ + confirm: true + }) + .end(function(err, res) { + if (err) { + return done(err); + } + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + + done(); }); }); + }); }); -describe("POST add a hacker resume", function () { - it("It should SUCCEED and upload a resume for a hacker", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, noTeamHacker0, (error) => { - if (error) { - return done(error); - } - return agent - .post(`/api/hacker/resume/${noTeamHacker0._id}`) - .type("multipart/form-data") - .attach("resume", fs.createReadStream(path.join(__dirname, "testResume.pdf")), { - contentType: "application/pdf" - }) - .end(function (err, res) { - res.should.have.status(200); - res.should.have.property("body"); - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.RESUME_UPLOAD); - res.body.should.have.property("data"); - res.body.data.should.have.property("filename"); - StorageService.download(res.body.data.filename).then((value) => { - const actualFile = fs.readFileSync(path.join(__dirname, "testResume.pdf")); - chai.assert.equal(value[0].length, actualFile.length); - StorageService.delete(res.body.data.filename).then(() => { - done(); - }).catch(done); - }); - }); +describe("POST add a hacker resume", function() { + it("It should SUCCEED and upload a resume for a hacker", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, noTeamHacker0, error => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/resume/${noTeamHacker0._id}`) + .type("multipart/form-data") + .attach( + "resume", + fs.createReadStream(path.join(__dirname, "testResume.pdf")), + { + contentType: "application/pdf" + } + ) + .end(function(err, res) { + res.should.have.status(200); + res.should.have.property("body"); + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.RESUME_UPLOAD); + res.body.should.have.property("data"); + res.body.data.should.have.property("filename"); + StorageService.download(res.body.data.filename).then(value => { + const actualFile = fs.readFileSync( + path.join(__dirname, "testResume.pdf") + ); + chai.assert.equal(value[0].length, actualFile.length); + StorageService.delete(res.body.data.filename) + .then(() => { + done(); + }) + .catch(done); + }); }); }); + }); }); -describe("GET Hacker stats", function () { - it("It should FAIL and get hacker stats (invalid validation)", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, Admin0, (error) => { - if (error) { - return done(error); - } - return agent - .get(`/api/hacker/stats`) - .end(function (err, res) { - res.should.have.status(422); - res.should.have.property("body"); - res.body.should.have.property("message"); - done(); - }); - }); +describe("GET Hacker stats", function() { + it("It should FAIL and get hacker stats (invalid validation)", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, error => { + if (error) { + return done(error); + } + return agent.get(`/api/hacker/stats`).end(function(err, res) { + res.should.have.status(422); + res.should.have.property("body"); + res.body.should.have.property("message"); + done(); + }); }); - it("It should SUCCEED and get hacker stats", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, Admin0, (error) => { - if (error) { - return done(error); - } - return agent - .get(`/api/hacker/stats`) - .query({ - model: "hacker", - q: JSON.stringify([]) - }) - .end(function (err, res) { - res.should.have.status(200); - res.should.have.property("body"); - res.body.should.have.property("message"); - res.body.message.should.equal("Retrieved stats"); - res.body.should.have.property("data"); - res.body.data.should.have.property("stats"); - res.body.data.stats.should.have.property("total"); - res.body.data.stats.should.have.property("status"); - res.body.data.stats.should.have.property("school"); - res.body.data.stats.should.have.property("degree"); - res.body.data.stats.should.have.property("gender"); - res.body.data.stats.should.have.property("needsBus"); - res.body.data.stats.should.have.property("ethnicity"); - res.body.data.stats.should.have.property("jobInterest"); - res.body.data.stats.should.have.property("major"); - res.body.data.stats.should.have.property("graduationYear"); - res.body.data.stats.should.have.property("dietaryRestrictions"); - res.body.data.stats.should.have.property("shirtSize"); - res.body.data.stats.should.have.property("age"); - done(); - }); - }); - }); - it("It should FAIL and get hacker stats due to invalid Authorization", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, teamHackerAccount0, (error) => { - if (error) { - return done(error); - } - return agent - .get(`/api/hacker/stats`) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - done(); - }); + }); + it("It should SUCCEED and get hacker stats", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, error => { + if (error) { + return done(error); + } + return agent + .get(`/api/hacker/stats`) + .query({ + model: "hacker", + q: JSON.stringify([]) + }) + .end(function(err, res) { + res.should.have.status(200); + res.should.have.property("body"); + res.body.should.have.property("message"); + res.body.message.should.equal("Retrieved stats"); + res.body.should.have.property("data"); + res.body.data.should.have.property("stats"); + res.body.data.stats.should.have.property("total"); + res.body.data.stats.should.have.property("status"); + res.body.data.stats.should.have.property("school"); + res.body.data.stats.should.have.property("degree"); + res.body.data.stats.should.have.property("gender"); + res.body.data.stats.should.have.property("needsBus"); + res.body.data.stats.should.have.property("ethnicity"); + res.body.data.stats.should.have.property("jobInterest"); + res.body.data.stats.should.have.property("fieldOfStudy"); + res.body.data.stats.should.have.property("graduationYear"); + res.body.data.stats.should.have.property("dietaryRestrictions"); + res.body.data.stats.should.have.property("shirtSize"); + res.body.data.stats.should.have.property("age"); + done(); }); }); - it("It should FAIL and get hacker stats due to invalid Authentication", function (done) { - //this takes a lot of time for some reason - chai.request(server.app) - .get(`/api/hacker/stats`) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - done(); - }); + }); + it("It should FAIL and get hacker stats due to invalid Authorization", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, teamHackerAccount0, error => { + if (error) { + return done(error); + } + return agent.get(`/api/hacker/stats`).end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); + }); }); + }); + it("It should FAIL and get hacker stats due to invalid Authentication", function(done) { + //this takes a lot of time for some reason + chai + .request(server.app) + .get(`/api/hacker/stats`) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + done(); + }); + }); }); -describe("POST send week-of email", function () { - it("It should FAIL to send the week-of email due to invalid Authentication", function (done) { - //this takes a lot of time for some reason - chai.request(server.app) - .post(`/api/hacker/email/weekOf/${noTeamHacker0._id}`) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - res.body.should.have.property("data"); - done(); - }); - }); - it("It should FAIL to send the week-of email due to invalid Authorization", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, noTeamHacker0, (error) => { - if (error) { - return done(error); - } - return agent - .post(`/api/hacker/email/weekOf/${noTeamHacker0._id}`) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - done(); - }); +describe("POST send week-of email", function() { + it("It should FAIL to send the week-of email due to invalid Authentication", function(done) { + //this takes a lot of time for some reason + chai + .request(server.app) + .post(`/api/hacker/email/weekOf/${noTeamHacker0._id}`) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + it("It should FAIL to send the week-of email due to invalid Authorization", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, noTeamHacker0, error => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/weekOf/${noTeamHacker0._id}`) + .end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); }); }); - it("It should SUCCEED to send the week-of email", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, Admin0, (error) => { - if (error) { - return done(error); - } - return agent - .post(`/api/hacker/email/weekOf/${TeamHacker0._id}`) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_SENT_WEEK_OF); - res.body.should.have.property("data"); - done(); - }); + }); + it("It should SUCCEED to send the week-of email", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, error => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/weekOf/${TeamHacker0._id}`) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_SENT_WEEK_OF); + res.body.should.have.property("data"); + done(); }); }); + }); }); -describe("POST send day-of email", function () { - it("It should FAIL to send the day-of email due to invalid Authentication", function (done) { - //this takes a lot of time for some reason - chai.request(server.app) - .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) - .end(function (err, res) { - res.should.have.status(401); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - res.body.should.have.property("data"); - done(); - }); - }); - it("It should FAIL to send the day-of email due to invalid Authorization", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, teamHackerAccount1, (error) => { - if (error) { - return done(error); - } - return agent - .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) - .end(function (err, res) { - res.should.have.status(403); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - done(); - }); +describe("POST send day-of email", function() { + it("It should FAIL to send the day-of email due to invalid Authentication", function(done) { + //this takes a lot of time for some reason + chai + .request(server.app) + .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) + .end(function(err, res) { + res.should.have.status(401); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + }); + it("It should FAIL to send the day-of email due to invalid Authorization", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, teamHackerAccount1, error => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) + .end(function(err, res) { + res.should.have.status(403); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); }); }); - it("It should SUCCEED to send the day-of email", function (done) { - //this takes a lot of time for some reason - util.auth.login(agent, Admin0, (error) => { - if (error) { - return done(error); - } - return agent - .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) - .end(function (err, res) { - res.should.have.status(200); - res.should.be.json; - res.body.should.have.property("message"); - res.body.message.should.equal(Constants.Success.HACKER_SENT_DAY_OF); - res.body.should.have.property("data"); - done(); - }); + }); + it("It should SUCCEED to send the day-of email", function(done) { + //this takes a lot of time for some reason + util.auth.login(agent, Admin0, error => { + if (error) { + return done(error); + } + return agent + .post(`/api/hacker/email/dayOf/${TeamHacker1._id}`) + .end(function(err, res) { + res.should.have.status(200); + res.should.be.json; + res.body.should.have.property("message"); + res.body.message.should.equal(Constants.Success.HACKER_SENT_DAY_OF); + res.body.should.have.property("data"); + done(); }); }); -}); \ No newline at end of file + }); +}); diff --git a/tests/search.service.spec.js b/tests/search.service.spec.js index 78bf1d59..bf141a76 100644 --- a/tests/search.service.spec.js +++ b/tests/search.service.spec.js @@ -11,281 +11,297 @@ const should = chai.should(); const logger = require("../services/logger.service"); const Constants = { - Error: require("../constants/error.constant"), + Error: require("../constants/error.constant") }; const util = { - hacker: require("./util/hacker.test.util"), - account: require("./util/account.test.util"), - auth: require("./util/auth.test.util") + hacker: require("./util/hacker.test.util"), + account: require("./util/account.test.util"), + auth: require("./util/auth.test.util") }; -const queryToExecute = [{ - param: "gender", +const queryToExecute = [ + { + param: "application.other.gender", operation: "equals", value: "Female" -}]; + } +]; -const query2 = [{ - param: "school", +const query2 = [ + { + param: "application.general.school", operation: "ne", value: "McGill" -}]; + } +]; -const badQuery = [{ +const badQuery = [ + { param: "password", operation: "equals", value: "passowrd" -}]; + } +]; const Admin0 = util.account.staffAccounts.stored[0]; const noTeamHackerAccount0 = util.account.hackerAccounts.stored.noTeam[0]; -describe("Searching for hackers", function () { - it("Should FAIL to search due to invalid authentication", function (done) { - util.auth.login(agent, { - email: "abc", - password: "def" - }, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(queryToExecute) - }) - .end(function (err, res) { - res.should.have.status(401); - res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); - res.body.should.have.property("data"); - done(); - }); - }); - }); +describe("Searching for hackers", function() { + it("Should FAIL to search due to invalid authentication", function(done) { + util.auth.login( + agent, + { + email: "abc", + password: "def" + }, + error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(queryToExecute) + }) + .end(function(err, res) { + res.should.have.status(401); + res.body.message.should.equal(Constants.Error.AUTH_401_MESSAGE); + res.body.should.have.property("data"); + done(); + }); + } + ); + }); - it("Should FAIL to search due to invalid authorization", function (done) { - util.auth.login(agent, noTeamHackerAccount0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(queryToExecute) - }) - .end(function (err, res) { - res.should.have.status(403); - res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); - res.body.should.have.property("data"); - done(); - }); + it("Should FAIL to search due to invalid authorization", function(done) { + util.auth.login(agent, noTeamHackerAccount0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(queryToExecute) + }) + .end(function(err, res) { + res.should.have.status(403); + res.body.message.should.equal(Constants.Error.AUTH_403_MESSAGE); + res.body.should.have.property("data"); + done(); }); }); - it("Should return all female hackers", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(queryToExecute) - }) - .end(function (err, res) { - res.should.have.status(200); - res.body.should.have.property("data"); - res.body.data.should.have.length(6); - done(); - }); + }); + it("Should return all female hackers", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(queryToExecute) + }) + .end(function(err, res) { + res.should.have.status(200); + res.body.should.have.property("data"); + res.body.data.should.have.length(6); + done(); }); }); - it("Should return an error as hackers don't have password stored", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(badQuery) - }) - .end(function (err, res) { - res.should.have.status(422); - done(); - }); + }); + it("Should return an error as hackers don't have password stored", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(badQuery) + }) + .end(function(err, res) { + res.should.have.status(422); + done(); }); }); + }); - it("Should return an error as staff aren't searchable", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "staff", - q: JSON.stringify(badQuery) - }) - .end(function (err, res) { - res.should.have.status(422); - res.body.data.model.msg.should.equal("Must be a valid searchable model"); - done(); - }); + it("Should return an error as staff aren't searchable", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "staff", + q: JSON.stringify(badQuery) + }) + .end(function(err, res) { + res.should.have.status(422); + res.body.data.model.msg.should.equal( + "Must be a valid searchable model" + ); + done(); }); }); - it("Should throw an error because model is not lowercase", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "Hacker", - q: JSON.stringify(query2) - }) - .end(function (err, res) { - res.should.have.status(422); - res.body.data.model.msg.should.equal("Model must be lower case"); - done(); - }); + }); + it("Should throw an error because model is not lowercase", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "Hacker", + q: JSON.stringify(query2) + }) + .end(function(err, res) { + res.should.have.status(422); + res.body.data.model.msg.should.equal("Model must be lower case"); + done(); }); }); - it("Should throw an error because of a fake model", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hackerz", - q: JSON.stringify(query2) - }) - .end(function (err, res) { - res.should.have.status(422); - res.body.data.model.msg.should.equal("Must be a valid searchable model"); - done(); - }); + }); + it("Should throw an error because of a fake model", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hackerz", + q: JSON.stringify(query2) + }) + .end(function(err, res) { + res.should.have.status(422); + res.body.data.model.msg.should.equal( + "Must be a valid searchable model" + ); + done(); }); }); - it("Should only return 1 hacker (page size)", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(query2), - limit: 1 - }) - .end(function (err, res) { - res.should.have.status(200); - res.body.data.should.have.length(1); - done(); - }); + }); + it("Should only return 1 hacker (page size)", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(query2), + limit: 1 + }) + .end(function(err, res) { + res.should.have.status(200); + res.body.data.should.have.length(1); + done(); }); }); - it("Should only return 1 hacker (pagination)", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - //There are two test samples so by making limit 1, there will be something on the second page - .query({ - model: "hacker", - q: JSON.stringify(query2), - limit: 1, - page: 1 - }) - .end(function (err, res) { - res.should.have.status(200); - res.body.data.should.have.length(1); - done(); - }); - }); + }); + it("Should only return 1 hacker (pagination)", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return ( + agent + .get("/api/search") + //There are two test samples so by making limit 1, there will be something on the second page + .query({ + model: "hacker", + q: JSON.stringify(query2), + limit: 1, + page: 1 + }) + .end(function(err, res) { + res.should.have.status(200); + res.body.data.should.have.length(1); + done(); + }) + ); }); - it("Should throw an error because out of bounds (page size)", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(query2), - limit: 5000 - }) - .end(function (err, res) { - res.should.have.status(422); - done(); - }); + }); + it("Should throw an error because out of bounds (page size)", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(query2), + limit: 5000 + }) + .end(function(err, res) { + res.should.have.status(422); + done(); }); }); - it("Should throw an error because out of bounds (pagination)", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(query2), - limit: 1, - page: -1 - }) - .end(function (err, res) { - res.should.have.status(422); - done(); - }); + }); + it("Should throw an error because out of bounds (pagination)", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(query2), + limit: 1, + page: -1 + }) + .end(function(err, res) { + res.should.have.status(422); + done(); }); }); + }); - it("Should expand the accountId when expand is set to true", function (done) { - util.auth.login(agent, Admin0, (error) => { - if (error) { - agent.close(); - return done(error); - } - return agent - .get("/api/search") - .query({ - model: "hacker", - q: JSON.stringify(queryToExecute), - expand: true - }) - .end(function (err, res) { - res.should.have.status(200); - res.body.should.have.property("data"); - res.body.data.should.have.length(6); - res.body.data[0].should.have.property("accountId"); - res.body.data[0].accountId.should.have.property("email"); - done(); - }); + it("Should expand the accountId when expand is set to true", function(done) { + util.auth.login(agent, Admin0, error => { + if (error) { + agent.close(); + return done(error); + } + return agent + .get("/api/search") + .query({ + model: "hacker", + q: JSON.stringify(queryToExecute), + expand: true + }) + .end(function(err, res) { + res.should.have.status(200); + res.body.should.have.property("data"); + res.body.data.should.have.length(6); + res.body.data[0].should.have.property("accountId"); + res.body.data[0].accountId.should.have.property("email"); + done(); }); }); -}); \ No newline at end of file + }); +}); diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index a34c6565..c32402aa 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -1,9 +1,9 @@ "use strict"; const Util = { - Account: require("./account.test.util"), + Account: require("./account.test.util") }; const Constants = { - MongoId: require("../../constants/testMongoId.constant"), + MongoId: require("../../constants/testMongoId.constant") }; const mongoose = require("mongoose"); @@ -11,410 +11,555 @@ const Hacker = require("../../models/hacker.model"); const logger = require("../../services/logger.service"); const TeamHacker0 = { - "_id": Constants.MongoId.hackerAId, - "accountId": Util.Account.hackerAccounts.stored.team[0]._id, - "status": "Confirmed", - "school": "University of Blah", - "degree": "Masters", - "gender": "Male", - "needsBus": true, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume100", - "github": "www.github.com/Person1", - "dropler": undefined, - "personal": "www.person1.com", - "linkedIn": "www.linkedin.com/in/Person1", - "other": undefined - }, - "jobInterest": "Full-time", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["Native American"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, - "teamId": Constants.MongoId.team1Id, + _id: Constants.MongoId.hackerAId, + accountId: Util.Account.hackerAccounts.stored.team[0]._id, + status: "Confirmed", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Full-time", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume100", + github: "www.github.com/Person1", + dribbble: undefined, + personal: "www.person1.com", + linkedIn: "www.linkedin.com/in/Person1", + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Male", + ethnicity: ["Native American"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: true + } + }, + teamId: Constants.MongoId.team1Id }; const TeamHacker1 = { - "_id": Constants.MongoId.hackerDId, - "accountId": Util.Account.hackerAccounts.stored.team[1]._id, - "status": "Checked-in", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume2", - "github": "www.github.com/Personasdf", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, - "teamId": Constants.MongoId.team3Id, + _id: Constants.MongoId.hackerDId, + accountId: Util.Account.hackerAccounts.stored.team[1]._id, + status: "Checked-in", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume2", + github: "www.github.com/Personasdf", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + }, + teamId: Constants.MongoId.team3Id }; const TeamHacker2 = { - "_id": Constants.MongoId.hackerEId, - "accountId": Util.Account.hackerAccounts.stored.team[2]._id, - "status": "Waitlisted", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume2", - "github": "www.github.com/Personasdf", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, - "teamId": Constants.MongoId.team3Id, + _id: Constants.MongoId.hackerEId, + accountId: Util.Account.hackerAccounts.stored.team[2]._id, + status: "Waitlisted", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume2", + github: "www.github.com/Personasdf", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + }, + teamId: Constants.MongoId.team3Id }; const TeamHacker3 = { - "_id": Constants.MongoId.hackerFId, - "accountId": Util.Account.hackerAccounts.stored.team[3]._id, - "status": "Waitlisted", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume2", - "github": "www.github.com/Personasdf", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, - "teamId": Constants.MongoId.team3Id, + _id: Constants.MongoId.hackerFId, + accountId: Util.Account.hackerAccounts.stored.team[3]._id, + status: "Waitlisted", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume2", + github: "www.github.com/Personasdf", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + }, + teamId: Constants.MongoId.team3Id }; const TeamHacker4 = { - "_id": Constants.MongoId.hackerGId, - "accountId": Util.Account.hackerAccounts.stored.team[4]._id, - "status": "Waitlisted", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume2", - "github": "www.github.com/Personasdf", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, - "teamId": Constants.MongoId.team3Id, + _id: Constants.MongoId.hackerGId, + accountId: Util.Account.hackerAccounts.stored.team[4]._id, + status: "Waitlisted", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume2", + github: "www.github.com/Personasdf", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + }, + teamId: Constants.MongoId.team3Id }; const NoTeamHacker0 = { - "_id": Constants.MongoId.hackerBId, - "accountId": Util.Account.hackerAccounts.stored.noTeam[0]._id, - "status": "Accepted", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume1", - "github": "www.github.com/Person4", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, + _id: Constants.MongoId.hackerBId, + accountId: Util.Account.hackerAccounts.stored.noTeam[0]._id, + status: "Accepted", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume1", + github: "www.github.com/Person4", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + } }; const newHacker0 = { - "accountId": Util.Account.hackerAccounts.new[0]._id, - "school": "University of ASDF", - "degree": "Masters", - "gender": "Female", - "needsBus": true, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume100", - "github": "www.github.com/Person1", - "dropler": undefined, - "personal": "www.person1.com", - "linkedIn": "www.linkedin.com/in/Person1", - "other": undefined - }, - "jobInterest": "Full-time", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["Caucasian"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, + accountId: Util.Account.hackerAccounts.new[0]._id, + application: { + general: { + school: "University of ASDF", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Full-time", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume100", + github: "www.github.com/Person1", + dribbble: undefined, + personal: "www.person1.com", + linkedIn: "www.linkedin.com/in/Person1", + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["Caucasian"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + } }; const newHacker1 = { - "accountId": Util.Account.hackerAccounts.new[1]._id, - "school": "University of YIKES", - "degree": "PhD", - "gender": "Female", - "needsBus": true, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume100", - "github": "www.github.com/Person1", - "dropler": undefined, - "personal": "www.person1.com", - "linkedIn": "www.linkedin.com/in/Person1", - "other": undefined - }, - "jobInterest": "Full-time", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["African American"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, + accountId: Util.Account.hackerAccounts.new[1]._id, + application: { + general: { + school: "University of YIKES", + degree: "PhD", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Full-time", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume100", + github: "www.github.com/Person1", + dribbble: undefined, + personal: "www.person1.com", + linkedIn: "www.linkedin.com/in/Person1", + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["African American"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: true + } + } }; -// duplicate of newHack1, but with false for code of conduct +// duplicate of newHack0, but with false for code of conduct const invalidHacker0 = { - "accountId": Util.Account.hackerAccounts.invalid[0]._id, - "school": "University of ASDF", - "degree": "Masters", - "gender": "Female", - "needsBus": true, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume100", - "github": "www.github.com/Person1", - "dropler": undefined, - "personal": "www.person1.com", - "linkedIn": "www.linkedin.com/in/Person1", - "other": undefined - }, - "jobInterest": "Full-time", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["Caucasian"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": false, + accountId: Util.Account.hackerAccounts.invalid[0]._id, + application: { + general: { + school: "University of ASDF", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Full-time", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume100", + github: "www.github.com/Person1", + dribbble: undefined, + personal: "www.person1.com", + linkedIn: "www.linkedin.com/in/Person1", + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["Caucasian"], + codeOfConduct_MCHACKS: false, + codeOfConduct_MLH: false + }, + accomodation: { + needsBus: true + } + } }; const invalidHacker1 = { - "_id": mongoose.Types.ObjectId(), - // invalid mongoID - "accountId": Util.Account.hackerAccounts.invalid[1]._invalidId, - // invalid missing school attribute - "degree": "Undersaduate", - "gender": "Female", - "needsBus": true, - "application": { - // invalid portflio with no resume - "portfolioURL": {}, - // invalid jobInterest - "jobInterest": "ASDF", - }, - "ethnicity": ["Asian", "Caucasian"], - "major": ["CS"], - "graduationYear": 2020, - "codeOfConduct": true, + _id: mongoose.Types.ObjectId(), + // invalid mongoID + accountId: Util.Account.hackerAccounts.invalid[1]._invalidId, + application: { + general: { + // invalid missing school attribute + degree: "Undersaduate", + fieldOfStudy: ["EE"], + graduationYear: 2019, + // invalid job interest + jobInterest: "ASDF", + URL: { + // invalid URL links with no resume + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["Caucasian"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: true + } + } }; const duplicateAccountLinkHacker0 = { - "_id": mongoose.Types.ObjectId(), - "accountId": Util.Account.hackerAccounts.stored.team[0]._id, - "status": "Applied", - "school": "University of Blah", - "degree": "Undergraduate", - "gender": "Male", - "needsBus": true, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume100", - "github": "www.github.com/Person1", - "dropler": undefined, - "personal": "www.person1.com", - "linkedIn": "www.linkedin.com/in/Person1", - "other": undefined - }, - "jobInterest": "Full-time", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["Caucasian"], - "major": ["CS"], - "graduationYear": 2019, - "codeOfConduct": true, + _id: mongoose.Types.ObjectId(), + accountId: Util.Account.hackerAccounts.stored.team[0]._id, + status: "Applied", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["CS"], + graduationYear: 2019, + jobInterest: "Full-time", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume100", + github: "www.github.com/Person1", + dribbble: undefined, + personal: "www.person1.com", + linkedIn: "www.linkedin.com/in/Person1", + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Male", + ethnicity: ["Caucasian"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: true + } + } }; const waitlistedHacker0 = { - "_id": Constants.MongoId.hackerCId, - "accountId": Util.Account.waitlistedHacker0._id, - "status": "Waitlisted", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume2", - "github": "www.github.com/Personasdf", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, - "teamId": Constants.MongoId.team2Id, + _id: Constants.MongoId.hackerCId, + accountId: Util.Account.waitlistedHacker0._id, + status: "Waitlisted", + application: { + general: { + school: "University of Blah", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Intership", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume2", + github: "www.github.com/Personasdf", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + }, + teamId: Constants.MongoId.team2Id }; const unconfirmedAccountHacker0 = { - "_id": Constants.MongoId.hackerCId, - "accountId": Util.Account.NonConfirmedAccount3._id, - "status": "Waitlisted", - "school": "University of Blah1", - "degree": "Masters", - "gender": "Female", - "needsBus": false, - "application": { - "portfolioURL": { - //gcloud bucket link - "resume": "www.gcloud.com/myResume123", - "github": "www.github.com/Personasdf", - "dropler": undefined, - "personal": undefined, - "linkedIn": undefined, - "other": undefined - }, - "jobInterest": "Internship", - "skills": ["CSS", "HTML", "JS"], - }, - "ethnicity": ["European"], - "major": ["EE"], - "graduationYear": 2019, - "codeOfConduct": true, + _id: Constants.MongoId.hackerCId, + accountId: Util.Account.NonConfirmedAccount2._id, + status: "Waitlisted", + application: { + general: { + school: "University of Blah1", + degree: "Masters", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume123", + github: "www.github.com/Personasdf", + dribbble: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + } }; const Hackers = [ - TeamHacker0, - TeamHacker1, - TeamHacker2, - TeamHacker3, - TeamHacker4, + TeamHacker0, + TeamHacker1, + TeamHacker2, + TeamHacker3, + TeamHacker4, - NoTeamHacker0, + NoTeamHacker0, - duplicateAccountLinkHacker0, - waitlistedHacker0 + duplicateAccountLinkHacker0, + waitlistedHacker0 ]; module.exports = { - TeamHacker0: TeamHacker0, - TeamHacker1: TeamHacker1, - TeamHacker2: TeamHacker2, - TeamHacker3: TeamHacker3, - TeamHacker4: TeamHacker4, + TeamHacker0: TeamHacker0, + TeamHacker1: TeamHacker1, + TeamHacker2: TeamHacker2, + TeamHacker3: TeamHacker3, + TeamHacker4: TeamHacker4, - NoTeamHacker0: NoTeamHacker0, + NoTeamHacker0: NoTeamHacker0, - newHacker0: newHacker0, - newHacker1: newHacker1, + newHacker0: newHacker0, + newHacker1: newHacker1, - invalidHacker0: invalidHacker0, - invalidHacker1: invalidHacker1, + invalidHacker0: invalidHacker0, + invalidHacker1: invalidHacker1, - duplicateAccountLinkHacker0: duplicateAccountLinkHacker0, - waitlistedHacker0: waitlistedHacker0, - unconfirmedAccountHacker0: unconfirmedAccountHacker0, + duplicateAccountLinkHacker0: duplicateAccountLinkHacker0, + waitlistedHacker0: waitlistedHacker0, + unconfirmedAccountHacker0: unconfirmedAccountHacker0, - Hackers: Hackers, - storeAll: storeAll, - dropAll: dropAll + Hackers: Hackers, + storeAll: storeAll, + dropAll: dropAll }; function store(attributes) { - const hackerDocs = []; - const hackerIds = []; - for (var i = 0; i < attributes.length; i++) { - hackerDocs.push(new Hacker(attributes[i])); - hackerIds.push(attributes[i]._id); - } + const hackerDocs = []; + const hackerIds = []; + for (var i = 0; i < attributes.length; i++) { + hackerDocs.push(new Hacker(attributes[i])); + hackerIds.push(attributes[i]._id); + } - return Hacker.collection.insertMany(hackerDocs); + return Hacker.collection.insertMany(hackerDocs); } async function storeAll() { - await store(Hackers); + await store(Hackers); } async function dropAll() { - try { - await Hacker.collection.drop(); - } catch (e) { - if (e.code === 26) { - logger.info("namespace %s not found", Hacker.collection.name); - } else { - throw e; - } + try { + await Hacker.collection.drop(); + } catch (e) { + if (e.code === 26) { + logger.info("namespace %s not found", Hacker.collection.name); + } else { + throw e; } -} \ No newline at end of file + } +} From 28e4dbd088b80b7383b59df2025eba26a360e509 Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Sun, 1 Dec 2019 12:41:20 -0500 Subject: [PATCH 173/243] Don't worry about this for now --- tests/account.test.js | 1 - tests/hacker.test.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/account.test.js b/tests/account.test.js index 8acc1624..ace87f33 100644 --- a/tests/account.test.js +++ b/tests/account.test.js @@ -45,7 +45,6 @@ describe("GET user account", function() { .request(server.app) .get("/api/account/self") .end(function(err, res) { - console.log(res); res.should.have.status(401); res.should.be.json; res.body.should.have.property("message"); diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 28b45c4e..c77d27e5 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -415,7 +415,7 @@ describe("POST create hacker", function() { .type("application/json") .send(invalidHacker0) .end(function(err, res) { - console.log(res); + // console.log(res); res.should.have.status(422); res.should.be.json; res.body.should.have.property("message"); From bc244c43414dd7767c884b642f950cde6c7027e2 Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Sun, 1 Dec 2019 12:52:34 -0500 Subject: [PATCH 174/243] Changed names of statuses --- assets/email/statusEmail/Declined.hbs | 447 ++ .../{Cancelled.hbs => Withdrawn.hbs} | 0 constants/general.constant.js | 15 +- docs/api/api_data.js | 5890 ++++++++--------- docs/api/api_data.json | 2047 +++--- middlewares/hacker.middleware.js | 4 +- routes/api/hacker.js | 46 +- scripts/batch_scripts.py | 7 +- tests/hacker.test.js | 2 +- 9 files changed, 4657 insertions(+), 3801 deletions(-) create mode 100644 assets/email/statusEmail/Declined.hbs rename assets/email/statusEmail/{Cancelled.hbs => Withdrawn.hbs} (100%) diff --git a/assets/email/statusEmail/Declined.hbs b/assets/email/statusEmail/Declined.hbs new file mode 100644 index 00000000..8e511986 --- /dev/null +++ b/assets/email/statusEmail/Declined.hbs @@ -0,0 +1,447 @@ + + + + + + + We've got your application! + + + +
+ + + + +
+ + + + + + + + + + + +
+ + + + + +
+ Logo +
+ +
+ + + + + +
+

+ McHacks 6 Decision

+

+ Hi {{firstName}}, +

+ Thank you for applying to McHacks 6. We received a ton of great + applicants this year and are unfortunately unable to offer you a place + at McHacks 6 this year. +

+

+ Until next year, follow us on Facebook, + Twitter, + and Instagram + for important updates and news! If you have any + questions, feel free to reach out at contact@mchacks.ca. +

+

+
+ McHacks Team +
+ mchacks.ca +

+ +
+ +
+ + + +
+ +
+
+ + + \ No newline at end of file diff --git a/assets/email/statusEmail/Cancelled.hbs b/assets/email/statusEmail/Withdrawn.hbs similarity index 100% rename from assets/email/statusEmail/Cancelled.hbs rename to assets/email/statusEmail/Withdrawn.hbs diff --git a/constants/general.constant.js b/constants/general.constant.js index 01267922..b35861cc 100644 --- a/constants/general.constant.js +++ b/constants/general.constant.js @@ -11,8 +11,10 @@ const HACKER_STATUS_NONE = "None"; const HACKER_STATUS_APPLIED = "Applied"; const HACKER_STATUS_ACCEPTED = "Accepted"; const HACKER_STATUS_WAITLISTED = "Waitlisted"; +const HACKER_STATUS_DECLINED = "Declined"; + const HACKER_STATUS_CONFIRMED = "Confirmed"; -const HACKER_STATUS_CANCELLED = "Cancelled"; +const HACKER_STATUS_WITHDRAWN = "Withdrawn"; const HACKER_STATUS_CHECKED_IN = "Checked-in"; const HACKER_STATUSES = [ HACKER_STATUS_NONE, @@ -20,8 +22,9 @@ const HACKER_STATUSES = [ HACKER_STATUS_ACCEPTED, HACKER_STATUS_WAITLISTED, HACKER_STATUS_CONFIRMED, - HACKER_STATUS_CANCELLED, - HACKER_STATUS_CHECKED_IN + HACKER_STATUS_WITHDRAWN, + HACKER_STATUS_CHECKED_IN, + HACKER_STATUS_DECLINED ]; const SAMPLE_DIET_RESTRICTIONS = [ @@ -95,9 +98,10 @@ const EMAIL_SUBJECTS = {}; EMAIL_SUBJECTS[HACKER_STATUS_NONE] = `Application for ${HACKATHON_NAME} incomplete`; EMAIL_SUBJECTS[HACKER_STATUS_APPLIED] = `Thanks for applying to ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_ACCEPTED] = `Great update from ${HACKATHON_NAME}`; +EMAIL_SUBJECTS[HACKER_STATUS_DECLINED] = `Update from ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_WAITLISTED] = `Update from ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_CONFIRMED] = `Thanks for confirming your attendance to ${HACKATHON_NAME}`; -EMAIL_SUBJECTS[HACKER_STATUS_CANCELLED] = "Sorry to see you go"; +EMAIL_SUBJECTS[HACKER_STATUS_WITHDRAWN] = "Sorry to see you go"; EMAIL_SUBJECTS[HACKER_STATUS_CHECKED_IN] = `Welcome to ${HACKATHON_NAME}`; EMAIL_SUBJECTS[WEEK_OF] = `Welcome to ${HACKATHON_NAME}`; @@ -120,9 +124,10 @@ module.exports = { HACKER_STATUS_NONE: HACKER_STATUS_NONE, HACKER_STATUS_APPLIED: HACKER_STATUS_APPLIED, HACKER_STATUS_ACCEPTED: HACKER_STATUS_ACCEPTED, + HACKER_STATUS_DECLINED: HACKER_STATUS_DECLINED, HACKER_STATUS_WAITLISTED: HACKER_STATUS_WAITLISTED, HACKER_STATUS_CONFIRMED: HACKER_STATUS_CONFIRMED, - HACKER_STATUS_CANCELLED: HACKER_STATUS_CANCELLED, + HACKER_STATUS_WITHDRAWN: HACKER_STATUS_WITHDRAWN, HACKER_STATUS_CHECKED_IN: HACKER_STATUS_CHECKED_IN, HACKER_STATUSES: HACKER_STATUSES, REQUEST_TYPES: REQUEST_TYPES, diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 3bd69968..e212553e 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1,3086 +1,3086 @@ define({ "api": [{ - "type": "post", - "url": "/account/", - "title": "create a new account", - "name": "create", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "firstName", - "description": "

First name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "lastName", - "description": "

Last name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "pronoun", - "description": "

the pronoun of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "email", - "description": "

Email of the account.

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "dietaryRestrictions", - "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "password", - "description": "

The password of the account.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "birthDate", - "description": "

a Date parsable string.

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" - } - ], - "header": [{ - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/" + "type": "post", + "url": "/account/", + "title": "create a new account", + "name": "create", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "String", + "optional": false, + "field": "firstName", + "description": "

First name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "lastName", + "description": "

Last name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "pronoun", + "description": "

the pronoun of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "email", + "description": "

Email of the account.

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "dietaryRestrictions", + "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "shirtSize", + "description": "

Size of the shirt that the user will receive.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "password", + "description": "

The password of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "birthDate", + "description": "

a Date parsable string.

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "phoneNumber", + "description": "

the user's phone number, represented as a string.

" + } + ], + "header": [{ + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + }] + }, + "examples": [{ + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" }] }, - { - "type": "get", - "url": "/account/:id", - "title": "gets information from an account with mongoid ':id'", - "name": "getAccount", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" }] }, - { - "type": "get", - "url": "/account/invite", - "title": "Get all of the invites.", - "name": "getAllInvites", - "group": "Account", - "version": "0.0.8", - "description": "

Get all of the invites that currently exist in the database.

", - "success": { - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" + "examples": [{ + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" }] }, - { - "type": "post", - "url": "/account/invite", - "title": "invites a user to create an account with the specified accountType", - "name": "inviteAccount", - "group": "Account", - "version": "0.0.8", - "description": "

sends link with token to be used with the account/create route

", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "email", - "description": "

email of the account to be created and where to send the link

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "accountType", - "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

Error object

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - }] + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/" + }] + }, + { + "type": "get", + "url": "/account/:id", + "title": "gets information from an account with mongoid ':id'", + "name": "getAccount", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" }] }, - { - "type": "get", - "url": "/account/self", - "title": "get information about own account", - "name": "self", - "group": "Account", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty object

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/self" + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" }] }, - { - "type": "patch", - "url": "/account/:id", - "title": "update an account's information", - "name": "updateOneUser", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "firstName", - "description": "

First name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "lastName", - "description": "

Last name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "pronoun", - "description": "

the pronoun of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "email", - "description": "

Email of the account.

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "dietaryRestrictions", - "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "birthDate", - "description": "

a Date parsable string.

" - }, - { - "group": "body", - "type": "Number", - "optional": true, - "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" - } - ] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/:id" + }] + }, + { + "type": "get", + "url": "/account/invite", + "title": "Get all of the invites.", + "name": "getAllInvites", + "group": "Account", + "version": "0.0.8", + "description": "

Get all of the invites that currently exist in the database.

", + "success": { + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" }] }, - { - "type": "patch", - "url": "/auth/password/change", - "title": "change password for logged in user", - "name": "changePassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "oldPassword", - "description": "

The current password of the user

" - }, - { - "group": "Parameter", - "type": "String", - "optional": false, - "field": "newPassword", - "description": "

The new password of the user

" - } - ] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/invite" + }] + }, + { + "type": "post", + "url": "/account/invite", + "title": "invites a user to create an account with the specified accountType", + "name": "inviteAccount", + "group": "Account", + "version": "0.0.8", + "description": "

sends link with token to be used with the account/create route

", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "String", + "optional": true, + "field": "email", + "description": "

email of the account to be created and where to send the link

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "accountType", + "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] }, - "permission": [{ - "name": ": Must be logged in" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/change" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" }] }, - { - "type": "post", - "url": "/auth/confirm/:token", - "title": "confirm account using the JWT in :token", - "name": "confirmAccount", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

Error object

" + } + ] }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/:token" + "examples": [{ + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" }] }, - { - "type": "post", - "url": "/auth/password/forgot", - "title": "forgot password route", - "name": "forgotPassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - }] + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/invite" + }] + }, + { + "type": "get", + "url": "/account/self", + "title": "get information about own account", + "name": "self", + "group": "Account", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/forgot" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" }] }, - { - "type": "get", - "url": "/auth/rolebindings/:id", - "title": "retrieve rolebindings for a user given by their user id :id", - "name": "getRoleBindings", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Rolebindings object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty object

" + } + ] }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" }] }, - { - "type": "get", - "url": "/auth/roles", - "title": "get roles", - "name": "getRoles", - "description": "

get all roles that exist in the database

", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - }] + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/self" + }] + }, + { + "type": "patch", + "url": "/account/:id", + "title": "update an account's information", + "name": "updateOneUser", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "String", + "optional": true, + "field": "firstName", + "description": "

First name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "lastName", + "description": "

Last name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "pronoun", + "description": "

the pronoun of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "email", + "description": "

Email of the account.

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "dietaryRestrictions", + "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "shirtSize", + "description": "

Size of the shirt that the user will receive.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "birthDate", + "description": "

a Date parsable string.

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "phoneNumber", + "description": "

the user's phone number, represented as a string.

" + } + ] }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/roles" + "examples": [{ + "title": "Request-Example:", + "content": "{ \"shirtSize\": \"M\" }", + "type": "json" }] }, - { - "type": "post", - "url": "/auth/login", - "title": "login to the service", - "name": "login", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "string", - "optional": false, - "field": "email", - "description": "

Account email

" - }, - { - "group": "Parameter", - "type": "string", - "optional": false, - "field": "password", - "description": "

Account password

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/login" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" }] }, - { - "type": "get", - "url": "/auth/logout", - "title": "logout of service", - "name": "logout", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/logout" + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" }] }, - { - "type": "get", - "url": "/auth/confirm/resend", - "title": "resend confirmation token", - "name": "resendConfirmAccount", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - }] + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/account/:id" + }] + }, + { + "type": "patch", + "url": "/auth/password/change", + "title": "change password for logged in user", + "name": "changePassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "oldPassword", + "description": "

The current password of the user

" + }, + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "newPassword", + "description": "

The new password of the user

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", - "type": "json" - }, - { - "title": "Error-Response:", - "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", - "type": "json" - } - ] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/resend" + "examples": [{ + "title": "Request-Example:", + "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" }] }, - { - "type": "post", - "url": "/auth/password/reset", - "title": "reset password", - "name": "resetPassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - }] - }, - "header": { - "fields": { - "Header": [{ - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - }] - }, - "examples": [{ - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "permission": [{ - "name": ": must have authentication token" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/reset" + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" }] }, - { - "type": "patch", - "url": "/hacker/checkin/:id", - "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", - "name": "checkinHacker", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" + "permission": [{ + "name": ": Must be logged in" + }], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/password/change" + }] + }, + { + "type": "post", + "url": "/auth/confirm/:token", + "title": "confirm account using the JWT in :token", + "name": "confirmAccount", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" }, { - "name": "Volunteer" + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" } - ], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + ] + }, + "examples": [{ + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" }] }, - { - "type": "post", - "url": "/hacker/", - "title": "create a new hacker", - "name": "createHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

ObjectID of the respective account

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "school", - "description": "

Name of the school the hacker goes to

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "gender", - "description": "

Gender of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": false, - "field": "needsBus", - "description": "

Whether the hacker requires a bus for transportation

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "ethnicity", - "description": "

the ethnicities of the hacker

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "major", - "description": "

the major of the hacker

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "graduationYear", - "description": "

the graduation year of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": false, - "field": "codeOfConduct", - "description": "

acceptance of the code of conduct

" - }, - { - "group": "body", - "type": "Json", - "optional": false, - "field": "application", - "description": "

The hacker's application. Resume and jobInterest fields are required.

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/" + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" }] }, - { - "type": "get", - "url": "/hacker/email/:email", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + }] + }, + { + "type": "post", + "url": "/auth/password/forgot", + "title": "forgot password route", + "name": "forgotPassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + }] + }, + "examples": [{ + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" }] }, - { - "type": "get", - "url": "/hacker/:id", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" }] }, - { - "type": "get", - "url": "/hacker/resume:id", - "title": "get the resume for a hacker.", - "name": "getHackerResume", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }] - }, - "examples": [{ - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - }] - }, - "examples": [{ - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker" + "permission": [{ + "name": ": public" + }], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/password/forgot" + }] + }, + { + "type": "get", + "url": "/auth/rolebindings/:id", + "title": "retrieve rolebindings for a user given by their user id :id", + "name": "getRoleBindings", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + }] + } }, - { - "type": "get", - "url": "/hacker/stats", - "title": "Gets the stats of all of the hackers who have applied.", - "name": "getHackerStats", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "query": [{ - "group": "query", - "type": "String", - "optional": false, - "field": "model", - "description": "

the model to be searched (Only hacker supported)

" - }, - { - "group": "query", - "type": "Array", - "optional": false, - "field": "q", - "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Rolebindings object

" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/stats" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" }] }, - { - "type": "patch", - "url": "/hacker/:id", - "title": "update a hacker's information.", - "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", - "name": "patchHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "school", - "description": "

Name of the school the hacker goes to

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "gender", - "description": "

Gender of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": true, - "field": "needsBus", - "description": "

Whether the hacker requires a bus for transportation

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "ethnicity", - "description": "

the ethnicities of the hacker

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "major", - "description": "

the major of the hacker

" - }, - { - "group": "body", - "type": "Number", - "optional": true, - "field": "graduationYear", - "description": "

the graduation year of the hacker

" - }, - { - "group": "body", - "type": "Json", - "optional": true, - "field": "application", - "description": "

The hacker's application

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" }] }, - { - "type": "patch", - "url": "/hacker/confirmation/:id", - "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.", - "name": "patchHackerConfirmed", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + }] + }, + { + "type": "get", + "url": "/auth/roles", + "title": "get roles", + "name": "getRoles", + "description": "

get all roles that exist in the database

", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" }, { - "name": "Hacker" + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" } - ], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - }] - }, - { - "type": "patch", - "url": "/hacker/status/:id", - "title": "update a hacker's status", - "name": "patchHackerStatus", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - }] + ] }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/status/:id" + "examples": [{ + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" }] }, - { - "type": "post", - "url": "/hacker/resume/:id", - "title": "upload or update resume for a hacker.", - "name": "postHackerResume", - "group": "Hacker", - "version": "0.0.8", - "description": "

NOTE: This must be sent via multipart/form-data POST request

", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }], - "body": [{ - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Location in the bucket that the file was stored.

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - }] + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/roles" + }] + }, + { + "type": "post", + "url": "/auth/login", + "title": "login to the service", + "name": "login", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [{ + "group": "Parameter", + "type": "string", + "optional": false, + "field": "email", + "description": "

Account email

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "password", + "description": "

Account password

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/resume/:id" + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" }] }, - { - "type": "post", - "url": "/hacker/email/weekOf/:id", - "title": "", - "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", - "name": "postHackerSendWeekOfEmail", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" }] }, - { - "type": "post", - "url": "/hacker/email/weekOf/:id", - "title": "", - "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", - "name": "postHackerSendWeekOfEmail", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "permission": [{ + "name": ": public" + }], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/login" + }] + }, + { + "type": "get", + "url": "/auth/logout", + "title": "logout of service", + "name": "logout", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" }] }, - { - "type": "get", - "url": "/sponsor/self", - "title": "get information about logged in sponsor", - "name": "self", - "group": "Hacker", - "version": "1.4.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "permission": [{ + "name": ": public" + }], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/logout" + }] + }, + { + "type": "get", + "url": "/auth/confirm/resend", + "title": "resend confirmation token", + "name": "resendConfirmAccount", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "permission": [{ - "name": ": Sponsor" - }], - "filename": "routes/api/sponsor.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/self" + "examples": [{ + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" }] }, - { - "type": "get", - "url": "/hacker/self", - "title": "get information about own hacker", - "name": "self", - "group": "Hacker", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/self" + "examples": [{ + "title": "Error-Response:", + "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", + "type": "json" + }, + { + "title": "Error-Response:", + "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", + "type": "json" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + }] + }, + { + "type": "post", + "url": "/auth/password/reset", + "title": "reset password", + "name": "resetPassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [{ + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + }] + }, + "examples": [{ + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" }] }, - { - "type": "get", - "url": "/", - "title": "version", - "version": "0.0.8", - "name": "index", - "group": "Index", - "permission": [{ - "name": "public" - }], - "filename": "routes/index.js", - "groupTitle": "Index", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/" + "header": { + "fields": { + "Header": [{ + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + }] + }, + "examples": [{ + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" }] }, - { - "type": "post", - "url": "/api/role/", - "title": "create a new role", - "name": "createRole", - "group": "Role", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "name", - "description": "

Name of the route

" - }, - { - "group": "body", - "type": "Route[]", - "optional": false, - "field": "routes", - "description": "

The routes that this role gives access to

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Role object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/role.js", - "groupTitle": "Role", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/api/role/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" }] }, - { - "type": "get", - "url": "/search/", - "title": "provide a specific query for any defined model", - "name": "search", - "group": "Search", - "version": "0.0.8", - "parameter": { - "fields": { - "query": [{ - "group": "query", - "type": "String", - "optional": false, - "field": "model", - "description": "

the model to be searched

" - }, - { - "group": "query", - "type": "Array", - "optional": false, - "field": "q", - "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" - }, - { - "group": "query", - "type": "String", - "optional": false, - "field": "sort", - "description": "

either "asc" or "desc"

" - }, - { - "group": "query", - "type": "number", - "optional": false, - "field": "page", - "description": "

the page number that you would like

" - }, - { - "group": "query", - "type": "number", - "optional": false, - "field": "limit", - "description": "

the maximum number of results that you would like returned

" - }, - { - "group": "query", - "type": "any", - "optional": false, - "field": "sort_by", - "description": "

any parameter you want to sort the results by

" - }, - { - "group": "query", - "type": "boolean", - "optional": false, - "field": "expand", - "description": "

whether you want to expand sub documents within the results

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Results

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", - "type": "object" - }, - { - "title": "Success-Response:", - "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", - "type": "object" - } - ] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - }] + "permission": [{ + "name": ": must have authentication token" + }], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/auth/password/reset" + }] + }, + { + "type": "patch", + "url": "/hacker/checkin/:id", + "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", + "name": "checkinHacker", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/search.js", - "groupTitle": "Search", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/search/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" }] }, + "permission": [{ + "name": "Administrator" + }, { - "type": "get", - "url": "/settings/", - "title": "Get the settings for the current hackathon", - "name": "getSettings", - "group": "Settings", - "version": "1.1.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Settings Object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] + "name": "Volunteer" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + }] + }, + { + "type": "post", + "url": "/hacker/", + "title": "create a new hacker", + "name": "createHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "school", + "description": "

Name of the school the hacker goes to

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "gender", + "description": "

Gender of the hacker

" + }, + { + "group": "body", + "type": "Boolean", + "optional": false, + "field": "needsBus", + "description": "

Whether the hacker requires a bus for transportation

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, + { + "group": "body", + "type": "Boolean", + "optional": false, + "field": "codeOfConduct", + "description": "

acceptance of the code of conduct

" + }, + { + "group": "body", + "type": "Json", + "optional": false, + "field": "application", + "description": "

The hacker's application. Resume and jobInterest fields are required.

" + } + ] }, - "permission": [{ - "name": "public" - }], - "filename": "routes/api/settings.js", - "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" + "examples": [{ + "title": "application: ", + "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", + "type": "Json" }] }, - { - "type": "patch", - "url": "/settings/", - "title": "Patch the settings for the current hackathon", - "name": "patchSettings", - "group": "Settings", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "Date", - "optional": true, - "field": "openTime", - "description": "

The opening time for the hackathon.

" - }, - { - "group": "body", - "type": "Date", - "optional": true, - "field": "closeTime", - "description": "

The closing time for the hackathon.

" - }, - { - "group": "body", - "type": "Date", - "optional": true, - "field": "confirmTime", - "description": "

The deadline for confirmation for the hackathon.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Settings Object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "permission": [{ - "name": "Administrators" - }], - "filename": "routes/api/settings.js", - "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", + "type": "object" }] }, - { - "type": "post", - "url": "/sponsor/", - "title": "create a new sponsor", - "name": "createSponsor", - "group": "Sponsor", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

ObjectID of the respective account.

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "tier", - "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "company", - "description": "

Name of the company.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "contractURL", - "description": "

URL link to the contract with the company.

" - }, - { - "group": "body", - "type": "MongoID[]", - "optional": false, - "field": "nominees", - "description": "

Array of accounts that the company wish to nominate as hackers.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/" + }] + }, + { + "type": "get", + "url": "/hacker/email/:email", + "title": "get a hacker's information", + "name": "getHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" }] }, - { - "type": "get", - "url": "/sponsor/:id", - "title": "get a sponsor's information", - "name": "getSponsor", - "group": "Sponsor", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/:email" + }] + }, + { + "type": "get", + "url": "/hacker/:id", + "title": "get a hacker's information", + "name": "getHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/:id" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" }] }, - { - "type": "patch", - "url": "/sponsor/", - "title": "update a sponsor", - "name": "patchSponsor", - "group": "Sponsor", - "version": "1.3.0", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - }], - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "company", - "description": "

Name of the company.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "contractURL", - "description": "

URL link to the contract with the company.

" - }, - { - "group": "body", - "type": "ObjectId[]", - "optional": false, - "field": "nominees", - "description": "

Array of accounts that the company wish to nominate as hackers.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/:id" + }] + }, + { + "type": "get", + "url": "/hacker/resume:id", + "title": "get the resume for a hacker.", + "name": "getHackerResume", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }] + }, + "examples": [{ + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", + "type": "json" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + }] + }, + "examples": [{ + "title": "Error-Response:", + "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", + "type": "json" + }] + }, + "permission": [{ + "name": "Must be logged in, and the account id must be linked to the hacker." + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker" + }, + { + "type": "get", + "url": "/hacker/stats", + "title": "Gets the stats of all of the hackers who have applied.", + "name": "getHackerStats", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "query": [{ + "group": "query", + "type": "String", + "optional": false, + "field": "model", + "description": "

the model to be searched (Only hacker supported)

" + }, + { + "group": "query", + "type": "Array", + "optional": false, + "field": "q", + "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" }] }, - { - "type": "post", - "url": "/team/", - "title": "create a new team consisting of only the logged in user", - "name": "createTeam", - "group": "Team", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "name", - "description": "

Name of the team.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "devpostURL", - "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "projectName", - "description": "

Name of the team.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/stats" + }] + }, + { + "type": "patch", + "url": "/hacker/:id", + "title": "update a hacker's information.", + "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", + "name": "patchHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "String", + "optional": true, + "field": "school", + "description": "

Name of the school the hacker goes to

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "gender", + "description": "

Gender of the hacker

" + }, + { + "group": "body", + "type": "Boolean", + "optional": true, + "field": "needsBus", + "description": "

Whether the hacker requires a bus for transportation

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, + { + "group": "body", + "type": "Json", + "optional": true, + "field": "application", + "description": "

The hacker's application

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "application: ", + "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", + "type": "Json" + }] + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", + "type": "object" }] }, - { - "type": "patch", - "url": "/team/leave/", - "title": "Allows a logged in hacker to leave current team", - "name": "deleteSelfFromTeam", - "group": "Team", - "version": "1.1.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

{}

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/:id" + }] + }, + { + "type": "patch", + "url": "/hacker/confirmation/:id", + "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", + "name": "patchHackerConfirmed", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/leave/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" }] }, + "permission": [{ + "name": "Administrator" + }, { - "type": "get", - "url": "/team/:id", - "title": "get a team's information", - "name": "getTeam", - "group": "Team", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - }] + "name": "Hacker" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + }] + }, + { + "type": "patch", + "url": "/hacker/status/:id", + "title": "update a hacker's status", + "name": "patchHackerStatus", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Declined"|"Confirmed"|"Withdrawn"|"Checked-in")

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "Administrator" + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/status/:id" + }] + }, + { + "type": "post", + "url": "/hacker/resume/:id", + "title": "upload or update resume for a hacker.", + "name": "postHackerResume", + "group": "Hacker", + "version": "0.0.8", + "description": "

NOTE: This must be sent via multipart/form-data POST request

", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + }], + "body": [{ + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Location in the bucket that the file was stored.

" + } + ] }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:id" + "examples": [{ + "title": "Success-Response: ", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" }] }, - { - "type": "patch", - "url": "/team/join/", - "title": "Allows a logged in hacker to join a team by name", - "name": "patchJoinTeam", - "group": "Team", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

{}

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "permission": [{ + "name": "Must be logged in, and the account id must be linked to the hacker." + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + }] + }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/join/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" }] }, - { - "type": "patch", - "url": "/team/:hackerId", - "title": "Update a team's information. The team is specified by the hacker belonging to it.", - "name": "patchTeam", - "group": "Team", - "version": "0.0.8", - "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - }] + "permission": [{ + "name": "Administrator" + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + }] + }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Query input that caused the error.

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - }] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "Administrator" + }], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + }] + }, + { + "type": "get", + "url": "/sponsor/self", + "title": "get information about logged in sponsor", + "name": "self", + "group": "Hacker", + "version": "1.4.1", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:hackerId" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" }] }, - { - "type": "post", - "url": "/volunteer/", - "title": "create a new volunteer", - "name": "createVolunteer", - "group": "Volunteer", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Volunteer object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + }] + }, + "permission": [{ + "name": ": Sponsor" + }], + "filename": "routes/api/sponsor.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/self" + }] + }, + { + "type": "get", + "url": "/hacker/self", + "title": "get information about own hacker", + "name": "self", + "group": "Hacker", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] }, - "filename": "routes/api/volunteer.js", - "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/" + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" }] }, - { - "type": "get", - "url": "/volunteer/:id", - "title": "get a volunteer's information", - "name": "getVolunteer", - "group": "Volunteer", - "version": "1.3.0", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Volunteer object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - }] + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - }] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/hacker/self" + }] + }, + { + "type": "get", + "url": "/", + "title": "version", + "version": "0.0.8", + "name": "index", + "group": "Index", + "permission": [{ + "name": "public" + }], + "filename": "routes/index.js", + "groupTitle": "Index", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/" + }] + }, + { + "type": "post", + "url": "/api/role/", + "title": "create a new role", + "name": "createRole", + "group": "Role", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "String", + "optional": false, + "field": "name", + "description": "

Name of the route

" + }, + { + "group": "body", + "type": "Route[]", + "optional": false, + "field": "routes", + "description": "

The routes that this role gives access to

" + } + ] }, - "filename": "routes/api/volunteer.js", - "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/:id" + "examples": [{ + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" }] - } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Role object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/role.js", + "groupTitle": "Role", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/api/role/" + }] + }, + { + "type": "get", + "url": "/search/", + "title": "provide a specific query for any defined model", + "name": "search", + "group": "Search", + "version": "0.0.8", + "parameter": { + "fields": { + "query": [{ + "group": "query", + "type": "String", + "optional": false, + "field": "model", + "description": "

the model to be searched

" + }, + { + "group": "query", + "type": "Array", + "optional": false, + "field": "q", + "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + }, + { + "group": "query", + "type": "String", + "optional": false, + "field": "sort", + "description": "

either "asc" or "desc"

" + }, + { + "group": "query", + "type": "number", + "optional": false, + "field": "page", + "description": "

the page number that you would like

" + }, + { + "group": "query", + "type": "number", + "optional": false, + "field": "limit", + "description": "

the maximum number of results that you would like returned

" + }, + { + "group": "query", + "type": "any", + "optional": false, + "field": "sort_by", + "description": "

any parameter you want to sort the results by

" + }, + { + "group": "query", + "type": "boolean", + "optional": false, + "field": "expand", + "description": "

whether you want to expand sub documents within the results

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Results

" + } + ] + }, + "examples": [{ + "title": "Success-Response:", + "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", + "type": "object" + }, + { + "title": "Success-Response:", + "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/search.js", + "groupTitle": "Search", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/search/" + }] + }, + { + "type": "get", + "url": "/settings/", + "title": "Get the settings for the current hackathon", + "name": "getSettings", + "group": "Settings", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "public" + }], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/settings/" + }] + }, + { + "type": "patch", + "url": "/settings/", + "title": "Patch the settings for the current hackathon", + "name": "patchSettings", + "group": "Settings", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "Date", + "optional": true, + "field": "openTime", + "description": "

The opening time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "closeTime", + "description": "

The closing time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "confirmTime", + "description": "

The deadline for confirmation for the hackathon.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + }] + }, + "permission": [{ + "name": "Administrators" + }], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/settings/" + }] + }, + { + "type": "post", + "url": "/sponsor/", + "title": "create a new sponsor", + "name": "createSponsor", + "group": "Sponsor", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account.

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "tier", + "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "company", + "description": "

Name of the company.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "contractURL", + "description": "

URL link to the contract with the company.

" + }, + { + "group": "body", + "type": "MongoID[]", + "optional": false, + "field": "nominees", + "description": "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/" + }] + }, + { + "type": "get", + "url": "/sponsor/:id", + "title": "get a sponsor's information", + "name": "getSponsor", + "group": "Sponsor", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/:id" + }] + }, + { + "type": "patch", + "url": "/sponsor/", + "title": "update a sponsor", + "name": "patchSponsor", + "group": "Sponsor", + "version": "1.3.0", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + }], + "body": [{ + "group": "body", + "type": "String", + "optional": false, + "field": "company", + "description": "

Name of the company.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "contractURL", + "description": "

URL link to the contract with the company.

" + }, + { + "group": "body", + "type": "ObjectId[]", + "optional": false, + "field": "nominees", + "description": "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/sponsor/" + }] + }, + { + "type": "post", + "url": "/team/", + "title": "create a new team consisting of only the logged in user", + "name": "createTeam", + "group": "Team", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "String", + "optional": false, + "field": "name", + "description": "

Name of the team.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "devpostURL", + "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "projectName", + "description": "

Name of the team.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/" + }] + }, + { + "type": "patch", + "url": "/team/leave/", + "title": "Allows a logged in hacker to leave current team", + "name": "deleteSelfFromTeam", + "group": "Team", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

{}

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", + "type": "object" + }] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/leave/" + }] + }, + { + "type": "get", + "url": "/team/:id", + "title": "get a team's information", + "name": "getTeam", + "group": "Team", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/:id" + }] + }, + { + "type": "patch", + "url": "/team/join/", + "title": "Allows a logged in hacker to join a team by name", + "name": "patchJoinTeam", + "group": "Team", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

{}

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", + "type": "object" + }] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/join/" + }] + }, + { + "type": "patch", + "url": "/team/:hackerId", + "title": "Update a team's information. The team is specified by the hacker belonging to it.", + "name": "patchTeam", + "group": "Team", + "version": "0.0.8", + "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Query input that caused the error.

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + }] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/team/:hackerId" + }] + }, + { + "type": "post", + "url": "/volunteer/", + "title": "create a new volunteer", + "name": "createVolunteer", + "group": "Volunteer", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [{ + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Volunteer object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/volunteer.js", + "groupTitle": "Volunteer", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/volunteer/" + }] + }, + { + "type": "get", + "url": "/volunteer/:id", + "title": "get a volunteer's information", + "name": "getVolunteer", + "group": "Volunteer", + "version": "1.3.0", + "parameter": { + "fields": { + "param": [{ + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + }] + } + }, + "success": { + "fields": { + "Success 200": [{ + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Volunteer object

" + } + ] + }, + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + }] + }, + "error": { + "fields": { + "Error 4xx": [{ + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + }] + }, + "filename": "routes/api/volunteer.js", + "groupTitle": "Volunteer", + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/volunteer/:id" + }] + } ] }); \ No newline at end of file diff --git a/docs/api/api_data.json b/docs/api/api_data.json index b6d16068..8fc73702 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1,4 +1,5 @@ -[{ +[ + { "type": "post", "url": "/account/", "title": "create a new account", @@ -7,7 +8,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -71,23 +73,28 @@ "description": "

the user's phone number, represented as a string.

" } ], - "header": [{ - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - }] + "header": [ + { + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -103,15 +110,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -127,17 +137,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/" + } + ] }, { "type": "get", @@ -148,18 +162,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -175,15 +192,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -199,17 +219,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] }, { "type": "get", @@ -220,17 +244,21 @@ "version": "0.0.8", "description": "

Get all of the invites that currently exist in the database.

", "success": { - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] }, { "type": "post", @@ -242,7 +270,8 @@ "description": "

sends link with token to be used with the account/create route

", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -261,7 +290,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -277,15 +307,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -301,17 +334,21 @@ } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] }, { "type": "get", @@ -322,7 +359,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -338,15 +376,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -362,17 +403,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/self" + } + ] }, { "type": "patch", @@ -383,7 +428,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -441,15 +487,18 @@ } ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"shirtSize\": \"M\" }", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -465,15 +514,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -489,17 +541,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/account.js", "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] }, { "type": "patch", @@ -510,7 +566,8 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ + "Parameter": [ + { "group": "Parameter", "type": "String", "optional": false, @@ -526,15 +583,18 @@ } ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -550,20 +610,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": Must be logged in" - }], + "permission": [ + { + "name": ": Must be logged in" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/change" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/change" + } + ] }, { "type": "post", @@ -574,18 +640,21 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -601,15 +670,18 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -625,17 +697,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/:token" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] }, { "type": "post", @@ -646,23 +722,28 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + } + ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -678,20 +759,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/forgot" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/forgot" + } + ] }, { "type": "get", @@ -702,18 +789,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -729,15 +819,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -753,17 +846,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] }, { "type": "get", @@ -775,7 +872,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -791,17 +889,21 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" + } + ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/roles" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/roles" + } + ] }, { "type": "post", @@ -812,7 +914,8 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ + "Parameter": [ + { "group": "Parameter", "type": "string", "optional": false, @@ -831,7 +934,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -847,15 +951,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -871,20 +978,26 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/login" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/login" + } + ] }, { "type": "get", @@ -895,7 +1008,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -911,20 +1025,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": public" - }], + "permission": [ + { + "name": ": public" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/logout" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/logout" + } + ] }, { "type": "get", @@ -935,7 +1055,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -951,15 +1072,18 @@ } ] }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -975,7 +1099,8 @@ } ] }, - "examples": [{ + "examples": [ + { "title": "Error-Response:", "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", "type": "json" @@ -989,9 +1114,11 @@ }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/resend" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] }, { "type": "post", @@ -1002,39 +1129,48 @@ "version": "0.0.8", "parameter": { "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - }] + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + } + ] }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - }] + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" + } + ] }, "header": { "fields": { - "Header": [{ - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - }] + "Header": [ + { + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + } + ] }, - "examples": [{ - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - }] + "examples": [ + { + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1050,20 +1186,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] }, - "permission": [{ - "name": ": must have authentication token" - }], + "permission": [ + { + "name": ": must have authentication token" + } + ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/reset" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/reset" + } + ] }, { "type": "patch", @@ -1074,18 +1216,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1101,13 +1246,16 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ + "permission": [ + { "name": "Administrator" }, { @@ -1116,9 +1264,11 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] }, { "type": "post", @@ -1129,7 +1279,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "MongoID", "optional": false, @@ -1194,15 +1345,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1218,15 +1372,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -1242,17 +1399,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/" + } + ] }, { "type": "get", @@ -1263,18 +1424,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - }] + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1290,15 +1454,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1314,17 +1481,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/:email" + } + ] }, { "type": "get", @@ -1335,18 +1506,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1362,15 +1536,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1386,17 +1563,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] }, { "type": "get", @@ -1407,50 +1588,62 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ] } }, "success": { "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }] + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + } + ] }, - "examples": [{ - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", + "type": "json" + } + ] }, "error": { "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - }] - }, - "examples": [{ - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker" }, @@ -1463,7 +1656,8 @@ "version": "0.0.9", "parameter": { "fields": { - "query": [{ + "query": [ + { "group": "query", "type": "String", "optional": false, @@ -1482,7 +1676,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1498,17 +1693,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/stats" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/stats" + } + ] }, { "type": "patch", @@ -1520,7 +1719,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": true, @@ -1571,15 +1771,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1595,15 +1798,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -1619,39 +1825,46 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] }, { "type": "patch", "url": "/hacker/confirmation/:id", - "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'.", + "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", "name": "patchHackerConfirmed", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Cancelled"

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1667,13 +1880,16 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ + "permission": [ + { "name": "Administrator" }, { @@ -1682,9 +1898,11 @@ ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] }, { "type": "patch", @@ -1695,18 +1913,21 @@ "version": "0.0.9", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in")

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Declined"|"Confirmed"|"Withdrawn"|"Checked-in")

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1722,20 +1943,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/status/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/status/:id" + } + ] }, { "type": "post", @@ -1747,25 +1974,30 @@ "description": "

NOTE: This must be sent via multipart/form-data POST request

", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }], - "body": [{ - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ], + "body": [ + { + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1781,20 +2013,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" + } + ] }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/resume/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] }, { "type": "post", @@ -1806,18 +2044,21 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1833,20 +2074,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] }, { "type": "post", @@ -1858,18 +2105,21 @@ "version": "0.0.9", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1885,20 +2135,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrator" - }], + "permission": [ + { + "name": "Administrator" + } + ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] }, { "type": "get", @@ -1909,7 +2165,8 @@ "version": "1.4.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -1925,15 +2182,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -1949,20 +2209,26 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] }, - "permission": [{ - "name": ": Sponsor" - }], + "permission": [ + { + "name": ": Sponsor" + } + ], "filename": "routes/api/sponsor.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/self" + } + ] }, { "type": "get", @@ -1973,7 +2239,8 @@ "version": "0.0.8", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -1989,15 +2256,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2013,17 +2283,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/self" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/self" + } + ] }, { "type": "get", @@ -2032,14 +2306,18 @@ "version": "0.0.8", "name": "index", "group": "Index", - "permission": [{ - "name": "public" - }], + "permission": [ + { + "name": "public" + } + ], "filename": "routes/index.js", "groupTitle": "Index", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/" + } + ] }, { "type": "post", @@ -2050,7 +2328,8 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2066,15 +2345,18 @@ } ] }, - "examples": [{ - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - }] + "examples": [ + { + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" + } + ] }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2090,15 +2372,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2114,17 +2399,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/role.js", "groupTitle": "Role", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/api/role/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/api/role/" + } + ] }, { "type": "get", @@ -2135,7 +2424,8 @@ "version": "0.0.8", "parameter": { "fields": { - "query": [{ + "query": [ + { "group": "query", "type": "String", "optional": false, @@ -2189,7 +2479,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2205,7 +2496,8 @@ } ] }, - "examples": [{ + "examples": [ + { "title": "Success-Response:", "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", "type": "object" @@ -2219,7 +2511,8 @@ }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2235,17 +2528,21 @@ } ] }, - "examples": [{ - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/search.js", "groupTitle": "Search", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/search/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/search/" + } + ] }, { "type": "get", @@ -2256,7 +2553,8 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2272,20 +2570,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "public" - }], + "permission": [ + { + "name": "public" + } + ], "filename": "routes/api/settings.js", "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] }, { "type": "patch", @@ -2296,7 +2600,8 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "Date", "optional": true, @@ -2322,7 +2627,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2338,20 +2644,26 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", + "type": "object" + } + ] }, - "permission": [{ - "name": "Administrators" - }], + "permission": [ + { + "name": "Administrators" + } + ], "filename": "routes/api/settings.js", "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] }, { "type": "post", @@ -2362,7 +2674,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "MongoID", "optional": false, @@ -2402,7 +2715,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2418,15 +2732,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2442,17 +2759,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] }, { "type": "get", @@ -2463,18 +2784,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2490,15 +2814,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2514,17 +2841,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/:id" + } + ] }, { "type": "patch", @@ -2535,14 +2866,17 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - }], - "body": [{ + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + } + ], + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2568,7 +2902,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2584,15 +2919,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2608,17 +2946,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] }, { "type": "post", @@ -2629,7 +2971,8 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ + "body": [ + { "group": "body", "type": "String", "optional": false, @@ -2655,7 +2998,8 @@ }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2671,15 +3015,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2695,17 +3042,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/" + } + ] }, { "type": "patch", @@ -2716,7 +3067,8 @@ "version": "1.1.1", "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2732,17 +3084,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/leave/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/leave/" + } + ] }, { "type": "get", @@ -2753,18 +3109,21 @@ "version": "0.0.8", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2780,15 +3139,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2804,17 +3166,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:id" + } + ] }, { "type": "patch", @@ -2825,18 +3191,21 @@ "version": "1.1.1", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - }] + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2852,17 +3221,21 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/join/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/join/" + } + ] }, { "type": "patch", @@ -2874,18 +3247,21 @@ "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -2901,15 +3277,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -2925,17 +3304,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + } + ] }, "filename": "routes/api/team.js", "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:hackerId" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:hackerId" + } + ] }, { "type": "post", @@ -2946,18 +3329,21 @@ "version": "0.0.8", "parameter": { "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - }] + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "string", "optional": false, @@ -2973,15 +3359,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "string", "optional": false, @@ -2997,17 +3386,21 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/" + } + ] }, { "type": "get", @@ -3018,18 +3411,21 @@ "version": "1.3.0", "parameter": { "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - }] + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + } + ] } }, "success": { "fields": { - "Success 200": [{ + "Success 200": [ + { "group": "Success 200", "type": "String", "optional": false, @@ -3045,15 +3441,18 @@ } ] }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - }] + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + } + ] }, "error": { "fields": { - "Error 4xx": [{ + "Error 4xx": [ + { "group": "Error 4xx", "type": "String", "optional": false, @@ -3069,16 +3468,20 @@ } ] }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - }] + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + } + ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/:id" - }] + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/:id" + } + ] } ] \ No newline at end of file diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 93b49ca3..eefcebb3 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -99,7 +99,7 @@ function parseCheckIn(req, res, next) { * @param {(err?)=>void} next * @return {void} * @description - * Changes req.body.status to confirmed or cancelled depending on whether req.body.confirm is true or false respectively. + * Changes req.body.status to confirmed or withdrawn depending on whether req.body.confirm is true or false respectively. * Deletes req.body.confirm afterwards */ function parseConfirmation(req, res, next) { @@ -108,7 +108,7 @@ function parseConfirmation(req, res, next) { if (confirm) { req.body.status = Constants.General.HACKER_STATUS_CONFIRMED; } else { - req.body.status = Constants.General.HACKER_STATUS_CANCELLED; + req.body.status = Constants.General.HACKER_STATUS_WITHDRAWN; } delete req.body.confirm; diff --git a/routes/api/hacker.js b/routes/api/hacker.js index b0289e35..56119776 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -23,7 +23,7 @@ const Services = { const CONSTANTS = require("../../constants/general.constant"); module.exports = { - activate: function(apiRouter) { + activate: function (apiRouter) { const hackerRouter = express.Router(); /** @@ -205,15 +205,15 @@ module.exports = { * */ hackerRouter.route("/stats").get( - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.statsValidator, - Middleware.parseBody.middleware, - Middleware.Search.setExpandTrue, - Middleware.Search.parseQuery, - Middleware.Search.executeQuery, - Middleware.Hacker.getStats, - Controllers.Hacker.gotStats + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized(), + Middleware.Validator.Hacker.statsValidator, + Middleware.parseBody.middleware, + Middleware.Search.setExpandTrue, + Middleware.Search.parseQuery, + Middleware.Search.executeQuery, + Middleware.Hacker.getStats, + Controllers.Hacker.gotStats ); /** @@ -222,7 +222,7 @@ module.exports = { * @apiGroup Hacker * @apiVersion 0.0.9 * - * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Confirmed"|"Cancelled"|"Checked-in") + * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Accepted"|"Declined"|"Confirmed"|"Withdrawn"|"Checked-in") * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object * @apiSuccessExample {object} Success-Response: @@ -235,15 +235,15 @@ module.exports = { * @apiPermission Administrator */ hackerRouter.route("/status/:id").patch( - Middleware.Validator.RouteParam.idValidator, - Middleware.Auth.ensureAuthenticated(), - Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), - Middleware.Validator.Hacker.updateStatusValidator, - Middleware.parseBody.middleware, - Middleware.Hacker.parsePatch, - Middleware.Hacker.updateHacker, - Middleware.Hacker.sendStatusUpdateEmail, - Controllers.Hacker.updatedHacker + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + Middleware.Validator.Hacker.updateStatusValidator, + Middleware.parseBody.middleware, + Middleware.Hacker.parsePatch, + Middleware.Hacker.updateHacker, + Middleware.Hacker.sendStatusUpdateEmail, + Controllers.Hacker.updatedHacker ); /** @@ -553,12 +553,12 @@ module.exports = { /** * @api {patch} /hacker/confirmation/:id - * Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'cancelled'. + * Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'. * @apiName patchHackerConfirmed * @apiGroup Hacker * @apiVersion 0.0.9 * - * @apiParam (body) {string} [status] The new status of the hacker. "Accepted", "Confirmed", or "Cancelled" + * @apiParam (body) {string} [status] The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn" * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object * @apiSuccessExample {object} Success-Response: @@ -583,7 +583,7 @@ module.exports = { Middleware.Hacker.checkStatus([ CONSTANTS.HACKER_STATUS_ACCEPTED, CONSTANTS.HACKER_STATUS_CONFIRMED, - CONSTANTS.HACKER_STATUS_CANCELLED + CONSTANTS.HACKER_STATUS_WITHDRAWN ]), Middleware.Hacker.parseConfirmation, diff --git a/scripts/batch_scripts.py b/scripts/batch_scripts.py index cedeef75..a93dc290 100644 --- a/scripts/batch_scripts.py +++ b/scripts/batch_scripts.py @@ -16,9 +16,10 @@ '1': 'Applied', '2': 'Accepted', '3': 'Waitlisted', - '4': 'Confirmed', - '5': 'Cancelled', - '6': 'Checked-in' + '4': 'Declined', + '5': 'Confirmed', + '6': 'Withdrawn', + '7': 'Checked-in' } BATCH_ACTIONS = { '1': 'updateStatus', diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 2953af27..86530fb4 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -733,7 +733,7 @@ describe("PATCH update one hacker", function () { res.body.message.should.equal(Constants.Success.HACKER_UPDATE); res.body.should.have.property("data"); chai.assert.equal(JSON.stringify(res.body.data), JSON.stringify({ - status: Constants.General.HACKER_STATUS_CANCELLED + status: Constants.General.HACKER_STATUS_WITHDRAWN })); done(); From 4761b9e2644f6dfcd49f40333299d700d3b0c43a Mon Sep 17 00:00:00 2001 From: Harsh Patel Date: Mon, 2 Dec 2019 21:44:11 -0500 Subject: [PATCH 175/243] Addressed code review changes --- constants/general.constant.js | 1 - routes/api/hacker.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/constants/general.constant.js b/constants/general.constant.js index b35861cc..850479c3 100644 --- a/constants/general.constant.js +++ b/constants/general.constant.js @@ -12,7 +12,6 @@ const HACKER_STATUS_APPLIED = "Applied"; const HACKER_STATUS_ACCEPTED = "Accepted"; const HACKER_STATUS_WAITLISTED = "Waitlisted"; const HACKER_STATUS_DECLINED = "Declined"; - const HACKER_STATUS_CONFIRMED = "Confirmed"; const HACKER_STATUS_WITHDRAWN = "Withdrawn"; const HACKER_STATUS_CHECKED_IN = "Checked-in"; diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 56119776..414816c9 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -222,7 +222,7 @@ module.exports = { * @apiGroup Hacker * @apiVersion 0.0.9 * - * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Accepted"|"Declined"|"Confirmed"|"Withdrawn"|"Checked-in") + * @apiParam (body) {string} [status] Status of the hacker's application ("None"|"Applied"|"Accepted"|"Declined"|"Waitlisted"|"Confirmed"|"Withdrawn"|"Checked-in") * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object * @apiSuccessExample {object} Success-Response: From d1deb7dee0918f6294dc1de8af2c5e33ecbe8616 Mon Sep 17 00:00:00 2001 From: Loreina Chew Date: Mon, 2 Dec 2019 22:51:36 -0500 Subject: [PATCH 176/243] Force fix hacker route --- routes/api/hacker.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 05e2f28e..0a845d96 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -617,14 +617,10 @@ module.exports = { Middleware.parseBody.middleware, Middleware.Hacker.findById, -<<<<<<< HEAD Middleware.Hacker.checkStatus([ CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CHECKED_IN ]), -======= - Middleware.Hacker.checkStatus([CONSTANTS.HACKER_STATUS_CONFIRMED, CONSTANTS.HACKER_STATUS_CHECKED_IN]), ->>>>>>> master Middleware.Hacker.sendWeekOfEmail, Controllers.Hacker.sentWeekOfEmail ); From 36fd99710c1e65cb91d4a52ec2ccdbe6b4e25ad3 Mon Sep 17 00:00:00 2001 From: Loreina Chew Date: Mon, 2 Dec 2019 22:57:33 -0500 Subject: [PATCH 177/243] Match npm scripts with dashboard (#602) * Format code * Match start script with dashboard as dev mode * Match build script with dashboard as production mode * Update pr template * Update pr template --- .../PULL_REQUEST_TEMPLATE.md | 26 +++-- package.json | 100 +++++++++--------- 2 files changed, 67 insertions(+), 59 deletions(-) rename PULL_REQUEST_TEMPLATE.md => .github/PULL_REQUEST_TEMPLATE.md (86%) diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 86% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md index 0720d9ee..27e70dd7 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,8 +1,12 @@ -# Description +### Tickets: + +- HCK- + +### List of changes: Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -Fixes # (issue) +- ## Type of change @@ -11,9 +15,10 @@ Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] New release - [ ] This change requires a documentation update -# How Has This Been Tested? +### How has this been tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration @@ -21,18 +26,21 @@ Please describe the tests that you ran to verify your changes. Provide instructi - [ ] Test B **Test Configuration**: -* Firmware version: -* Hardware: -* Toolchain: -* SDK: -# Checklist: +**Firmware version:** +**Hardware:** +**Toolchain:** +**SDK:** + +### Questions for code reviewers? + +### Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes +- [ ] I have made corresponding changes to the documentation - [ ] Any dependent changes have been merged and published in downstream modules diff --git a/package.json b/package.json index e745de4a..2c9c1d1e 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,52 @@ { - "name": "hackboard", - "version": "0.0.0", - "private": true, - "scripts": { - "start": "NODE_ENV=deployment node ./bin/www.js", - "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", - "development": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", - "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", - "seed": "NODE_ENV=development node ./seed/index.js", - "docs": "apidoc -i ./routes -o ./docs/api/" - }, - "dependencies": { - "@google-cloud/logging-winston": "^0.11.1", - "@google-cloud/storage": "^3.5.0", - "@sendgrid/mail": "^6.4.0", - "bcrypt": "^3.0.6", - "cookie-parser": "~1.4.4", - "cookie-session": "^2.0.0-beta.3", - "cors": "^2.8.5", - "cryptiles": "^4.1.3", - "debug": "~4.1.1", - "dotenv": "^8.2.0", - "express": "~4.17.1", - "express-validator": "^6.2.0", - "express-winston": "^2.6.0", - "handlebars": "^4.4.3", - "jsonwebtoken": "^8.5.1", - "memory-cache": "^0.2.0", - "mongoose": "^5.7.5", - "multer": "^1.4.2", - "passport": "^0.4.0", - "passport-local": "^1.0.0", - "q": "^1.5.1", - "qrcode": "^1.4.2", - "winston": "^2.4.4" - }, - "devDependencies": { - "@types/express": "^4.17.1", - "@types/google-cloud__storage": "^1.7.2", - "@types/mongodb": "^3.3.1", - "@types/mongoose": "^5.5.21", - "@types/multer": "^1.3.10", - "apidoc": "^0.17.7", - "chai": "^4.2.0", - "chai-http": "^4.3.0", - "jshint": "^2.10.2", - "jslint": "^0.12.1", - "mocha": "^6.2.1", - "nodemon": "^1.19.4" - } + "name": "hackboard", + "version": "0.0.0", + "private": true, + "scripts": { + "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js", + "build": "NODE_ENV=deployment node ./bin/www.js", + "debug": "DEBUG=hackboard:* NODE_ENV=deployment nodemon --ignore gcp_creds.json ./bin/www.js", + "test": "DEBUG=hackboard:* NODE_ENV=test mocha --reporter spec tests/**.js --exit", + "seed": "NODE_ENV=development node ./seed/index.js", + "docs": "apidoc -i ./routes -o ./docs/api/" + }, + "dependencies": { + "@google-cloud/logging-winston": "^0.11.1", + "@google-cloud/storage": "^3.5.0", + "@sendgrid/mail": "^6.4.0", + "bcrypt": "^3.0.6", + "cookie-parser": "~1.4.4", + "cookie-session": "^2.0.0-beta.3", + "cors": "^2.8.5", + "cryptiles": "^4.1.3", + "debug": "~4.1.1", + "dotenv": "^8.2.0", + "express": "~4.17.1", + "express-validator": "^6.2.0", + "express-winston": "^2.6.0", + "handlebars": "^4.4.3", + "jsonwebtoken": "^8.5.1", + "memory-cache": "^0.2.0", + "mongoose": "^5.7.5", + "multer": "^1.4.2", + "passport": "^0.4.0", + "passport-local": "^1.0.0", + "q": "^1.5.1", + "qrcode": "^1.4.2", + "winston": "^2.4.4" + }, + "devDependencies": { + "@types/express": "^4.17.1", + "@types/google-cloud__storage": "^1.7.2", + "@types/mongodb": "^3.3.1", + "@types/mongoose": "^5.5.21", + "@types/multer": "^1.3.10", + "apidoc": "^0.17.7", + "chai": "^4.2.0", + "chai-http": "^4.3.0", + "jshint": "^2.10.2", + "jslint": "^0.12.1", + "mocha": "^6.2.1", + "nodemon": "^1.19.4" + } } From 3d5d6790c585e3c3a7753c34f43ac2ce00db4f69 Mon Sep 17 00:00:00 2001 From: Loreina Chew Date: Mon, 2 Dec 2019 23:05:54 -0500 Subject: [PATCH 178/243] Add travis notifs on slack (#606) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80b04f0d..9e3ca997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js dist: trusty sudo: false -services: +services: - mongodb before_install: - npm i -g npm@6.4.0 @@ -17,4 +17,4 @@ branches: - develop notifications: - slack: hackboard6:4baCeRXUOQmvy4ZBAHQclN6K + slack: hackboard7:Yt0nW0DyaF85eTOxceBLptU1 From 3496bd62a3d6de38cc923a3efad48f3ef78f1354 Mon Sep 17 00:00:00 2001 From: logan-r Date: Tue, 3 Dec 2019 18:38:34 -0500 Subject: [PATCH 179/243] Remove t-shirt size field from account and add gender field --- docs/api/api_data.js | 28 ++++++++++----------- middlewares/account.middleware.js | 4 +-- middlewares/validators/account.validator.js | 4 +-- models/account.model.js | 9 +++---- routes/api/account.js | 22 ++++++++-------- tests/account.test.js | 2 +- 6 files changed, 34 insertions(+), 35 deletions(-) diff --git a/docs/api/api_data.js b/docs/api/api_data.js index e212553e..14807297 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -27,7 +27,7 @@ define({ "type": "String", "optional": false, "field": "pronoun", - "description": "

the pronoun of the account creator.

" + "description": "

The pronoun of the account creator.

" }, { "group": "body", @@ -47,8 +47,8 @@ define({ "group": "body", "type": "String", "optional": false, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" + "field": "gender", + "description": "

The gender of the account creator.

" }, { "group": "body", @@ -82,7 +82,7 @@ define({ }, "examples": [{ "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"male\",\n \"birthDate\":\"10/30/1997\"\n}", "type": "json" }] }, @@ -106,7 +106,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, @@ -178,7 +178,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, @@ -341,7 +341,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, @@ -403,7 +403,7 @@ define({ "type": "String", "optional": true, "field": "pronoun", - "description": "

the pronoun of the account creator.

" + "description": "

The pronoun of the account creator.

" }, { "group": "body", @@ -423,28 +423,28 @@ define({ "group": "body", "type": "String", "optional": true, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" + "field": "gender", + "description": "

The gender of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "birthDate", - "description": "

a Date parsable string.

" + "description": "

A Date parsable string.

" }, { "group": "body", "type": "Number", "optional": true, "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" + "description": "

The user's phone number, represented as a string.

" } ] }, "examples": [{ "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", + "content": "{ \"email\": \"aFakeEmail@aol.com\" }", "type": "json" }] }, @@ -468,7 +468,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"aFakeEmail@aol.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, diff --git a/middlewares/account.middleware.js b/middlewares/account.middleware.js index cb609b7a..b3ec1345 100644 --- a/middlewares/account.middleware.js +++ b/middlewares/account.middleware.js @@ -52,7 +52,7 @@ function parseAccount(req, res, next) { email: req.body.email, password: Services.Account.hashPassword(req.body.password), dietaryRestrictions: req.body.dietaryRestrictions, - shirtSize: req.body.shirtSize, + gender: req.body.gender, birthDate: req.body.birthDate, phoneNumber: req.body.phoneNumber, }; @@ -63,7 +63,7 @@ function parseAccount(req, res, next) { delete req.body.email; delete req.body.password; delete req.body.dietaryRestrictions; - delete req.body.shirtSize; + delete req.body.gender; delete req.body.birthDate; delete req.body.phoneNumber; diff --git a/middlewares/validators/account.validator.js b/middlewares/validators/account.validator.js index a1c86932..ff89bf5b 100644 --- a/middlewares/validators/account.validator.js +++ b/middlewares/validators/account.validator.js @@ -9,7 +9,7 @@ module.exports = { VALIDATOR.stringValidator("body", "pronoun", false), VALIDATOR.regexValidator("body", "email", false, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", false), - VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, false), + VALIDATOR.enumValidator("body", "gender", false), VALIDATOR.passwordValidator("body", "password", false), VALIDATOR.jwtValidator("header", "token", process.env.JWT_CONFIRM_ACC_SECRET, true), VALIDATOR.dateValidator("body", "birthDate", false), @@ -21,7 +21,7 @@ module.exports = { VALIDATOR.stringValidator("body", "pronoun", true), VALIDATOR.regexValidator("body", "email", true, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", true), - VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, true), + VALIDATOR.enumValidator("body", "gender", true), VALIDATOR.dateValidator("body", "birthDate", true), VALIDATOR.phoneNumberValidator("body", "phoneNumber", true) ], diff --git a/models/account.model.js b/models/account.model.js index db5e24ec..f568d6c2 100644 --- a/models/account.model.js +++ b/models/account.model.js @@ -16,6 +16,10 @@ const AccountSchema = new mongoose.Schema({ type: String, default: "Prefer not to say", }, + gender: { + type: String, + default: "Prefer not to say", + }, email: { type: String, trim: true, @@ -31,11 +35,6 @@ const AccountSchema = new mongoose.Schema({ dietaryRestrictions: [{ type: String }], - shirtSize: { - type: String, - enum: Constants.SHIRT_SIZES, - required: true - }, confirmed: { type: Boolean, default: false diff --git a/routes/api/account.js b/routes/api/account.js index 88366da1..bf142505 100644 --- a/routes/api/account.js +++ b/routes/api/account.js @@ -43,7 +43,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "shirtSize":"S", + "gender":"male", "birthDate":Date("10/30/1997") } } @@ -71,7 +71,7 @@ module.exports = { * @apiParam (body) {String} pronoun the pronoun of the account creator. * @apiParam (body) {String} email Email of the account. * @apiParam (body) {String[]} dietaryRestrictions Any dietary restrictions for the user. 'None' if there are no restrictions - * @apiParam (body) {String} shirtSize Size of the shirt that the user will receive. + * @apiParam (body) {String} gender Gender of the account creator. * @apiParam (body) {String} password The password of the account. * @apiParam (body) {String} birthDate a Date parsable string. * @apiParam (body) {Number} phoneNumber the user's phone number, represented as a string. @@ -86,7 +86,7 @@ module.exports = { "password":"hunter2", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "shirtSize":"S", + "gender":"male", "birthDate":"10/30/1997" * } * @@ -103,7 +103,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "shirtSize":"S", + "gender":"male", "birthDate":Date("10/30/1997") } } @@ -208,15 +208,15 @@ module.exports = { * * @apiParam (body) {String} [firstName] First name of the account creator. * @apiParam (body) {String} [lastName] Last name of the account creator. - * @apiParam (body) {String} [pronoun] the pronoun of the account creator. + * @apiParam (body) {String} [pronoun] The pronoun of the account creator. * @apiParam (body) {String} [email] Email of the account. * @apiParam (body) {String[]} [dietaryRestrictions] Any dietary restrictions for the user. 'None' if there are no restrictions - * @apiParam (body) {String} [shirtSize] Size of the shirt that the user will receive. - * @apiParam (body) {String} [birthDate] a Date parsable string. - * @apiParam (body) {Number} [phoneNumber] the user's phone number, represented as a string. + * @apiParam (body) {String} [gender] Gender of the account creator. + * @apiParam (body) {String} [birthDate] A Date parsable string. + * @apiParam (body) {Number} [phoneNumber] The user's phone number, represented as a string. * @apiParamExample {json} Request-Example: - * { "shirtSize": "M" } + * { "gender": "aFakeEmail@aol.com" } * * @apiSuccess {string} message Success message @@ -232,7 +232,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "shirtSize":"M", + "shirtSize":"aFakeEmail@aol.com", "birthDate":Date("10/30/1997") } } @@ -280,7 +280,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "shirtSize":"S", + "gender":"male", "birthDate":Date("10/30/1997") } } diff --git a/tests/account.test.js b/tests/account.test.js index b99c1cef..c1d0ae5a 100644 --- a/tests/account.test.js +++ b/tests/account.test.js @@ -91,7 +91,7 @@ describe("GET user account", function () { res.body.data.should.have.property("lastName"); res.body.data.should.have.property("email"); res.body.data.should.have.property("dietaryRestrictions"); - res.body.data.should.have.property("shirtSize"); + res.body.data.should.have.property("gender"); done(); }); }); From 61120d5005240499eb57763b1b5da55e2148a911 Mon Sep 17 00:00:00 2001 From: logan-r Date: Tue, 3 Dec 2019 21:19:50 -0500 Subject: [PATCH 180/243] Fix bug with wrong validator for being used for gender --- docs/api/api_data.json | 18 +++++++++--------- middlewares/validators/account.validator.js | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api/api_data.json b/docs/api/api_data.json index 8fc73702..1f8ee426 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -48,8 +48,8 @@ "group": "body", "type": "String", "optional": false, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" + "field": "gender", + "description": "

The gender of the account creator.

" }, { "group": "body", @@ -86,7 +86,7 @@ "examples": [ { "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":\"10/30/1997\"\n}", "type": "json" } ] @@ -113,7 +113,7 @@ "examples": [ { "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] @@ -195,7 +195,7 @@ "examples": [ { "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] @@ -379,7 +379,7 @@ "examples": [ { "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] @@ -468,8 +468,8 @@ "group": "body", "type": "String", "optional": true, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" + "field": "gender", + "description": "

The gender of the account creator.

" }, { "group": "body", @@ -517,7 +517,7 @@ "examples": [ { "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] diff --git a/middlewares/validators/account.validator.js b/middlewares/validators/account.validator.js index ff89bf5b..7ebef149 100644 --- a/middlewares/validators/account.validator.js +++ b/middlewares/validators/account.validator.js @@ -9,7 +9,7 @@ module.exports = { VALIDATOR.stringValidator("body", "pronoun", false), VALIDATOR.regexValidator("body", "email", false, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", false), - VALIDATOR.enumValidator("body", "gender", false), + VALIDATOR.stringValidator("body", "gender", false), VALIDATOR.passwordValidator("body", "password", false), VALIDATOR.jwtValidator("header", "token", process.env.JWT_CONFIRM_ACC_SECRET, true), VALIDATOR.dateValidator("body", "birthDate", false), @@ -21,7 +21,7 @@ module.exports = { VALIDATOR.stringValidator("body", "pronoun", true), VALIDATOR.regexValidator("body", "email", true, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", true), - VALIDATOR.enumValidator("body", "gender", true), + VALIDATOR.stringValidator("body", "gender", true), VALIDATOR.dateValidator("body", "birthDate", true), VALIDATOR.phoneNumberValidator("body", "phoneNumber", true) ], From dc24a1a6d2d4e370d5de52439ebbe0e38ea6b8b8 Mon Sep 17 00:00:00 2001 From: logan-r Date: Wed, 4 Dec 2019 00:35:36 -0500 Subject: [PATCH 181/243] Fix typo in doc --- docs/api/api_data.js | 10 +++++----- routes/api/account.js | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 14807297..a80cdee0 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -82,7 +82,7 @@ define({ }, "examples": [{ "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"male\",\n \"birthDate\":\"10/30/1997\"\n}", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":\"10/30/1997\"\n}", "type": "json" }] }, @@ -106,7 +106,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, @@ -178,7 +178,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, @@ -341,7 +341,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, @@ -468,7 +468,7 @@ define({ }, "examples": [{ "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"aFakeEmail@aol.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"aFakeEmail@aol.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" }] }, diff --git a/routes/api/account.js b/routes/api/account.js index bf142505..87996024 100644 --- a/routes/api/account.js +++ b/routes/api/account.js @@ -43,7 +43,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "gender":"male", + "gender":"Male", "birthDate":Date("10/30/1997") } } @@ -86,7 +86,7 @@ module.exports = { "password":"hunter2", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "gender":"male", + "gender":"Male", "birthDate":"10/30/1997" * } * @@ -103,7 +103,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "gender":"male", + "gender":"Male", "birthDate":Date("10/30/1997") } } @@ -280,7 +280,7 @@ module.exports = { "email":"theo@klein.com", "dietaryRestrictions":["Halal"], "phoneNumber":1234567890, - "gender":"male", + "gender":"Male", "birthDate":Date("10/30/1997") } } From 8bd4545979fa681cd4fbe4710737d8e81e786c9f Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Wed, 4 Dec 2019 15:02:36 -0500 Subject: [PATCH 182/243] Fixing tests --- middlewares/hacker.middleware.js | 2 +- routes/api/hacker.js | 2 +- tests/hacker.test.js | 5 +-- tests/util/hacker.test.util.js | 55 ++++++++++++++++++++------------ 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 645bdc38..baefabeb 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -487,7 +487,6 @@ function checkStatus(statuses) { * @param {*} next */ async function updateHacker(req, res, next) { - console.log("does it reach?"); const hacker = await Services.Hacker.updateOne(req.params.id, req.body); if (hacker) { const acct = await Services.Account.findById(hacker.accountId); @@ -524,6 +523,7 @@ async function updateHacker(req, res, next) { * Creates hacker document after making sure there is no other hacker with the same linked accountId */ async function createHacker(req, res, next) { + console.log("here we are"); const hackerDetails = req.body.hackerDetails; const exists = await Services.Hacker.findByAccountId(hackerDetails.accountId); diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 9496d41e..cd7fbe5c 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -179,7 +179,6 @@ module.exports = { hackerRouter.route("/").post( Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized(), - Middleware.Validator.Hacker.newHackerValidator, Middleware.parseBody.middleware, @@ -194,6 +193,7 @@ module.exports = { Middleware.Auth.createRoleBindings(CONSTANTS.HACKER), Middleware.Hacker.createHacker, Middleware.Hacker.sendAppliedStatusEmail, + Controllers.Hacker.createdHacker ); diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 03c42bc6..516f52de 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -28,6 +28,7 @@ const volunteerAccount0 = util.account.volunteerAccounts.stored[0]; const newHackerAccount0 = util.account.hackerAccounts.new[0]; const newHacker0 = util.hacker.newHacker0; +const invalidHackerAccount0 = util.account.hackerAccounts.invalid[0]; const invalidHacker0 = util.hacker.invalidHacker0; const newHacker1 = util.hacker.newHacker1; @@ -421,7 +422,7 @@ describe("POST create hacker", function() { .type("application/json") .send(invalidHacker0) .end(function(err, res) { - // console.log(res); + console.log(res.body); res.should.have.status(422); res.should.be.json; res.body.should.have.property("message"); @@ -801,7 +802,7 @@ describe("PATCH update one hacker", function() { chai.assert.equal( JSON.stringify(res.body.data), JSON.stringify({ - status: Constants.General.HACKER_STATUS_CANCELLED + status: Constants.General.HACKER_STATUS_WITHDRAWN }) ); diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index ac9866e6..a575a6f5 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -317,6 +317,7 @@ const newHacker1 = { // duplicate of newHack0, but with false for code of conduct const invalidHacker0 = { + _id: mongoose.Types.ObjectId(), accountId: Util.Account.hackerAccounts.invalid[0]._id, application: { general: { @@ -343,6 +344,7 @@ const invalidHacker0 = { other: { gender: "Female", ethnicity: ["Caucasian"], + // must accept code of conduct to be valid codeOfConduct_MCHACKS: false, codeOfConduct_MLH: false }, @@ -504,27 +506,38 @@ const unconfirmedAccountHacker1 = { _id: Constants.MongoId.hackerHId, accountId: Util.Account.hackerAccounts.stored.unconfirmed[0]._id, status: "Accepted", - school: "University of Blah2", - degree: "Underggraduate", - gender: "Female", - needsBus: false, application: { - portfolioURL: { - //gcloud bucket link - resume: "www.gcloud.com/myResume123", - github: "www.github.com/Personasdf", - dropler: undefined, - personal: undefined, - linkedIn: undefined, - other: undefined - }, - jobInterest: "Internship", - skills: ["CSS", "HTML", "JS"] - }, - ethnicity: ["European"], - major: ["EE"], - graduationYear: 2019, - codeOfConduct: true + general: { + school: "University of Blah2", + degree: "Underggraduate", + fieldOfStudy: ["EE"], + graduationYear: 2019, + jobInterest: "Internship", + URL: { + //gcloud bucket link + resume: "www.gcloud.com/myResume123", + github: "www.github.com/Personasdf", + dropler: undefined, + personal: undefined, + linkedIn: undefined, + other: undefined + } + }, + shortAnswer: { + skills: ["CSS", "HTML", "JS"], + question1: "a", + question2: "a" + }, + other: { + gender: "Female", + ethnicity: ["European"], + codeOfConduct_MCHACKS: true, + codeOfConduct_MLH: true + }, + accomodation: { + needsBus: false + } + } }; const Hackers = [ @@ -535,6 +548,8 @@ const Hackers = [ TeamHacker4, NoTeamHacker0, + + invalidHacker0, unconfirmedAccountHacker1, duplicateAccountLinkHacker0, From 4b5e06e99b10fff0bfb96e21636eb349288ae2c8 Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Thu, 5 Dec 2019 20:57:52 -0500 Subject: [PATCH 183/243] Who knows what is going on with this test now? --- controllers/hacker.controller.js | 2 +- middlewares/hacker.middleware.js | 2 +- models/hacker.model.js | 3 ++- tests/hacker.test.js | 2 +- tests/util/hacker.test.util.js | 5 ++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/controllers/hacker.controller.js b/controllers/hacker.controller.js index cecd9449..77ec15d5 100644 --- a/controllers/hacker.controller.js +++ b/controllers/hacker.controller.js @@ -64,7 +64,7 @@ function downloadedResume(req, res) { message: Constants.Success.RESUME_DOWNLOAD, data: { id: req.body.id, - resume: req.body.gcfilename + resume: req.body.resume } }); } diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index baefabeb..0fe477bc 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -248,7 +248,7 @@ function ensureAccountLinkedToHacker(req, res, next) { * @param {(err?)=>void} next */ async function uploadResume(req, res, next) { - const gcfilename = `resume/${Date.now()}-${req.hacker.id}`; + const gcfilename = `resumes/${Date.now()}-${req.hacker.id}`; await Services.Storage.upload(req.file, gcfilename); req.body.gcfilename = gcfilename; await Services.Hacker.updateOne(req.hacker.id, { diff --git a/models/hacker.model.js b/models/hacker.model.js index f977b3ec..97bb9143 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -44,7 +44,8 @@ const HackerSchema = new mongoose.Schema({ URL: { //gcloud bucket link resume: { - type: String + type: String, + default: "" }, github: { type: String diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 516f52de..0662307a 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -412,7 +412,7 @@ describe("POST create hacker", function() { // should fail due to 'false' on code of conduct it("should FAIL if the new hacker does not accept code of conduct", function(done) { - util.auth.login(agent, Admin0, error => { + util.auth.login(agent, newHacker0, error => { if (error) { agent.close(); return done(error); diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index a575a6f5..debf5cc3 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -317,7 +317,6 @@ const newHacker1 = { // duplicate of newHack0, but with false for code of conduct const invalidHacker0 = { - _id: mongoose.Types.ObjectId(), accountId: Util.Account.hackerAccounts.invalid[0]._id, application: { general: { @@ -363,7 +362,7 @@ const invalidHacker1 = { // invalid missing school attribute degree: "Undersaduate", fieldOfStudy: ["EE"], - graduationYear: 2019, + graduationYear: 2020, // invalid job interest jobInterest: "ASDF", URL: { @@ -394,7 +393,7 @@ const duplicateAccountLinkHacker0 = { application: { general: { school: "University of Blah", - degree: "Masters", + degree: "Undergraduate", fieldOfStudy: ["CS"], graduationYear: 2019, jobInterest: "Full-time", From c1693699fc97a3139e16e682ba94d8135d1c2c52 Mon Sep 17 00:00:00 2001 From: RohitGarudadri Date: Thu, 5 Dec 2019 22:12:18 -0500 Subject: [PATCH 184/243] Ignore this --- middlewares/hacker.middleware.js | 1 - tests/hacker.test.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 0fe477bc..6a115ac6 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -523,7 +523,6 @@ async function updateHacker(req, res, next) { * Creates hacker document after making sure there is no other hacker with the same linked accountId */ async function createHacker(req, res, next) { - console.log("here we are"); const hackerDetails = req.body.hackerDetails; const exists = await Services.Hacker.findByAccountId(hackerDetails.accountId); diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 0662307a..146eef24 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -412,7 +412,7 @@ describe("POST create hacker", function() { // should fail due to 'false' on code of conduct it("should FAIL if the new hacker does not accept code of conduct", function(done) { - util.auth.login(agent, newHacker0, error => { + util.auth.login(agent, Admin0, error => { if (error) { agent.close(); return done(error); @@ -422,7 +422,6 @@ describe("POST create hacker", function() { .type("application/json") .send(invalidHacker0) .end(function(err, res) { - console.log(res.body); res.should.have.status(422); res.should.be.json; res.body.should.have.property("message"); From 15e980d324e6cab99dcfafe1b3afd904214e95c7 Mon Sep 17 00:00:00 2001 From: Loreina Chew Date: Thu, 5 Dec 2019 22:29:42 -0500 Subject: [PATCH 185/243] Switch to eslint and prettier for code formatting (#607) * delete jshint and jslint * add eslint * add eslint ignore * add prettier * update eslint * add prettier config * add vscode settings * add format and lint scripts * remove eslint rules * update prettier ignore * update eslint ignore * update eslint config * run eslint * run prettier * update settings * run prettier --- .eslintignore | 1 + .eslintrc | 19 + .jshintrc | 91 - .prettierignore | 1 + .prettierrc | 8 + .vscode/settings.json | 13 +- app.js | 35 +- bin/www.js | 34 +- constants/error.constant.js | 5 +- constants/general.constant.js | 53 +- constants/role.constant.js | 77 +- constants/routes.constant.js | 231 +- constants/success.constant.js | 9 +- constants/testMongoId.constant.js | 4 +- controllers/account.controller.js | 9 +- controllers/auth.controller.js | 22 +- controllers/hacker.controller.js | 9 +- controllers/role.controller.js | 6 +- controllers/search.controller.js | 2 +- controllers/settings.controller.js | 6 +- controllers/sponsor.controller.js | 6 +- controllers/team.controller.js | 24 +- controllers/volunteer.controller.js | 9 +- docs/api/api_data.js | 6706 +++++++++-------- docs/api/api_project.js | 30 +- docs/api/locales/ca.js | 42 +- docs/api/locales/cs.js | 44 +- docs/api/locales/de.js | 42 +- docs/api/locales/es.js | 42 +- docs/api/locales/fr.js | 42 +- docs/api/locales/it.js | 43 +- docs/api/locales/locale.js | 51 +- docs/api/locales/nl.js | 42 +- docs/api/locales/pl.js | 42 +- docs/api/locales/pt_br.js | 44 +- docs/api/locales/ro.js | 42 +- docs/api/locales/ru.js | 42 +- docs/api/locales/tr.js | 42 +- docs/api/locales/vi.js | 42 +- docs/api/locales/zh.js | 42 +- docs/api/locales/zh_cn.js | 44 +- docs/api/main.js | 702 +- docs/api/utils/handlebars_helper.js | 259 +- docs/api/utils/send_sample_request.js | 382 +- docs/api/vendor/bootstrap.min.js | 1899 ++++- docs/api/vendor/diff_match_patch.min.js | 1134 ++- docs/api/vendor/handlebars.min.js | 5309 ++++++++++++- docs/api/vendor/jquery.min.js | 5744 +++++++++++++- docs/api/vendor/list.min.js | 1123 ++- docs/api/vendor/lodash.custom.min.js | 1319 +++- docs/api/vendor/path-to-regexp/index.js | 247 +- docs/api/vendor/polyfill.js | 157 +- docs/api/vendor/prettify/lang-Splus.js | 37 +- docs/api/vendor/prettify/lang-aea.js | 33 +- docs/api/vendor/prettify/lang-agc.js | 33 +- docs/api/vendor/prettify/lang-apollo.js | 33 +- docs/api/vendor/prettify/lang-basic.js | 27 +- docs/api/vendor/prettify/lang-cbm.js | 27 +- docs/api/vendor/prettify/lang-cl.js | 34 +- docs/api/vendor/prettify/lang-clj.js | 22 +- docs/api/vendor/prettify/lang-css.js | 46 +- docs/api/vendor/prettify/lang-dart.js | 37 +- docs/api/vendor/prettify/lang-el.js | 34 +- docs/api/vendor/prettify/lang-erl.js | 30 +- docs/api/vendor/prettify/lang-erlang.js | 30 +- docs/api/vendor/prettify/lang-fs.js | 35 +- docs/api/vendor/prettify/lang-go.js | 19 +- docs/api/vendor/prettify/lang-hs.js | 31 +- docs/api/vendor/prettify/lang-lasso.js | 40 +- docs/api/vendor/prettify/lang-lassoscript.js | 40 +- docs/api/vendor/prettify/lang-latex.js | 17 +- docs/api/vendor/prettify/lang-lgt.js | 32 +- docs/api/vendor/prettify/lang-lisp.js | 34 +- docs/api/vendor/prettify/lang-ll.js | 18 +- docs/api/vendor/prettify/lang-llvm.js | 18 +- docs/api/vendor/prettify/lang-logtalk.js | 32 +- docs/api/vendor/prettify/lang-ls.js | 40 +- docs/api/vendor/prettify/lang-lsp.js | 34 +- docs/api/vendor/prettify/lang-lua.js | 31 +- docs/api/vendor/prettify/lang-matlab.js | 103 +- docs/api/vendor/prettify/lang-ml.js | 35 +- docs/api/vendor/prettify/lang-mumps.js | 27 +- docs/api/vendor/prettify/lang-n.js | 54 +- docs/api/vendor/prettify/lang-nemerle.js | 54 +- docs/api/vendor/prettify/lang-pascal.js | 28 +- docs/api/vendor/prettify/lang-proto.js | 10 +- docs/api/vendor/prettify/lang-r.js | 37 +- docs/api/vendor/prettify/lang-rd.js | 17 +- docs/api/vendor/prettify/lang-rkt.js | 34 +- docs/api/vendor/prettify/lang-rust.js | 60 +- docs/api/vendor/prettify/lang-s.js | 37 +- docs/api/vendor/prettify/lang-scala.js | 40 +- docs/api/vendor/prettify/lang-scm.js | 34 +- docs/api/vendor/prettify/lang-sql.js | 25 +- docs/api/vendor/prettify/lang-ss.js | 34 +- docs/api/vendor/prettify/lang-swift.js | 42 +- docs/api/vendor/prettify/lang-tcl.js | 34 +- docs/api/vendor/prettify/lang-tex.js | 17 +- docs/api/vendor/prettify/lang-vb.js | 49 +- docs/api/vendor/prettify/lang-vbs.js | 49 +- docs/api/vendor/prettify/lang-vhd.js | 34 +- docs/api/vendor/prettify/lang-vhdl.js | 34 +- docs/api/vendor/prettify/lang-wiki.js | 31 +- docs/api/vendor/prettify/lang-xq.js | 37 +- docs/api/vendor/prettify/lang-xquery.js | 37 +- docs/api/vendor/prettify/lang-yaml.js | 23 +- docs/api/vendor/prettify/lang-yml.js | 23 +- docs/api/vendor/prettify/prettify.js | 922 ++- docs/api/vendor/prettify/run_prettify.js | 1124 ++- docs/api/vendor/require.min.js | 1142 ++- docs/api/vendor/semver.min.js | 890 ++- docs/api/vendor/webfontloader.js | 846 ++- middlewares/account.middleware.js | 78 +- middlewares/auth.middleware.js | 326 +- middlewares/hacker.middleware.js | 245 +- middlewares/parse-body.middleware.js | 16 +- middlewares/role.middleware.js | 20 +- middlewares/search.middleware.js | 10 +- middlewares/settings.middleware.js | 30 +- middlewares/sponsor.middleware.js | 61 +- middlewares/team.middleware.js | 55 +- middlewares/util.middleware.js | 9 +- middlewares/validators/account.validator.js | 30 +- middlewares/validators/auth.validator.js | 16 +- middlewares/validators/hacker.validator.js | 28 +- middlewares/validators/role.validator.js | 9 +- .../validators/routeParam.validator.js | 14 +- middlewares/validators/search.validator.js | 4 +- middlewares/validators/settings.validator.js | 6 +- middlewares/validators/sponsor.validator.js | 22 +- middlewares/validators/team.validator.js | 22 +- middlewares/validators/validator.helper.js | 648 +- middlewares/validators/volunteer.validator.js | 4 +- middlewares/volunteer.middleware.js | 42 +- models/account.model.js | 34 +- models/accountConfirmationToken.model.js | 11 +- models/bus.model.js | 14 +- models/hacker.model.js | 40 +- models/passwordResetToken.model.js | 10 +- models/role.model.js | 24 +- models/roleBinding.model.js | 16 +- models/settings.model.js | 4 +- models/sponsor.model.js | 14 +- models/staff.model.js | 4 +- models/team.model.js | 18 +- models/volunteer.model.js | 4 +- package-lock.json | 3659 +++++---- package.json | 12 +- routes/api/account.js | 36 +- routes/api/auth.js | 31 +- routes/api/hacker.js | 35 +- routes/api/role.js | 8 +- routes/api/search.js | 24 +- routes/api/settings.js | 26 +- routes/api/team.js | 6 +- routes/index.js | 6 +- seed/index.js | 16 +- seed/roles.seed.js | 4 +- services/account.service.js | 23 +- services/accountConfirmation.service.js | 68 +- services/auth.service.js | 58 +- services/database.service.js | 81 +- services/email.service.js | 68 +- services/env.service.js | 30 +- services/hacker.service.js | 82 +- services/logger.service.js | 24 +- services/resetPassword.service.js | 79 +- services/role.service.js | 17 +- services/roleBinding.service.js | 46 +- services/search.service.js | 32 +- services/settings.service.js | 17 +- services/sponsor.service.js | 13 +- services/storage.service.js | 14 +- services/team.service.js | 57 +- services/version.service.js | 8 +- services/volunteer.service.js | 14 +- tests/account.test.js | 473 +- tests/auth.test.js | 56 +- tests/email.service.spec.js | 45 +- tests/hacker.test.js | 782 +- tests/role.test.js | 44 +- tests/search.service.spec.js | 178 +- tests/settings.test.js | 97 +- tests/setup.spec.js | 38 +- tests/sponsor.test.js | 246 +- tests/storage.spec.js | 42 +- tests/team.test.js | 377 +- tests/util/account.test.util.js | 266 +- tests/util/accountConfirmation.test.util.js | 62 +- tests/util/auth.test.util.js | 11 +- tests/util/bus.test.util.js | 24 +- tests/util/hacker.test.util.js | 576 +- tests/util/resetPassword.test.util.js | 23 +- tests/util/role.test.util.js | 17 +- tests/util/roleBinding.test.util.js | 23 +- tests/util/settings.test.util.js | 14 +- tests/util/sponsor.test.util.js | 44 +- tests/util/staff.test.util.js | 14 +- tests/util/team.test.util.js | 61 +- tests/util/volunteer.test.util.js | 22 +- tests/volunteer.test.js | 98 +- 201 files changed, 34226 insertions(+), 9069 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc delete mode 100644 .jshintrc create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules/ diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..bc137efb --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "env": { + "browser": true, + "es6": true, + "node": true, + "mocha": true + }, + "parserOptions": { + "ecmaVersion": 2017, + "sourceType": "module" + }, + "plugins": [ + "prettier" + ], + "extends": [ + "eslint:recommended", + "prettier" + ] +} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index cfbc9e06..00000000 --- a/.jshintrc +++ /dev/null @@ -1,91 +0,0 @@ -{ - // JSHint Default Configuration File (as on JSHint website) - // See http://jshint.com/docs/ for more details - - "maxerr": 50, // {int} Maximum error before stopping - - // Enforcing - "bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.) - "camelcase": true, // true: Identifiers must be in camelCase - "curly": true, // true: Require {} for every new block or scope - "eqeqeq": true, // true: Require triple equals (===) for comparison - "forin": true, // true: Require filtering for..in loops with obj.hasOwnProperty() - "freeze": true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. - "immed": false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "latedef": false, // true: Require variables/functions to be defined before being used - "newcap": false, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "noempty": true, // true: Prohibit use of empty blocks - "nonbsp": true, // true: Prohibit "non-breaking whitespace" characters. - "nonew": false, // true: Prohibit use of constructors for side-effects (without assignment) - "plusplus": false, // true: Prohibit use of `++` and `--` - "quotmark": true, // Quotation mark consistency: - // false : do nothing (default) - // true : ensure whatever is used is consistent - // "single" : require single quotes - // "double" : require double quotes - "undef": true, // true: Require all non-global variables to be declared (prevents global leaks) - "unused": true, // Unused variables: - // true : all variables, last function parameter - // "vars" : all variables only - // "strict" : all variables, all function parameters - "strict": true, // true: Requires all functions run in ES5 Strict Mode - "maxparams": false, // {int} Max number of formal params allowed per function - "maxdepth": false, // {int} Max depth of nested blocks (within functions) - "maxstatements": false, // {int} Max number statements per function - "maxcomplexity": false, // {int} Max cyclomatic complexity per function - "maxlen": false, // {int} Max number of characters per line - "varstmt": false, // true: Disallow any var statements. Only `let` and `const` are allowed. - - // Relaxing - "asi": false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) - "boss": false, // true: Tolerate assignments where comparisons would be expected - "debug": false, // true: Allow debugger statements e.g. browser breakpoints. - "eqnull": false, // true: Tolerate use of `== null` - "esversion": 9, // {int} Specify the ECMAScript version to which the code must adhere. - "moz": false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) - // (ex: `for each`, multiple try/catch, function expression…) - "evil": false, // true: Tolerate use of `eval` and `new Function()` - "expr": false, // true: Tolerate `ExpressionStatement` as Programs - "funcscope": false, // true: Tolerate defining variables inside control statements - "globalstrict": true, // true: Allow global "use strict" (also enables 'strict') - "iterator": false, // true: Tolerate using the `__iterator__` property - "lastsemic": false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block - "laxbreak": false, // true: Tolerate possibly unsafe line breakings - "laxcomma": false, // true: Tolerate comma-first style coding - "loopfunc": false, // true: Tolerate functions being defined in loops - "multistr": false, // true: Tolerate multi-line strings - "noyield": false, // true: Tolerate generator functions with no yield statement in them. - "notypeof": false, // true: Tolerate invalid typeof operator values - "proto": false, // true: Tolerate using the `__proto__` property - "scripturl": false, // true: Tolerate script-targeted URLs - "shadow": false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` - "sub": false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "supernew": false, // true: Tolerate `new function () { ... };` and `new Object;` - "validthis": true, // true: Tolerate using this in a non-constructor function - - // Environments - "browser": true, // Web Browser (window, document, etc) - "browserify": false, // Browserify (node.js code in the browser) - "couch": false, // CouchDB - "devel": true, // Development/debugging (alert, confirm, etc) - "dojo": false, // Dojo Toolkit - "jasmine": false, // Jasmine - "jquery": false, // jQuery - "mocha": true, // Mocha - "mootools": false, // MooTools - "node": true, // Node.js - "nonstandard": false, // Widely adopted globals (escape, unescape, etc) - "phantom": false, // PhantomJS - "prototypejs": false, // Prototype and Scriptaculous - "qunit": false, // QUnit - "rhino": false, // Rhino - "shelljs": false, // ShellJS - "typed": false, // Globals for typed array constructions - "worker": false, // Web Workers - "wsh": false, // Windows Scripting Host - "yui": false, // Yahoo User Interface - - // Custom Globals - "globals": {} // additional predefined global variables -} \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +node_modules/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..6577547b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "tabWidth": 4, + "useTabs": false, + "singleQuote": false, + "semi": true, + "arrowParens": "always", + "jsxBracketSameLine": false +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 74276cc5..aee26f6c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,7 @@ { - "jslint.version": "es6", - "jslint.options": { - "node":true, - "this":false, - "bad_property":false - }, "search.usePCRE2": true, - "editor.formatOnSave": true -} \ No newline at end of file + "editor.formatOnSave": true, + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "editor.tabSize": 4 +} diff --git a/app.js b/app.js index 875b13fc..327b1548 100755 --- a/app.js +++ b/app.js @@ -44,7 +44,10 @@ if (!Services.env.isProduction()) { } else { // TODO: change this when necessary corsOptions = { - origin: [`https://${process.env.FRONTEND_ADDRESS_DEPLOY}`, `https://docs.mchacks.ca`], + origin: [ + `https://${process.env.FRONTEND_ADDRESS_DEPLOY}`, + `https://docs.mchacks.ca` + ], credentials: true }; } @@ -53,17 +56,21 @@ app.use(cors(corsOptions)); app.use(Services.log.requestLogger); app.use(Services.log.errorLogger); app.use(express.json()); -app.use(express.urlencoded({ - extended: false -})); +app.use( + express.urlencoded({ + extended: false + }) +); app.use(cookieParser()); //Cookie-based session tracking -app.use(cookieSession({ - name: "session", - keys: [process.env.COOKIE_SECRET], - // Cookie Options - maxAge: 48 * 60 * 60 * 1000 //Logged in for 48 hours -})); +app.use( + cookieSession({ + name: "session", + keys: [process.env.COOKIE_SECRET], + // Cookie Options + maxAge: 48 * 60 * 60 * 1000 //Logged in for 48 hours + }) +); app.use(passport.initialize()); app.use(passport.session()); //persistent login session @@ -98,8 +105,8 @@ app.use("/api", apiRouter); //Custom error handler app.use((err, req, res, next) => { // log the error... - const status = (err.status) ? err.status : 500; - const message = (err.message) ? err.message : "Internal Server Error"; + const status = err.status ? err.status : 500; + const message = err.message ? err.message : "Internal Server Error"; //Only show bad error when we're not in deployment let errorContents; if (status === 500 && Services.env.isProduction) { @@ -118,5 +125,5 @@ app.use((err, req, res, next) => { }); module.exports = { - app: app, -}; \ No newline at end of file + app: app +}; diff --git a/bin/www.js b/bin/www.js index 998b746e..1e3ed043 100755 --- a/bin/www.js +++ b/bin/www.js @@ -49,22 +49,20 @@ function onError(error) { throw error; } - const bind = typeof port === "string" ? - "Pipe " + port: - "Port " + port; + const bind = typeof port === "string" ? "Pipe " + port : "Port " + port; // handle specific listen errors with friendly messages switch (error.code) { - case "EACCES": - console.error(bind + " requires elevated privileges"); - process.exit(1); - break; - case "EADDRINUSE": - console.error(bind + " is already in use"); - process.exit(1); - break; - default: - throw error; + case "EACCES": + console.error(bind + " requires elevated privileges"); + process.exit(1); + break; + case "EADDRINUSE": + console.error(bind + " is already in use"); + process.exit(1); + break; + default: + throw error; } } @@ -74,11 +72,10 @@ function onError(error) { function onListening() { const addr = server.address(); - const bind = typeof addr === "string" ? - "pipe " + addr : - "port " + addr.port; + const bind = + typeof addr === "string" ? "pipe " + addr : "port " + addr.port; debug("Listening on " + bind); - fs.readFile("VERSION", function (err, data) { + fs.readFile("VERSION", function(err, data) { if (err) { throw err; } @@ -86,11 +83,10 @@ function onListening() { }); } - /** * Listen on provided port, on all network interfaces. */ server.listen(port); server.on("error", onError); -server.on("listening", onListening); \ No newline at end of file +server.on("listening", onListening); diff --git a/constants/error.constant.js b/constants/error.constant.js index dff30408..06ab069d 100644 --- a/constants/error.constant.js +++ b/constants/error.constant.js @@ -12,7 +12,8 @@ const ACCOUNT_TYPE_409_MESSAGE = "Wrong account type"; const SPONSOR_ID_409_MESSAGE = "Conflict with sponsor accountId link"; const VOLUNTEER_ID_409_MESSAGE = "Conflict with volunteer accountId link"; const HACKER_ID_409_MESSAGE = "Conflict with hacker accountId link"; -const TEAM_MEMBER_409_MESSAGE = "Conflict with team member being in another team"; +const TEAM_MEMBER_409_MESSAGE = + "Conflict with team member being in another team"; const TEAM_NAME_409_MESSAGE = "Conflict with team name already in use"; const HACKER_STATUS_409_MESSAGE = "Conflict with hacker status"; const TEAM_SIZE_409_MESSAGE = "Team full"; @@ -81,4 +82,4 @@ module.exports = { VOLUNTEER_404_MESSAGE: VOLUNTEER_404_MESSAGE, SPONSOR_UPDATE_500_MESSAGE: SPONSOR_UPDATE_500_MESSAGE, SETTINGS_404_MESSAGE: SETTINGS_404_MESSAGE -}; \ No newline at end of file +}; diff --git a/constants/general.constant.js b/constants/general.constant.js index 850479c3..2f762e4b 100644 --- a/constants/general.constant.js +++ b/constants/general.constant.js @@ -81,8 +81,23 @@ POST_ROLES[STAFF] = "postStaff"; const SHIRT_SIZES = ["XS", "S", "M", "L", "XL", "XXL"]; const USER_TYPES = [HACKER, VOLUNTEER, STAFF, SPONSOR]; -const SPONSOR_TIERS = [SPONSOR_T1, SPONSOR_T2, SPONSOR_T3, SPONSOR_T4, SPONSOR_T5]; -const EXTENDED_USER_TYPES = [HACKER, VOLUNTEER, STAFF, SPONSOR_T1, SPONSOR_T2, SPONSOR_T3, SPONSOR_T4, SPONSOR_T5]; +const SPONSOR_TIERS = [ + SPONSOR_T1, + SPONSOR_T2, + SPONSOR_T3, + SPONSOR_T4, + SPONSOR_T5 +]; +const EXTENDED_USER_TYPES = [ + HACKER, + VOLUNTEER, + STAFF, + SPONSOR_T1, + SPONSOR_T2, + SPONSOR_T3, + SPONSOR_T4, + SPONSOR_T5 +]; // matches optional http://, https://, http:, https:, and optional www. // matches the domain, and then optional route, path, query parameters @@ -91,15 +106,21 @@ const ANY_REGEX = /^.+$/; const MAX_TEAM_SIZE = 4; -const WEEK_OF = 'Week Of'; +const WEEK_OF = "Week Of"; const EMAIL_SUBJECTS = {}; -EMAIL_SUBJECTS[HACKER_STATUS_NONE] = `Application for ${HACKATHON_NAME} incomplete`; -EMAIL_SUBJECTS[HACKER_STATUS_APPLIED] = `Thanks for applying to ${HACKATHON_NAME}`; +EMAIL_SUBJECTS[ + HACKER_STATUS_NONE +] = `Application for ${HACKATHON_NAME} incomplete`; +EMAIL_SUBJECTS[ + HACKER_STATUS_APPLIED +] = `Thanks for applying to ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_ACCEPTED] = `Great update from ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_DECLINED] = `Update from ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_WAITLISTED] = `Update from ${HACKATHON_NAME}`; -EMAIL_SUBJECTS[HACKER_STATUS_CONFIRMED] = `Thanks for confirming your attendance to ${HACKATHON_NAME}`; +EMAIL_SUBJECTS[ + HACKER_STATUS_CONFIRMED +] = `Thanks for confirming your attendance to ${HACKATHON_NAME}`; EMAIL_SUBJECTS[HACKER_STATUS_WITHDRAWN] = "Sorry to see you go"; EMAIL_SUBJECTS[HACKER_STATUS_CHECKED_IN] = `Welcome to ${HACKATHON_NAME}`; @@ -107,10 +128,18 @@ EMAIL_SUBJECTS[WEEK_OF] = `Welcome to ${HACKATHON_NAME}`; const CONFIRM_ACC_EMAIL_SUBJECT = `Please complete your hacker application for ${HACKATHON_NAME}`; const CREATE_ACC_EMAIL_SUBJECTS = {}; -CREATE_ACC_EMAIL_SUBJECTS[HACKER] = `You've been invited to create a hacker account for ${HACKATHON_NAME}`; -CREATE_ACC_EMAIL_SUBJECTS[SPONSOR] = `You've been invited to create a sponsor account for ${HACKATHON_NAME}`; -CREATE_ACC_EMAIL_SUBJECTS[VOLUNTEER] = `You've been invited to create a volunteer account for ${HACKATHON_NAME}`; -CREATE_ACC_EMAIL_SUBJECTS[STAFF] = `You've been invited to create a staff account for ${HACKATHON_NAME}`; +CREATE_ACC_EMAIL_SUBJECTS[ + HACKER +] = `You've been invited to create a hacker account for ${HACKATHON_NAME}`; +CREATE_ACC_EMAIL_SUBJECTS[ + SPONSOR +] = `You've been invited to create a sponsor account for ${HACKATHON_NAME}`; +CREATE_ACC_EMAIL_SUBJECTS[ + VOLUNTEER +] = `You've been invited to create a volunteer account for ${HACKATHON_NAME}`; +CREATE_ACC_EMAIL_SUBJECTS[ + STAFF +] = `You've been invited to create a staff account for ${HACKATHON_NAME}`; const CACHE_TIMEOUT_STATS = 5 * 60 * 1000; const CACHE_KEY_STATS = "hackerStats"; @@ -154,5 +183,5 @@ module.exports = { CACHE_KEY_STATS: CACHE_KEY_STATS, MAX_TEAM_SIZE: MAX_TEAM_SIZE, WEEK_OF: WEEK_OF, - SAMPLE_DIET_RESTRICTIONS: SAMPLE_DIET_RESTRICTIONS, -}; \ No newline at end of file + SAMPLE_DIET_RESTRICTIONS: SAMPLE_DIET_RESTRICTIONS +}; diff --git a/constants/role.constant.js b/constants/role.constant.js index 04026c0a..b2f00147 100644 --- a/constants/role.constant.js +++ b/constants/role.constant.js @@ -1,14 +1,14 @@ "use strict"; const Constants = { General: require("./general.constant"), - Routes: require("./routes.constant"), + Routes: require("./routes.constant") }; const mongoose = require("mongoose"); const accountRole = { - "_id": mongoose.Types.ObjectId("00000000e285ec4f6ec7e5c2"), - "name": "account", - "routes": [ + _id: mongoose.Types.ObjectId("00000000e285ec4f6ec7e5c2"), + name: "account", + routes: [ Constants.Routes.authRoutes.login, Constants.Routes.authRoutes.logout, Constants.Routes.authRoutes.changePassword, @@ -16,20 +16,20 @@ const accountRole = { Constants.Routes.accountRoutes.getSelf, Constants.Routes.accountRoutes.getSelfById, Constants.Routes.accountRoutes.patchSelfById, - Constants.Routes.settingsRoutes.getSettings, + Constants.Routes.settingsRoutes.getSettings ] }; const adminRole = { - "_id": mongoose.Types.ObjectId.createFromTime(1), - "name": Constants.General.STAFF, - "routes": Constants.Routes.listAllRoutes(), + _id: mongoose.Types.ObjectId.createFromTime(1), + name: Constants.General.STAFF, + routes: Constants.Routes.listAllRoutes() }; const hackerRole = { - "_id": mongoose.Types.ObjectId.createFromTime(2), - "name": Constants.General.HACKER, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(2), + name: Constants.General.HACKER, + routes: [ Constants.Routes.hackerRoutes.post, Constants.Routes.hackerRoutes.getSelfById, Constants.Routes.hackerRoutes.getSelfByEmail, @@ -47,9 +47,9 @@ const hackerRole = { }; const volunteerRole = { - "_id": mongoose.Types.ObjectId.createFromTime(3), - "name": Constants.General.VOLUNTEER, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(3), + name: Constants.General.VOLUNTEER, + routes: [ Constants.Routes.volunteerRoutes.getSelfById, Constants.Routes.volunteerRoutes.post, @@ -61,9 +61,9 @@ const volunteerRole = { }; const sponsorT1Role = { - "_id": mongoose.Types.ObjectId.createFromTime(4), - "name": Constants.General.SPONSOR_T1, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(4), + name: Constants.General.SPONSOR_T1, + routes: [ Constants.Routes.sponsorRoutes.post, Constants.Routes.sponsorRoutes.getSelfById, Constants.Routes.sponsorRoutes.getSelf, @@ -71,14 +71,14 @@ const sponsorT1Role = { Constants.Routes.searchRoutes.get, Constants.Routes.accountRoutes.getAnyById, - Constants.Routes.hackerRoutes.getAnyById, + Constants.Routes.hackerRoutes.getAnyById ] }; const sponsorT2Role = { - "_id": mongoose.Types.ObjectId.createFromTime(5), - "name": Constants.General.SPONSOR_T2, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(5), + name: Constants.General.SPONSOR_T2, + routes: [ Constants.Routes.sponsorRoutes.post, Constants.Routes.sponsorRoutes.getSelfById, Constants.Routes.sponsorRoutes.getSelf, @@ -86,14 +86,14 @@ const sponsorT2Role = { Constants.Routes.searchRoutes.get, Constants.Routes.accountRoutes.getAnyById, - Constants.Routes.hackerRoutes.getAnyById, + Constants.Routes.hackerRoutes.getAnyById ] }; const sponsorT3Role = { - "_id": mongoose.Types.ObjectId.createFromTime(6), - "name": Constants.General.SPONSOR_T3, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(6), + name: Constants.General.SPONSOR_T3, + routes: [ Constants.Routes.sponsorRoutes.post, Constants.Routes.sponsorRoutes.getSelfById, Constants.Routes.sponsorRoutes.getSelf, @@ -101,14 +101,14 @@ const sponsorT3Role = { Constants.Routes.searchRoutes.get, Constants.Routes.accountRoutes.getAnyById, - Constants.Routes.hackerRoutes.getAnyById, + Constants.Routes.hackerRoutes.getAnyById ] }; const sponsorT4Role = { - "_id": mongoose.Types.ObjectId.createFromTime(7), - "name": Constants.General.SPONSOR_T4, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(7), + name: Constants.General.SPONSOR_T4, + routes: [ Constants.Routes.sponsorRoutes.post, Constants.Routes.sponsorRoutes.getSelfById, Constants.Routes.sponsorRoutes.getSelf, @@ -116,14 +116,14 @@ const sponsorT4Role = { Constants.Routes.searchRoutes.get, Constants.Routes.accountRoutes.getAnyById, - Constants.Routes.hackerRoutes.getAnyById, + Constants.Routes.hackerRoutes.getAnyById ] }; const sponsorT5Role = { - "_id": mongoose.Types.ObjectId.createFromTime(8), - "name": Constants.General.SPONSOR_T5, - "routes": [ + _id: mongoose.Types.ObjectId.createFromTime(8), + name: Constants.General.SPONSOR_T5, + routes: [ Constants.Routes.sponsorRoutes.post, Constants.Routes.sponsorRoutes.getSelfById, Constants.Routes.sponsorRoutes.getSelf, @@ -131,7 +131,7 @@ const sponsorT5Role = { Constants.Routes.searchRoutes.get, Constants.Routes.accountRoutes.getAnyById, - Constants.Routes.hackerRoutes.getAnyById, + Constants.Routes.hackerRoutes.getAnyById ] }; @@ -150,7 +150,6 @@ function createAllSingularRoles() { // i is unique integer so that objectId is constant var i = 1000000; for (let routeGroupKey in allRoutes) { - if (!allRoutes.hasOwnProperty(routeGroupKey)) { continue; } @@ -164,7 +163,7 @@ function createAllSingularRoles() { let role = { _id: mongoose.Types.ObjectId(i), name: routeKey + routeGroupKey, - routes: routeGroup[routeKey], + routes: routeGroup[routeKey] }; let roleName = role.name; roles[roleName] = role; @@ -189,7 +188,7 @@ function createAllRoles() { sponsorT2Role: sponsorT2Role, sponsorT3Role: sponsorT3Role, sponsorT4Role: sponsorT4Role, - sponsorT5Role: sponsorT5Role, + sponsorT5Role: sponsorT5Role }; const singularRoles = createAllSingularRoles(); @@ -218,5 +217,5 @@ module.exports = { allRolesObject: allRolesObject, allRolesArray: allRolesArray, createAllSingularRoles: createAllSingularRoles, - createAllRoles: createAllRoles, -}; \ No newline at end of file + createAllRoles: createAllRoles +}; diff --git a/constants/routes.constant.js b/constants/routes.constant.js index d5bd5a91..9533e03c 100644 --- a/constants/routes.constant.js +++ b/constants/routes.constant.js @@ -2,267 +2,266 @@ const Constants = require("./general.constant"); const authRoutes = { - "login": { + login: { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/auth/login" }, - "logout": { + logout: { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/auth/logout" }, - "getSelfRoleBindindings": { + getSelfRoleBindindings: { requestType: Constants.REQUEST_TYPES.GET, uri: "/api/auth/rolebindings/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyRoleBindings": { + getAnyRoleBindings: { requestType: Constants.REQUEST_TYPES.GET, uri: "/api/auth/rolebindings/" + Constants.ROLE_CATEGORIES.ALL }, - "changePassword": { + changePassword: { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/auth/password/change" - }, + } }; const accountRoutes = { - "getSelf": { + getSelf: { requestType: Constants.REQUEST_TYPES.GET, uri: "/api/account/self" }, - "getSelfById": { + getSelfById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/account/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/account/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyById": { + getAnyById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/account/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/account/" + Constants.ROLE_CATEGORIES.ALL }, - "post": { + post: { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/account/" }, - "patchSelfById": { + patchSelfById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/account/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/account/" + Constants.ROLE_CATEGORIES.SELF }, - "patchAnyById": { + patchAnyById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/account/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/account/" + Constants.ROLE_CATEGORIES.ALL }, - "inviteAccount": { + inviteAccount: { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/account/invite" } }; const hackerRoutes = { - "getSelf": { + getSelf: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/self/", + uri: "/api/hacker/self/" }, - "getSelfById": { + getSelfById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyById": { + getAnyById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.ALL }, - "getSelfByEmail": { + getSelfByEmail: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/email/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/email/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyByEmail": { + getAnyByEmail: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/email/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/email/" + Constants.ROLE_CATEGORIES.ALL }, - "getSelfResumeById": { + getSelfResumeById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyResumeById": { + getAnyResumeById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.ALL }, - "post": { + post: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/", + uri: "/api/hacker/" }, - "postSelfResumeById": { + postSelfResumeById: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.SELF }, - "postAnyResumeById": { + postAnyResumeById: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/resume/" + Constants.ROLE_CATEGORIES.ALL }, - "patchSelfById": { + patchSelfById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.SELF }, - "patchAnyById": { + patchAnyById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/" + Constants.ROLE_CATEGORIES.ALL }, - "patchAnyStatusById": { + patchAnyStatusById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/status/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/status/" + Constants.ROLE_CATEGORIES.ALL }, - "patchSelfStatusById": { + patchSelfStatusById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/status/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/status/" + Constants.ROLE_CATEGORIES.SELF }, - "patchSelfCheckInById": { + patchSelfCheckInById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/checkin/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/checkin/" + Constants.ROLE_CATEGORIES.SELF }, - "patchAnyCheckInById": { + patchAnyCheckInById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/checkin/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/checkin/" + Constants.ROLE_CATEGORIES.ALL }, - "patchSelfConfirmationById": { + patchSelfConfirmationById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/hacker/confirmation/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/confirmation/" + Constants.ROLE_CATEGORIES.SELF }, - "postAnySendWeekOfEmail": { + postAnySendWeekOfEmail: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.ALL }, - "postSelfSendWeekOfEmail": { + postSelfSendWeekOfEmail: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.SELF }, - "postAnySendDayOfEmail": { + postAnySendDayOfEmail: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.ALL }, - "postSelfSendDayOfEmail": { + postSelfSendDayOfEmail: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.SELF, - }, + uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.SELF + } }; const sponsorRoutes = { - "getSelf": { + getSelf: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/sponsor/self/", + uri: "/api/sponsor/self/" }, - "getSelfById": { + getSelfById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyById": { + getAnyById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.ALL }, - "post": { + post: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/sponsor/", + uri: "/api/sponsor/" }, - "patchSelfById": { + patchSelfById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.SELF }, - "patchAnyById": { + patchAnyById: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/sponsor/" + Constants.ROLE_CATEGORIES.ALL } }; const teamRoutes = { - "get": { + get: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/team/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/team/" + Constants.ROLE_CATEGORIES.ALL }, - "post": { + post: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/team/", + uri: "/api/team/" }, - "join": { + join: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/team/join/", + uri: "/api/team/join/" }, - "patchSelfById": { + patchSelfById: { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/team/" + Constants.ROLE_CATEGORIES.SELF }, - "patchAnyById": { + patchAnyById: { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/team/" + Constants.ROLE_CATEGORIES.ALL }, - "leave": { + leave: { requestType: Constants.REQUEST_TYPES.PATCH, - uri: "/api/team/leave/", - }, + uri: "/api/team/leave/" + } }; const volunteerRoutes = { - "getSelfById": { + getSelfById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/volunteer/" + Constants.ROLE_CATEGORIES.SELF, + uri: "/api/volunteer/" + Constants.ROLE_CATEGORIES.SELF }, - "getAnyById": { + getAnyById: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/volunteer/" + Constants.ROLE_CATEGORIES.ALL, + uri: "/api/volunteer/" + Constants.ROLE_CATEGORIES.ALL }, - "post": { + post: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/volunteer/", - }, + uri: "/api/volunteer/" + } }; const roleRoutes = { - "post": { + post: { requestType: Constants.REQUEST_TYPES.POST, - uri: "/api/role/", + uri: "/api/role/" } }; const searchRoutes = { - "get": { + get: { requestType: Constants.REQUEST_TYPES.GET, uri: "/api/search/" } }; const staffRoutes = { - "hackerStats": { + hackerStats: { requestType: Constants.REQUEST_TYPES.GET, - uri: "/api/hacker/stats", + uri: "/api/hacker/stats" }, - "postInvite": { + postInvite: { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/account/invite" }, - "getInvite": { + getInvite: { requestType: Constants.REQUEST_TYPES.GET, uri: "/api/account/invite" - }, - -} + } +}; const settingsRoutes = { - "getSettings": { + getSettings: { requestType: Constants.REQUEST_TYPES.GET, uri: "/api/settings" }, - "patchSettings": { + patchSettings: { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/settings" - }, -} + } +}; const allRoutes = { - "Auth": authRoutes, - "Account": accountRoutes, - "Hacker": hackerRoutes, - "Sponsor": sponsorRoutes, - "Team": teamRoutes, - "Volunteer": volunteerRoutes, - "Role": roleRoutes, - "Search": searchRoutes, - "Settings": settingsRoutes, - "Staff": staffRoutes, + Auth: authRoutes, + Account: accountRoutes, + Hacker: hackerRoutes, + Sponsor: sponsorRoutes, + Team: teamRoutes, + Volunteer: volunteerRoutes, + Role: roleRoutes, + Search: searchRoutes, + Settings: settingsRoutes, + Staff: staffRoutes }; /** @@ -303,5 +302,5 @@ module.exports = { settingsRoutes: settingsRoutes, staffRoutes: staffRoutes, allRoutes: allRoutes, - listAllRoutes: listAllRoutes, -}; \ No newline at end of file + listAllRoutes: listAllRoutes +}; diff --git a/constants/success.constant.js b/constants/success.constant.js index 6820d13f..8fda8b91 100644 --- a/constants/success.constant.js +++ b/constants/success.constant.js @@ -21,8 +21,8 @@ const HACKER_GET_BY_ID = "Hacker found by id."; const HACKER_READ = "Hacker retrieval successful."; const HACKER_CREATE = "Hacker creation successful."; const HACKER_UPDATE = "Hacker update successful."; -const HACKER_SENT_WEEK_OF = "Hacker week-of email sent." -const HACKER_SENT_DAY_OF = "Hacker day-of email sent." +const HACKER_SENT_WEEK_OF = "Hacker week-of email sent."; +const HACKER_SENT_DAY_OF = "Hacker day-of email sent."; const RESUME_UPLOAD = "Resume upload successful."; const RESUME_DOWNLOAD = "Resume download successful."; @@ -35,7 +35,6 @@ const SEARCH_NO_RESULTS = "Query search successful. No results found."; const SETTINGS_PATCH = "Settings update successful."; const SETTINGS_GET = "Settings get successful."; - const SPONSOR_GET_BY_ID = "Sponsor found by id."; const SPONSOR_READ = "Sponsor retrieval successful."; const SPONSOR_CREATE = "Sponsor creation successful."; @@ -100,5 +99,5 @@ module.exports = { TEAM_HACKER_LEAVE: TEAM_HACKER_LEAVE, VOLUNTEER_GET_BY_ID: VOLUNTEER_GET_BY_ID, - VOLUNTEER_CREATE: VOLUNTEER_CREATE, -}; \ No newline at end of file + VOLUNTEER_CREATE: VOLUNTEER_CREATE +}; diff --git a/constants/testMongoId.constant.js b/constants/testMongoId.constant.js index 5e8c74be..78cd4258 100644 --- a/constants/testMongoId.constant.js +++ b/constants/testMongoId.constant.js @@ -26,5 +26,5 @@ module.exports = { hackerEId: hackerEId, hackerFId: hackerFId, hackerGId: hackerGId, - hackerHId: hackerHId, -}; \ No newline at end of file + hackerHId: hackerHId +}; diff --git a/controllers/account.controller.js b/controllers/account.controller.js index 44e0cff7..2a58d364 100644 --- a/controllers/account.controller.js +++ b/controllers/account.controller.js @@ -6,7 +6,7 @@ const Services = { const Util = require("../middlewares/util.middleware"); const Constants = { Error: require("../constants/error.constant"), - Success: require("../constants/success.constant"), + Success: require("../constants/success.constant") }; /** @@ -38,13 +38,12 @@ function addUser(req, res) { }); } - /** * @function updatedAccount * @param {{body: {Object}}} req * @param {*} res * @return {JSON} Success or error status - * @description + * @description * Returns a 200 status for an updated account. * The new account information is located in req.body. * The id is moved to req.body.id from req.params.id by validation. @@ -78,5 +77,5 @@ module.exports = { gotInvites: gotInvites, updatedAccount: updatedAccount, invitedAccount: invitedAccount, - showAccount: showAccount, -}; \ No newline at end of file + showAccount: showAccount +}; diff --git a/controllers/auth.controller.js b/controllers/auth.controller.js index bfefef30..b3438811 100644 --- a/controllers/auth.controller.js +++ b/controllers/auth.controller.js @@ -3,53 +3,53 @@ const Success = require("../constants/success.constant"); module.exports = { - onSuccessfulLogin: function (req, res) { + onSuccessfulLogin: function(req, res) { return res.status(200).json({ message: Success.LOGIN, data: {} }); }, - logout: function (req, res) { + logout: function(req, res) { req.logout(); return res.status(200).json({ message: Success.LOGOUT, data: {} }); }, - sentResetEmail: function (req, res) { + sentResetEmail: function(req, res) { return res.status(200).json({ message: Success.AUTH_SEND_RESET_EMAIL, data: {} }); }, - resetPassword: function (req, res) { + resetPassword: function(req, res) { return res.status(200).json({ message: Success.AUTH_RESET_PASSWORD, data: {} }); }, - confirmAccount: function (req, res) { + confirmAccount: function(req, res) { return res.status(200).json({ message: Success.AUTH_CONFIRM_ACCOUNT, data: {} }); }, - retrieveRoleBindings: function (req, res) { + retrieveRoleBindings: function(req, res) { return res.status(200).json({ message: Success.AUTH_GET_ROLE_BINDINGS, data: req.roleBindings.toJSON() }); }, - sentConfirmationEmail: function (req, res) { + sentConfirmationEmail: function(req, res) { return res.status(200).json({ message: Success.AUTH_SEND_CONFIRMATION_EMAIL, data: {} - }) + }); }, - retrievedRoles: function (req, res) { + retrievedRoles: function(req, res) { return res.status(200).json({ message: Success.AUTH_GET_ROLES, data: req.roles - }) + }); } -}; \ No newline at end of file +}; diff --git a/controllers/hacker.controller.js b/controllers/hacker.controller.js index fb2182c6..b62224a1 100644 --- a/controllers/hacker.controller.js +++ b/controllers/hacker.controller.js @@ -1,7 +1,7 @@ "use strict"; const Constants = { Success: require("../constants/success.constant"), - Error: require("../constants/error.constant"), + Error: require("../constants/error.constant") }; /** @@ -37,7 +37,7 @@ function createdHacker(req, res) { * @param {{params: {id: ObjectId}, body: {Object}}} req * @param {*} res * @return {JSON} Success or error status - * @description + * @description * Change a hacker's information based on the hacker's mongoID specified in req.params.id. * The id is moved to req.body.id from req.params.id by validation. * Returns a 200 status for an updated hacker. @@ -73,10 +73,9 @@ function gotStats(req, res) { return res.status(200).json({ message: "Retrieved stats", data: { - stats: req.body.stats, + stats: req.body.stats } }); - } function sentWeekOfEmail(req, res) { @@ -102,4 +101,4 @@ module.exports = { gotStats: gotStats, sentWeekOfEmail: sentWeekOfEmail, sentDayOfEmail: sentDayOfEmail -}; \ No newline at end of file +}; diff --git a/controllers/role.controller.js b/controllers/role.controller.js index ac410feb..8a928a7b 100644 --- a/controllers/role.controller.js +++ b/controllers/role.controller.js @@ -12,10 +12,10 @@ const Success = require("../constants/success.constant"); function createdRole(req, res) { return res.status(200).json({ message: Success.ROLE_CREATE, - data: req.body.role.toJSON(), + data: req.body.role.toJSON() }); } module.exports = { - createdRole: createdRole, -}; \ No newline at end of file + createdRole: createdRole +}; diff --git a/controllers/search.controller.js b/controllers/search.controller.js index 52ca25de..d127f2ee 100644 --- a/controllers/search.controller.js +++ b/controllers/search.controller.js @@ -23,4 +23,4 @@ async function searchResults(req, res) { module.exports = { searchResults: Util.asyncMiddleware(searchResults) -}; \ No newline at end of file +}; diff --git a/controllers/settings.controller.js b/controllers/settings.controller.js index 550e3c4c..dce3e5e7 100644 --- a/controllers/settings.controller.js +++ b/controllers/settings.controller.js @@ -12,7 +12,7 @@ const Success = require("../constants/success.constant"); function gotSettings(req, res) { return res.status(200).json({ message: Success.SETTINGS_GET, - data: req.body.settingsDetails.toJSON(), + data: req.body.settingsDetails.toJSON() }); } @@ -26,11 +26,11 @@ function gotSettings(req, res) { function patchedSettings(req, res) { return res.status(200).json({ message: Success.SETTINGS_PATCH, - data: req.body.settingsDetails, + data: req.body.settingsDetails }); } module.exports = { gotSettings: gotSettings, patchedSettings: patchedSettings -}; \ No newline at end of file +}; diff --git a/controllers/sponsor.controller.js b/controllers/sponsor.controller.js index 67c03437..fb0d2199 100644 --- a/controllers/sponsor.controller.js +++ b/controllers/sponsor.controller.js @@ -6,7 +6,7 @@ const Services = { const Util = require("../middlewares/util.middleware"); const Constants = { Success: require("../constants/success.constant"), - Error: require("../constants/error.constant"), + Error: require("../constants/error.constant") }; /** @@ -54,5 +54,5 @@ function updatedSponsor(req, res) { module.exports = { createdSponsor: createdSponsor, showSponsor: showSponsor, - updatedSponsor: updatedSponsor, -}; \ No newline at end of file + updatedSponsor: updatedSponsor +}; diff --git a/controllers/team.controller.js b/controllers/team.controller.js index 943c3e55..33424dea 100644 --- a/controllers/team.controller.js +++ b/controllers/team.controller.js @@ -8,7 +8,7 @@ const Services = { const Util = require("../middlewares/util.middleware"); const Constants = { Success: require("../constants/success.constant"), - Error: require("../constants/error.constant"), + Error: require("../constants/error.constant") }; /** @@ -26,8 +26,8 @@ function showTeam(req, res) { const strippedMemberJSON = member.toStrippedJSON(); const memberName = { - "firstName": strippedMemberJSON.firstName, - "lastName": strippedMemberJSON.lastName, + firstName: strippedMemberJSON.firstName, + lastName: strippedMemberJSON.lastName }; memberNames.push(memberName); @@ -37,22 +37,22 @@ function showTeam(req, res) { message: Constants.Success.TEAM_READ, data: { team: teamData, - members: memberNames, + members: memberNames } }); } /** * @function joinedTeam - * @param {*} req - * @param {*} res + * @param {*} req + * @param {*} res * @return {JSON} Success status of joining team * @description return success message of joining team */ function joinedTeam(req, res) { return res.status(200).json({ message: Constants.Success.TEAM_JOIN, - data: {}, + data: {} }); } @@ -66,7 +66,7 @@ function joinedTeam(req, res) { function updatedTeam(req, res) { return res.status(200).json({ message: Constants.Success.TEAM_UPDATE, - data: req.body.team.toJSON(), + data: req.body.team.toJSON() }); } @@ -80,7 +80,7 @@ function updatedTeam(req, res) { function createdTeam(req, res) { return res.status(200).json({ message: Constants.Success.TEAM_CREATE, - data: req.body.team, + data: req.body.team }); } @@ -95,7 +95,7 @@ function createdTeam(req, res) { function leftTeam(req, res) { return res.status(200).json({ message: Constants.Success.TEAM_HACKER_LEAVE, - data: {}, + data: {} }); } @@ -104,5 +104,5 @@ module.exports = { updatedTeam: updatedTeam, createdTeam: createdTeam, showTeam: showTeam, - leftTeam: leftTeam, -}; \ No newline at end of file + leftTeam: leftTeam +}; diff --git a/controllers/volunteer.controller.js b/controllers/volunteer.controller.js index b395308b..316c0a00 100644 --- a/controllers/volunteer.controller.js +++ b/controllers/volunteer.controller.js @@ -6,8 +6,8 @@ const Services = { const Util = require("../middlewares/util.middleware"); const Constants = { Success: require("../constants/success.constant"), - Error: require("../constants/error.constant"), -} + Error: require("../constants/error.constant") +}; /** * @function createdVolunteer @@ -37,8 +37,7 @@ function showVolunteer(req, res) { }); } - module.exports = { createdVolunteer: createdVolunteer, - showVolunteer: showVolunteer, -}; \ No newline at end of file + showVolunteer: showVolunteer +}; diff --git a/docs/api/api_data.js b/docs/api/api_data.js index e212553e..a0907711 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1,3086 +1,3622 @@ define({ - "api": [{ - "type": "post", - "url": "/account/", - "title": "create a new account", - "name": "create", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "firstName", - "description": "

First name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "lastName", - "description": "

Last name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "pronoun", - "description": "

the pronoun of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "email", - "description": "

Email of the account.

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "dietaryRestrictions", - "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "password", - "description": "

The password of the account.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "birthDate", - "description": "

a Date parsable string.

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" - } - ], - "header": [{ - "group": "header", - "type": "JWT", - "optional": true, - "field": "token", - "description": "

the user's invite token.

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":\"10/30/1997\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/" - }] - }, - { - "type": "get", - "url": "/account/:id", - "title": "gets information from an account with mongoid ':id'", - "name": "getAccount", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] - }, - { - "type": "get", - "url": "/account/invite", - "title": "Get all of the invites.", - "name": "getAllInvites", - "group": "Account", - "version": "0.0.8", - "description": "

Get all of the invites that currently exist in the database.

", - "success": { - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] - }, - { - "type": "post", - "url": "/account/invite", - "title": "invites a user to create an account with the specified accountType", - "name": "inviteAccount", - "group": "Account", - "version": "0.0.8", - "description": "

sends link with token to be used with the account/create route

", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "email", - "description": "

email of the account to be created and where to send the link

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "accountType", - "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

Error object

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/invite" - }] - }, - { - "type": "get", - "url": "/account/self", - "title": "get information about own account", - "name": "self", - "group": "Account", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"S\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty object

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Account not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/self" - }] - }, - { - "type": "patch", - "url": "/account/:id", - "title": "update an account's information", - "name": "updateOneUser", - "group": "Account", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "firstName", - "description": "

First name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "lastName", - "description": "

Last name of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "pronoun", - "description": "

the pronoun of the account creator.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "email", - "description": "

Email of the account.

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "dietaryRestrictions", - "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "shirtSize", - "description": "

Size of the shirt that the user will receive.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "birthDate", - "description": "

a Date parsable string.

" - }, - { - "group": "body", - "type": "Number", - "optional": true, - "field": "phoneNumber", - "description": "

the user's phone number, represented as a string.

" - } - ] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"shirtSize\": \"M\" }", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Account object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed account information\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"dietaryRestrictions\":[\"Halal\"],\n \"phoneNumber\":1234567890,\n \t\"shirtSize\":\"M\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating account\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/account.js", - "groupTitle": "Account", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/account/:id" - }] - }, - { - "type": "patch", - "url": "/auth/password/change", - "title": "change password for logged in user", - "name": "changePassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "oldPassword", - "description": "

The current password of the user

" - }, - { - "group": "Parameter", - "type": "String", - "optional": false, - "field": "newPassword", - "description": "

The new password of the user

" - } - ] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] - }, - "permission": [{ - "name": ": Must be logged in" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/change" - }] - }, - { - "type": "post", - "url": "/auth/confirm/:token", - "title": "confirm account using the JWT in :token", - "name": "confirmAccount", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "JWT", - "description": "

for confirming the account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/:token" - }] - }, - { - "type": "post", - "url": "/auth/password/forgot", - "title": "forgot password route", - "name": "forgotPassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "email", - "description": "

the email address of the account

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"email\": \"myemail@mchacks.ca\" }", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Sent reset email\", \"data\": {}}", - "type": "json" - }] - }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/forgot" - }] - }, - { - "type": "get", - "url": "/auth/rolebindings/:id", - "title": "retrieve rolebindings for a user given by their user id :id", - "name": "getRoleBindings", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of an account

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Rolebindings object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" - }] - }, - { - "type": "get", - "url": "/auth/roles", - "title": "get roles", - "name": "getRoles", - "description": "

get all roles that exist in the database

", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", - "type": "json" - }] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/roles" - }] - }, - { - "type": "post", - "url": "/auth/login", - "title": "login to the service", - "name": "login", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "string", - "optional": false, - "field": "email", - "description": "

Account email

" - }, - { - "group": "Parameter", - "type": "string", - "optional": false, - "field": "password", - "description": "

Account password

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", - "type": "object" - }] - }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/login" - }] - }, - { - "type": "get", - "url": "/auth/logout", - "title": "logout of service", - "name": "logout", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", - "type": "object" - }] - }, - "permission": [{ - "name": ": public" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/logout" - }] - }, - { - "type": "get", - "url": "/auth/confirm/resend", - "title": "resend confirmation token", - "name": "resendConfirmAccount", - "group": "Authentication", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", - "type": "json" - }, - { - "title": "Error-Response:", - "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", - "type": "json" - } - ] - }, - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/confirm/resend" - }] - }, - { - "type": "post", - "url": "/auth/password/reset", - "title": "reset password", - "name": "resetPassword", - "group": "Authentication", - "version": "0.0.8", - "parameter": { - "fields": { - "Parameter": [{ - "group": "Parameter", - "type": "String", - "optional": false, - "field": "password", - "description": "

the password of the account

" - }] - }, - "examples": [{ - "title": "Request-Example:", - "content": "{ \"password\": \"hunter2\" }", - "type": "json" - }] - }, - "header": { - "fields": { - "Header": [{ - "group": "Header", - "type": "String", - "optional": false, - "field": "Authentication", - "description": "

the token that was provided in the reset password email

" - }] - }, - "examples": [{ - "title": "Header-Example:", - "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", - "type": "json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", - "type": "json" - }] - }, - "permission": [{ - "name": ": must have authentication token" - }], - "filename": "routes/api/auth.js", - "groupTitle": "Authentication", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/auth/password/reset" - }] - }, - { - "type": "patch", - "url": "/hacker/checkin/:id", - "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", - "name": "checkinHacker", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Check-in status. "Checked-in"

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }, - { - "name": "Volunteer" - } - ], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/checkin/:id" - }] - }, - { - "type": "post", - "url": "/hacker/", - "title": "create a new hacker", - "name": "createHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

ObjectID of the respective account

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "school", - "description": "

Name of the school the hacker goes to

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "gender", - "description": "

Gender of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": false, - "field": "needsBus", - "description": "

Whether the hacker requires a bus for transportation

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "ethnicity", - "description": "

the ethnicities of the hacker

" - }, - { - "group": "body", - "type": "String[]", - "optional": false, - "field": "major", - "description": "

the major of the hacker

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "graduationYear", - "description": "

the graduation year of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": false, - "field": "codeOfConduct", - "description": "

acceptance of the code of conduct

" - }, - { - "group": "body", - "type": "Json", - "optional": false, - "field": "application", - "description": "

The hacker's application. Resume and jobInterest fields are required.

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n}", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/" - }] - }, - { - "type": "get", - "url": "/hacker/email/:email", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "email", - "description": "

a hacker's unique email

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/:email" - }] - }, - { - "type": "get", - "url": "/hacker/:id", - "title": "get a hacker's information", - "name": "getHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "String", - "optional": false, - "field": "id", - "description": "

a hacker's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] - }, - { - "type": "get", - "url": "/hacker/resume:id", - "title": "get the resume for a hacker.", - "name": "getHackerResume", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }] - }, - "examples": [{ - "title": "Success-Response:", - "content": "HTTP/1.1 200 OK \n{ \n message: \"Downloaded resume\", \n data: { \n id: \"507f191e810c19729de860ea\", \n resume: [Buffer] \n } \n}", - "type": "json" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

"Resume does not exist"

" - }] - }, - "examples": [{ - "title": "Error-Response:", - "content": "HTTP/1.1 404 \n{ \n message: \"Resume not found\", \n data: {} \n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker" - }, - { - "type": "get", - "url": "/hacker/stats", - "title": "Gets the stats of all of the hackers who have applied.", - "name": "getHackerStats", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "query": [{ - "group": "query", - "type": "String", - "optional": false, - "field": "model", - "description": "

the model to be searched (Only hacker supported)

" - }, - { - "group": "query", - "type": "Array", - "optional": false, - "field": "q", - "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n needsBus: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/stats" - }] - }, - { - "type": "patch", - "url": "/hacker/:id", - "title": "update a hacker's information.", - "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", - "name": "patchHacker", - "group": "Hacker", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": true, - "field": "school", - "description": "

Name of the school the hacker goes to

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "gender", - "description": "

Gender of the hacker

" - }, - { - "group": "body", - "type": "Boolean", - "optional": true, - "field": "needsBus", - "description": "

Whether the hacker requires a bus for transportation

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "ethnicity", - "description": "

the ethnicities of the hacker

" - }, - { - "group": "body", - "type": "String[]", - "optional": true, - "field": "major", - "description": "

the major of the hacker

" - }, - { - "group": "body", - "type": "Number", - "optional": true, - "field": "graduationYear", - "description": "

the graduation year of the hacker

" - }, - { - "group": "body", - "type": "Json", - "optional": true, - "field": "application", - "description": "

The hacker's application

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n }", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":\"Accounting\",\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/:id" - }] - }, - { - "type": "patch", - "url": "/hacker/confirmation/:id", - "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", - "name": "patchHackerConfirmed", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }, - { - "name": "Hacker" - } - ], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" - }] - }, - { - "type": "patch", - "url": "/hacker/status/:id", - "title": "update a hacker's status", - "name": "patchHackerStatus", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "status", - "description": "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Declined"|"Confirmed"|"Withdrawn"|"Checked-in")

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"status\": \"Accepted\"\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/status/:id" - }] - }, - { - "type": "post", - "url": "/hacker/resume/:id", - "title": "upload or update resume for a hacker.", - "name": "postHackerResume", - "group": "Hacker", - "version": "0.0.8", - "description": "

NOTE: This must be sent via multipart/form-data POST request

", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

Hacker id

" - }], - "body": [{ - "group": "body", - "type": "File", - "optional": false, - "field": "resume", - "description": "

The uploaded file.

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Location in the bucket that the file was stored.

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\", \n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", - "type": "json" - }] - }, - "permission": [{ - "name": "Must be logged in, and the account id must be linked to the hacker." - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/resume/:id" - }] - }, - { - "type": "post", - "url": "/hacker/email/weekOf/:id", - "title": "", - "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", - "name": "postHackerSendWeekOfEmail", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] - }, - { - "type": "post", - "url": "/hacker/email/weekOf/:id", - "title": "", - "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", - "name": "postHackerSendWeekOfEmail", - "group": "Hacker", - "version": "0.0.9", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": true, - "field": "status", - "description": "

The hacker ID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker week-of email sent.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrator" - }], - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" - }] - }, - { - "type": "get", - "url": "/sponsor/self", - "title": "get information about logged in sponsor", - "name": "self", - "group": "Hacker", - "version": "1.4.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] - }, - "permission": [{ - "name": ": Sponsor" - }], - "filename": "routes/api/sponsor.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/self" - }] - }, - { - "type": "get", - "url": "/hacker/self", - "title": "get information about own hacker", - "name": "self", - "group": "Hacker", - "version": "0.0.8", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Hacker object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"portfolioURL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"needsBus\":false,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Hacker not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/hacker.js", - "groupTitle": "Hacker", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/hacker/self" - }] - }, - { - "type": "get", - "url": "/", - "title": "version", - "version": "0.0.8", - "name": "index", - "group": "Index", - "permission": [{ - "name": "public" - }], - "filename": "routes/index.js", - "groupTitle": "Index", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/" - }] - }, - { - "type": "post", - "url": "/api/role/", - "title": "create a new role", - "name": "createRole", - "group": "Role", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "name", - "description": "

Name of the route

" - }, - { - "group": "body", - "type": "Route[]", - "optional": false, - "field": "routes", - "description": "

The routes that this role gives access to

" - } - ] - }, - "examples": [{ - "title": "application: ", - "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", - "type": "Json" - }] - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Role object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating role\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/role.js", - "groupTitle": "Role", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/api/role/" - }] - }, - { - "type": "get", - "url": "/search/", - "title": "provide a specific query for any defined model", - "name": "search", - "group": "Search", - "version": "0.0.8", - "parameter": { - "fields": { - "query": [{ - "group": "query", - "type": "String", - "optional": false, - "field": "model", - "description": "

the model to be searched

" - }, - { - "group": "query", - "type": "Array", - "optional": false, - "field": "q", - "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" - }, - { - "group": "query", - "type": "String", - "optional": false, - "field": "sort", - "description": "

either "asc" or "desc"

" - }, - { - "group": "query", - "type": "number", - "optional": false, - "field": "page", - "description": "

the page number that you would like

" - }, - { - "group": "query", - "type": "number", - "optional": false, - "field": "limit", - "description": "

the maximum number of results that you would like returned

" - }, - { - "group": "query", - "type": "any", - "optional": false, - "field": "sort_by", - "description": "

any parameter you want to sort the results by

" - }, - { - "group": "query", - "type": "boolean", - "optional": false, - "field": "expand", - "description": "

whether you want to expand sub documents within the results

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Results

" - } - ] - }, - "examples": [{ - "title": "Success-Response:", - "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", - "type": "object" - }, - { - "title": "Success-Response:", - "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", - "type": "object" - } - ] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response:", - "content": "{\"message\": \"Validation failed\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/search.js", - "groupTitle": "Search", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/search/" - }] - }, - { - "type": "get", - "url": "/settings/", - "title": "Get the settings for the current hackathon", - "name": "getSettings", - "group": "Settings", - "version": "1.1.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Settings Object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings creation successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "public" - }], - "filename": "routes/api/settings.js", - "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] - }, - { - "type": "patch", - "url": "/settings/", - "title": "Patch the settings for the current hackathon", - "name": "patchSettings", - "group": "Settings", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "Date", - "optional": true, - "field": "openTime", - "description": "

The opening time for the hackathon.

" - }, - { - "group": "body", - "type": "Date", - "optional": true, - "field": "closeTime", - "description": "

The closing time for the hackathon.

" - }, - { - "group": "body", - "type": "Date", - "optional": true, - "field": "confirmTime", - "description": "

The deadline for confirmation for the hackathon.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Settings Object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Settings patch successful.\", \n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\"\n }\n }\n}", - "type": "object" - }] - }, - "permission": [{ - "name": "Administrators" - }], - "filename": "routes/api/settings.js", - "groupTitle": "Settings", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/settings/" - }] - }, - { - "type": "post", - "url": "/sponsor/", - "title": "create a new sponsor", - "name": "createSponsor", - "group": "Sponsor", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

ObjectID of the respective account.

" - }, - { - "group": "body", - "type": "Number", - "optional": false, - "field": "tier", - "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "company", - "description": "

Name of the company.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "contractURL", - "description": "

URL link to the contract with the company.

" - }, - { - "group": "body", - "type": "MongoID[]", - "optional": false, - "field": "nominees", - "description": "

Array of accounts that the company wish to nominate as hackers.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] - }, - { - "type": "get", - "url": "/sponsor/:id", - "title": "get a sponsor's information", - "name": "getSponsor", - "group": "Sponsor", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "string", - "optional": false, - "field": "id", - "description": "

a sponsor's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/:id" - }] - }, - { - "type": "patch", - "url": "/sponsor/", - "title": "update a sponsor", - "name": "patchSponsor", - "group": "Sponsor", - "version": "1.3.0", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

ObjectID of the sponsor

" - }], - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "company", - "description": "

Name of the company.

" - }, - { - "group": "body", - "type": "String", - "optional": false, - "field": "contractURL", - "description": "

URL link to the contract with the company.

" - }, - { - "group": "body", - "type": "ObjectId[]", - "optional": false, - "field": "nominees", - "description": "

Array of accounts that the company wish to nominate as hackers.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Sponsor object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/sponsor.js", - "groupTitle": "Sponsor", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/sponsor/" - }] - }, - { - "type": "post", - "url": "/team/", - "title": "create a new team consisting of only the logged in user", - "name": "createTeam", - "group": "Team", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "String", - "optional": false, - "field": "name", - "description": "

Name of the team.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "devpostURL", - "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" - }, - { - "group": "body", - "type": "String", - "optional": true, - "field": "projectName", - "description": "

Name of the team.

" - } - ] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating team\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/" - }] - }, - { - "type": "patch", - "url": "/team/leave/", - "title": "Allows a logged in hacker to leave current team", - "name": "deleteSelfFromTeam", - "group": "Team", - "version": "1.1.1", - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

{}

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Removal from team successful.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/leave/" - }] - }, - { - "type": "get", - "url": "/team/:id", - "title": "get a team's information", - "name": "getTeam", - "group": "Team", - "version": "0.0.8", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

MongoId of the team

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:id" - }] - }, - { - "type": "patch", - "url": "/team/join/", - "title": "Allows a logged in hacker to join a team by name", - "name": "patchJoinTeam", - "group": "Team", - "version": "1.1.1", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "string", - "optional": true, - "field": "name", - "description": "

Name of the team to join

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

{}

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team join successful.\", \n \"data\": {}\n}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/join/" - }] - }, - { - "type": "patch", - "url": "/team/:hackerId", - "title": "Update a team's information. The team is specified by the hacker belonging to it.", - "name": "patchTeam", - "group": "Team", - "version": "0.0.8", - "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "hackerId", - "description": "

a hacker's unique Id

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Team object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Query input that caused the error.

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", - "type": "object" - }] - }, - "filename": "routes/api/team.js", - "groupTitle": "Team", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/team/:hackerId" - }] - }, - { - "type": "post", - "url": "/volunteer/", - "title": "create a new volunteer", - "name": "createVolunteer", - "group": "Volunteer", - "version": "0.0.8", - "parameter": { - "fields": { - "body": [{ - "group": "body", - "type": "MongoID", - "optional": false, - "field": "accountId", - "description": "

MongoID of the account of the volunteer

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "string", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "object", - "optional": false, - "field": "data", - "description": "

Volunteer object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "string", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/volunteer.js", - "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/" - }] - }, - { - "type": "get", - "url": "/volunteer/:id", - "title": "get a volunteer's information", - "name": "getVolunteer", - "group": "Volunteer", - "version": "1.3.0", - "parameter": { - "fields": { - "param": [{ - "group": "param", - "type": "ObjectId", - "optional": false, - "field": "id", - "description": "

a volunteer's unique mongoID

" - }] - } - }, - "success": { - "fields": { - "Success 200": [{ - "group": "Success 200", - "type": "String", - "optional": false, - "field": "message", - "description": "

Success message

" - }, - { - "group": "Success 200", - "type": "Object", - "optional": false, - "field": "data", - "description": "

Volunteer object

" - } - ] - }, - "examples": [{ - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - }] - }, - "error": { - "fields": { - "Error 4xx": [{ - "group": "Error 4xx", - "type": "String", - "optional": false, - "field": "message", - "description": "

Error message

" - }, - { - "group": "Error 4xx", - "type": "Object", - "optional": false, - "field": "data", - "description": "

empty

" - } - ] - }, - "examples": [{ - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - }] - }, - "filename": "routes/api/volunteer.js", - "groupTitle": "Volunteer", - "sampleRequest": [{ - "url": "https://api.mchacks.ca/api/volunteer/:id" - }] - } - ] -}); \ No newline at end of file + api: [ + { + type: "post", + url: "/account/", + title: "create a new account", + name: "create", + group: "Account", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: false, + field: "firstName", + description: + "

First name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "lastName", + description: + "

Last name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "pronoun", + description: + "

the pronoun of the account creator.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "email", + description: "

Email of the account.

" + }, + { + group: "body", + type: "String[]", + optional: false, + field: "dietaryRestrictions", + description: + "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + }, + { + group: "body", + type: "String", + optional: false, + field: "shirtSize", + description: + "

Size of the shirt that the user will receive.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "password", + description: "

The password of the account.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "birthDate", + description: "

a Date parsable string.

" + }, + { + group: "body", + type: "Number", + optional: false, + field: "phoneNumber", + description: + "

the user's phone number, represented as a string.

" + } + ], + header: [ + { + group: "header", + type: "JWT", + optional: true, + field: "token", + description: "

the user's invite token.

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: + '{ \n "firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "password":"hunter2",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n "shirtSize":"S",\n "birthDate":"10/30/1997"\n}', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Account creation successful", \n "data": {\n "id": ObjectId("5bff8b9f3274cf001bc71048"),\n \t"firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n \t"shirtSize":"S",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{\n "message": "Account already exists", \n "data": {\n "route": "/"\n }\n}', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/" + } + ] + }, + { + type: "get", + url: "/account/:id", + title: "gets information from an account with mongoid ':id'", + name: "getAccount", + group: "Account", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

MongoId of an account

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Account found by user id", \n "data": {\n "id": ObjectId("5bff8b9f3274cf001bc71048"),\n "firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n "shirtSize":"S",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Account not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/:id" + } + ] + }, + { + type: "get", + url: "/account/invite", + title: "Get all of the invites.", + name: "getAllInvites", + group: "Account", + version: "0.0.8", + description: + "

Get all of the invites that currently exist in the database.

", + success: { + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Invite retrieval successful.", \n "data": [{\n "email":"abc@def.com",\n "accountType":"Hacker"\n }]\n }', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/invite" + } + ] + }, + { + type: "post", + url: "/account/invite", + title: + "invites a user to create an account with the specified accountType", + name: "inviteAccount", + group: "Account", + version: "0.0.8", + description: + "

sends link with token to be used with the account/create route

", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: true, + field: "email", + description: + "

email of the account to be created and where to send the link

" + }, + { + group: "body", + type: "String", + optional: true, + field: "accountType", + description: + "

the type of the account which the user can create, for sponsor this should specify tier as well

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully invited user", \n "data": {}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

Error object

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: + '{\n "message": "Invalid Authentication",\n "data": {\n "route": "/invite"\n }\n }', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/invite" + } + ] + }, + { + type: "get", + url: "/account/self", + title: "get information about own account", + name: "self", + group: "Account", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Account found by user email", \n "data": {\n \t"id": ObjectId("5bff8b9f3274cf001bc71048"),\n \t"firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n \t"shirtSize":"S",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty object

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Account not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/self" + } + ] + }, + { + type: "patch", + url: "/account/:id", + title: "update an account's information", + name: "updateOneUser", + group: "Account", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: true, + field: "firstName", + description: + "

First name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "lastName", + description: + "

Last name of the account creator.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "pronoun", + description: + "

the pronoun of the account creator.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "email", + description: "

Email of the account.

" + }, + { + group: "body", + type: "String[]", + optional: true, + field: "dietaryRestrictions", + description: + "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + }, + { + group: "body", + type: "String", + optional: true, + field: "shirtSize", + description: + "

Size of the shirt that the user will receive.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "birthDate", + description: "

a Date parsable string.

" + }, + { + group: "body", + type: "Number", + optional: true, + field: "phoneNumber", + description: + "

the user's phone number, represented as a string.

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: '{ "shirtSize": "M" }', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Account object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed account information", \n "data": {\n "id": ObjectId("5bff8b9f3274cf001bc71048"),\n \t"firstName": "Theo",\n "lastName":"Klein",\n "pronoun":"he/him",\n "email":"theo@klein.com",\n "dietaryRestrictions":["Halal"],\n "phoneNumber":1234567890,\n \t"shirtSize":"M",\n "birthDate":Date("10/30/1997")\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while updating account", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/account.js", + groupTitle: "Account", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/account/:id" + } + ] + }, + { + type: "patch", + url: "/auth/password/change", + title: "change password for logged in user", + name: "changePassword", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "oldPassword", + description: + "

The current password of the user

" + }, + { + group: "Parameter", + type: "String", + optional: false, + field: "newPassword", + description: "

The new password of the user

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: + '{ \n "oldPassword": "password12345",\n "newPassword": "password123456"\n}', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{"message": "Successfully reset password", "data": {}}', + type: "json" + } + ] + }, + permission: [ + { + name: ": Must be logged in" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/password/change" + } + ] + }, + { + type: "post", + url: "/auth/confirm/:token", + title: "confirm account using the JWT in :token", + name: "confirmAccount", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "JWT", + description: "

for confirming the account

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{"message": "Successfully confirmed account", "data": {}}', + type: "json" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Invalid token for confirming account, "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] + }, + { + type: "post", + url: "/auth/password/forgot", + title: "forgot password route", + name: "forgotPassword", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "email", + description: + "

the email address of the account

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: '{ "email": "myemail@mchacks.ca" }', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: '{"message": "Sent reset email", "data": {}}', + type: "json" + } + ] + }, + permission: [ + { + name: ": public" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/password/forgot" + } + ] + }, + { + type: "get", + url: "/auth/rolebindings/:id", + title: + "retrieve rolebindings for a user given by their user id :id", + name: "getRoleBindings", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

MongoId of an account

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Rolebindings object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved role bindings",\n "data": {\n accountId:"5beca4ab2e069a34f91697b2"\n id:"5beca4ae2e069a34f91698b1"\n roles: [\n {\n _id:"5beca4ab2e069a34f91697d9",\n name:"hacker",\n routes: [\n {_id: "5beca4ae2e069a34f9169852", requestType: "POST", uri: "/api/auth/login"},\n {_id: "5beca4ae2e069a34f9169851", requestType: "POST", uri: "/api/auth/logout"},\n {_id: "5beca4ae2e069a34f9169850", requestType: "GET", uri: "/api/auth/rolebindings/:self"},\n {_id: "5beca4ae2e069a34f916984f", requestType: "GET", uri: "/api/account/self"},\n {_id: "5beca4ae2e069a34f916984e", requestType: "GET", uri: "/api/account/:self"},\n {_id: "5beca4ae2e069a34f916984d", requestType: "PATCH", uri: "/api/account/:self"},\n {_id: "5beca4ae2e069a34f916984c", requestType: "POST", uri: "/api/hacker/"},\n {_id: "5beca4ae2e069a34f916984b", requestType: "GET", uri: "/api/hacker/:self"},\n {_id: "5beca4ae2e069a34f916984a", requestType: "GET", uri: "/api/hacker/:self/resume"},\n {_id: "5beca4ae2e069a34f9169849", requestType: "PATCH", uri: "/api/hacker/:self"}\n ]\n }\n ]\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Role Bindings not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] + }, + { + type: "get", + url: "/auth/roles", + title: "get roles", + name: "getRoles", + description: "

get all roles that exist in the database

", + group: "Authentication", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{"message": "Sucessfully retrieved all roles", "data":\n[{name: "GodStaff", routes: Array(27), id: "5bee20ef3ca9dd4754382880"},\n {name: "Hacker", routes: Array(10), id: "5bee20ef3ca9dd4754382881"},\n {name: "Volunteer", routes: Array(4), id: "5bee20ef3ca9dd4754382882"}]', + type: "json" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/roles" + } + ] + }, + { + type: "post", + url: "/auth/login", + title: "login to the service", + name: "login", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "string", + optional: false, + field: "email", + description: "

Account email

" + }, + { + group: "Parameter", + type: "string", + optional: false, + field: "password", + description: "

Account password

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{"message": "Successfully logged in", "data": {}}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Invalid Authentication", "data": {}}', + type: "object" + } + ] + }, + permission: [ + { + name: ": public" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/login" + } + ] + }, + { + type: "get", + url: "/auth/logout", + title: "logout of service", + name: "logout", + group: "Authentication", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{"message": "Successfully logged out", "data": {}}', + type: "object" + } + ] + }, + permission: [ + { + name: ": public" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/logout" + } + ] + }, + { + type: "get", + url: "/auth/confirm/resend", + title: "resend confirmation token", + name: "resendConfirmAccount", + group: "Authentication", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{"message": "Successfully resent confirmation email", "data": {}}', + type: "json" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: + ' HTTP/1.1 422\n{"message": "Account already confirmed", "data": {}}', + type: "json" + }, + { + title: "Error-Response:", + content: + ' HTTP/1.1 428\n{"message": "Account confirmation token does not exist", "data": {}}', + type: "json" + } + ] + }, + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] + }, + { + type: "post", + url: "/auth/password/reset", + title: "reset password", + name: "resetPassword", + group: "Authentication", + version: "0.0.8", + parameter: { + fields: { + Parameter: [ + { + group: "Parameter", + type: "String", + optional: false, + field: "password", + description: "

the password of the account

" + } + ] + }, + examples: [ + { + title: "Request-Example:", + content: '{ "password": "hunter2" }', + type: "json" + } + ] + }, + header: { + fields: { + Header: [ + { + group: "Header", + type: "String", + optional: false, + field: "Authentication", + description: + "

the token that was provided in the reset password email

" + } + ] + }, + examples: [ + { + title: "Header-Example:", + content: + '{\n "X-Reset-Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"\n}', + type: "json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{"message": "Successfully reset password", "data": {}}', + type: "json" + } + ] + }, + permission: [ + { + name: ": must have authentication token" + } + ], + filename: "routes/api/auth.js", + groupTitle: "Authentication", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/auth/password/reset" + } + ] + }, + { + type: "patch", + url: "/hacker/checkin/:id", + title: + "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", + name: "checkinHacker", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "status", + description: + "

Check-in status. "Checked-in"

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "status": "Checked-in"\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + }, + { + name: "Volunteer" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] + }, + { + type: "post", + url: "/hacker/", + title: "create a new hacker", + name: "createHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "MongoID", + optional: false, + field: "accountId", + description: + "

ObjectID of the respective account

" + }, + { + group: "body", + type: "String", + optional: false, + field: "school", + description: + "

Name of the school the hacker goes to

" + }, + { + group: "body", + type: "String", + optional: false, + field: "gender", + description: "

Gender of the hacker

" + }, + { + group: "body", + type: "Boolean", + optional: false, + field: "needsBus", + description: + "

Whether the hacker requires a bus for transportation

" + }, + { + group: "body", + type: "String[]", + optional: false, + field: "ethnicity", + description: "

the ethnicities of the hacker

" + }, + { + group: "body", + type: "String[]", + optional: false, + field: "major", + description: "

the major of the hacker

" + }, + { + group: "body", + type: "Number", + optional: false, + field: "graduationYear", + description: + "

the graduation year of the hacker

" + }, + { + group: "body", + type: "Boolean", + optional: false, + field: "codeOfConduct", + description: + "

acceptance of the code of conduct

" + }, + { + group: "body", + type: "Json", + optional: false, + field: "application", + description: + "

The hacker's application. Resume and jobInterest fields are required.

" + } + ] + }, + examples: [ + { + title: "application: ", + content: + '{\n "application":{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n}', + type: "Json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker creation successful", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n }\n}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while creating hacker", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/" + } + ] + }, + { + type: "get", + url: "/hacker/email/:email", + title: "get a hacker's information", + name: "getHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "String", + optional: false, + field: "email", + description: "

a hacker's unique email

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved hacker information", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Hacker not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/email/:email" + } + ] + }, + { + type: "get", + url: "/hacker/:id", + title: "get a hacker's information", + name: "getHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "String", + optional: false, + field: "id", + description: "

a hacker's unique mongoID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved hacker information", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Hacker not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + type: "get", + url: "/hacker/resume:id", + title: "get the resume for a hacker.", + name: "getHackerResume", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

Hacker id

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + 'HTTP/1.1 200 OK \n{ \n message: "Downloaded resume", \n data: { \n id: "507f191e810c19729de860ea", \n resume: [Buffer] \n } \n}', + type: "json" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: + "

"Resume does not exist"

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: + 'HTTP/1.1 404 \n{ \n message: "Resume not found", \n data: {} \n}', + type: "json" + } + ] + }, + permission: [ + { + name: + "Must be logged in, and the account id must be linked to the hacker." + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker" + }, + { + type: "get", + url: "/hacker/stats", + title: "Gets the stats of all of the hackers who have applied.", + name: "getHackerStats", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + query: [ + { + group: "query", + type: "String", + optional: false, + field: "model", + description: + "

the model to be searched (Only hacker supported)

" + }, + { + group: "query", + type: "Array", + optional: false, + field: "q", + description: + "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Retrieved stats",\n "data": {\n "stats" : {\n "total": 10,\n "status": { "Applied": 10 },\n "school": { "McGill University": 3, "Harvard University": 7 },\n degree: { "Undergraduate": 10 },\n gender: { "Male": 1, "Female": 9 },\n needsBus: { "true": 7, "false": 3 },\n ethnicity: { "White": 10, },\n jobInterest: { "Internship": 10 },\n major: { "Computer Science": 10 },\n graduationYear: { "2019": 10 },\n dietaryRestrictions: { "None": 10 },\n shirtSize: { "M": 3, "XL": 7 },\n age: { "22": 10 }\n }\n }\n}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/stats" + } + ] + }, + { + type: "patch", + url: "/hacker/:id", + title: "update a hacker's information.", + description: + "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", + name: "patchHacker", + group: "Hacker", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: true, + field: "school", + description: + "

Name of the school the hacker goes to

" + }, + { + group: "body", + type: "String", + optional: true, + field: "gender", + description: "

Gender of the hacker

" + }, + { + group: "body", + type: "Boolean", + optional: true, + field: "needsBus", + description: + "

Whether the hacker requires a bus for transportation

" + }, + { + group: "body", + type: "String[]", + optional: true, + field: "ethnicity", + description: "

the ethnicities of the hacker

" + }, + { + group: "body", + type: "String[]", + optional: true, + field: "major", + description: "

the major of the hacker

" + }, + { + group: "body", + type: "Number", + optional: true, + field: "graduationYear", + description: + "

the graduation year of the hacker

" + }, + { + group: "body", + type: "Json", + optional: true, + field: "application", + description: "

The hacker's application

" + } + ] + }, + examples: [ + { + title: "application: ", + content: + '{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n }', + type: "Json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":"Accounting",\n "graduationYear":2019,\n "codeOfConduct":true,\n}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while updating hacker", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + type: "patch", + url: "/hacker/confirmation/:id", + title: + "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", + name: "patchHackerConfirmed", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "status", + description: + "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "status": "Confirmed"\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + }, + { + name: "Hacker" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] + }, + { + type: "patch", + url: "/hacker/status/:id", + title: "update a hacker's status", + name: "patchHackerStatus", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "status", + description: + "

Status of the hacker's application ("None"|"Applied"|"Waitlisted"|"Declined"|"Confirmed"|"Withdrawn"|"Checked-in")

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Changed hacker information", \n "data": {\n "status": "Accepted"\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/status/:id" + } + ] + }, + { + type: "post", + url: "/hacker/resume/:id", + title: "upload or update resume for a hacker.", + name: "postHackerResume", + group: "Hacker", + version: "0.0.8", + description: + "

NOTE: This must be sent via multipart/form-data POST request

", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

Hacker id

" + } + ], + body: [ + { + group: "body", + type: "File", + optional: false, + field: "resume", + description: "

The uploaded file.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: + "

Location in the bucket that the file was stored.

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + 'HTTP/1.1 200 OK\n{\n message: "Uploaded resume", \n data: {\n filename: "resumes/1535032624768-507f191e810c19729de860ea"\n }\n}', + type: "json" + } + ] + }, + permission: [ + { + name: + "Must be logged in, and the account id must be linked to the hacker." + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] + }, + { + type: "post", + url: "/hacker/email/weekOf/:id", + title: "", + description: + "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + name: "postHackerSendWeekOfEmail", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + param: [ + { + group: "param", + type: "string", + optional: true, + field: "status", + description: "

The hacker ID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker week-of email sent.", \n "data": {}\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + type: "post", + url: "/hacker/email/weekOf/:id", + title: "", + description: + "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + name: "postHackerSendWeekOfEmail", + group: "Hacker", + version: "0.0.9", + parameter: { + fields: { + param: [ + { + group: "param", + type: "string", + optional: true, + field: "status", + description: "

The hacker ID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker week-of email sent.", \n "data": {}\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrator" + } + ], + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + type: "get", + url: "/sponsor/self", + title: "get information about logged in sponsor", + name: "self", + group: "Hacker", + version: "1.4.1", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved sponsor information", \n "data": {\n "id": "5bff4d736f86be0a41badb91",\n "accountId": "5bff4d736f86be0a41badb99",\n "tier": 3,\n "company": "companyName",\n "contractURL": "https://www.contractHere.com",\n "nominees": ["5bff4d736f86be0a41badb93","5bff4d736f86be0a41badb94"]\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Sponsor not found", "data": {}}', + type: "object" + } + ] + }, + permission: [ + { + name: ": Sponsor" + } + ], + filename: "routes/api/sponsor.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/self" + } + ] + }, + { + type: "get", + url: "/hacker/self", + title: "get information about own hacker", + name: "self", + group: "Hacker", + version: "0.0.8", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Hacker object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Hacker found by logged in account id", \n "data": {\n "id":"5bff4d736f86be0a41badb91",\n "application":{\n "portfolioURL":{\n "resume":"resumes/1543458163426-5bff4d736f86be0a41badb91",\n "github":"https://github.com/abcd",\n "dropler":"https://dribbble.com/abcd",\n "personal":"https://www.hi.com/",\n "linkedIn":"https://linkedin.com/in/abcd",\n "other":"https://github.com/hackmcgill/hackerAPI/issues/168"\n },\n "jobInterest":"Internship",\n "skills":["Javascript","Typescript"],\n "comments":"hi!",\n "essay":"Pls accept me"\n },\n "status":"Applied",\n "ethnicity":["White or Caucasian"," Asian or Pacific Islander"],\n "accountId":"5bff2a35e533b0f6562b4998",\n "school":"McPherson College",\n "gender":"Female",\n "needsBus":false,\n "major":["Accounting"],\n "graduationYear":2019,\n "codeOfConduct":true,\n } \n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Hacker not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/hacker.js", + groupTitle: "Hacker", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/hacker/self" + } + ] + }, + { + type: "get", + url: "/", + title: "version", + version: "0.0.8", + name: "index", + group: "Index", + permission: [ + { + name: "public" + } + ], + filename: "routes/index.js", + groupTitle: "Index", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/" + } + ] + }, + { + type: "post", + url: "/api/role/", + title: "create a new role", + name: "createRole", + group: "Role", + version: "1.1.1", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: false, + field: "name", + description: "

Name of the route

" + }, + { + group: "body", + type: "Route[]", + optional: false, + field: "routes", + description: + "

The routes that this role gives access to

" + } + ] + }, + examples: [ + { + title: "application: ", + content: + '{\n "name": "routename",\n "routes": [\n {\n uri: "/api/hacker/"\n requestType: "POST"\n }\n ]\n}', + type: "Json" + } + ] + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Role object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Role creation successful", \n "data": {\n "name": "routename",\n "routes": [\n {\n uri: "/api/hacker/"\n requestType: "POST"\n }\n ]\n }\n}', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while creating role", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/role.js", + groupTitle: "Role", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/api/role/" + } + ] + }, + { + type: "get", + url: "/search/", + title: "provide a specific query for any defined model", + name: "search", + group: "Search", + version: "0.0.8", + parameter: { + fields: { + query: [ + { + group: "query", + type: "String", + optional: false, + field: "model", + description: "

the model to be searched

" + }, + { + group: "query", + type: "Array", + optional: false, + field: "q", + description: + "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + }, + { + group: "query", + type: "String", + optional: false, + field: "sort", + description: + "

either "asc" or "desc"

" + }, + { + group: "query", + type: "number", + optional: false, + field: "page", + description: + "

the page number that you would like

" + }, + { + group: "query", + type: "number", + optional: false, + field: "limit", + description: + "

the maximum number of results that you would like returned

" + }, + { + group: "query", + type: "any", + optional: false, + field: "sort_by", + description: + "

any parameter you want to sort the results by

" + }, + { + group: "query", + type: "boolean", + optional: false, + field: "expand", + description: + "

whether you want to expand sub documents within the results

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Results

" + } + ] + }, + examples: [ + { + title: "Success-Response:", + content: + '{\n "message": "Successfully executed query, returning all results",\n "data": [\n {...}\n ]\n }', + type: "object" + }, + { + title: "Success-Response:", + content: + '{\n "message": "No results found.",\n "data": {}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response:", + content: '{"message": "Validation failed", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/search.js", + groupTitle: "Search", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/search/" + } + ] + }, + { + type: "get", + url: "/settings/", + title: "Get the settings for the current hackathon", + name: "getSettings", + group: "Settings", + version: "1.1.1", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Settings Object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Settings creation successful.", \n "data": {\n "settings": {\n openTime: "Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)",\n closeTime: "Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)",\n confirmTime: "Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)"\n }\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "public" + } + ], + filename: "routes/api/settings.js", + groupTitle: "Settings", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + type: "patch", + url: "/settings/", + title: "Patch the settings for the current hackathon", + name: "patchSettings", + group: "Settings", + version: "1.1.1", + parameter: { + fields: { + body: [ + { + group: "body", + type: "Date", + optional: true, + field: "openTime", + description: + "

The opening time for the hackathon.

" + }, + { + group: "body", + type: "Date", + optional: true, + field: "closeTime", + description: + "

The closing time for the hackathon.

" + }, + { + group: "body", + type: "Date", + optional: true, + field: "confirmTime", + description: + "

The deadline for confirmation for the hackathon.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Settings Object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Settings patch successful.", \n "data": {\n "settings": {\n openTime: "Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)",\n closeTime: "Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)",\n confirmTime: "Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)"\n }\n }\n}', + type: "object" + } + ] + }, + permission: [ + { + name: "Administrators" + } + ], + filename: "routes/api/settings.js", + groupTitle: "Settings", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + type: "post", + url: "/sponsor/", + title: "create a new sponsor", + name: "createSponsor", + group: "Sponsor", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "MongoID", + optional: false, + field: "accountId", + description: + "

ObjectID of the respective account.

" + }, + { + group: "body", + type: "Number", + optional: false, + field: "tier", + description: + "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "company", + description: "

Name of the company.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "contractURL", + description: + "

URL link to the contract with the company.

" + }, + { + group: "body", + type: "MongoID[]", + optional: false, + field: "nominees", + description: + "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Sponsor creation successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while creating sponsor", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/sponsor.js", + groupTitle: "Sponsor", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + type: "get", + url: "/sponsor/:id", + title: "get a sponsor's information", + name: "getSponsor", + group: "Sponsor", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "string", + optional: false, + field: "id", + description: "

a sponsor's unique mongoID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved sponsor information", \n "data": {\n "id": "5bff4d736f86be0a41badb91",\n "accountId": "5bff4d736f86be0a41badb99",\n "tier": 3,\n "company": "companyName",\n "contractURL": "https://www.contractHere.com",\n "nominees": ["5bff4d736f86be0a41badb93","5bff4d736f86be0a41badb94"]\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Sponsor not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/sponsor.js", + groupTitle: "Sponsor", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/:id" + } + ] + }, + { + type: "patch", + url: "/sponsor/", + title: "update a sponsor", + name: "patchSponsor", + group: "Sponsor", + version: "1.3.0", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

ObjectID of the sponsor

" + } + ], + body: [ + { + group: "body", + type: "String", + optional: false, + field: "company", + description: "

Name of the company.

" + }, + { + group: "body", + type: "String", + optional: false, + field: "contractURL", + description: + "

URL link to the contract with the company.

" + }, + { + group: "body", + type: "ObjectId[]", + optional: false, + field: "nominees", + description: + "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Sponsor object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Sponsor update successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while updating sponsor", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/sponsor.js", + groupTitle: "Sponsor", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + type: "post", + url: "/team/", + title: "create a new team consisting of only the logged in user", + name: "createTeam", + group: "Team", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "String", + optional: false, + field: "name", + description: "

Name of the team.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "devpostURL", + description: + "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" + }, + { + group: "body", + type: "String", + optional: true, + field: "projectName", + description: "

Name of the team.

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Team object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team creation successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while creating team", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/" + } + ] + }, + { + type: "patch", + url: "/team/leave/", + title: "Allows a logged in hacker to leave current team", + name: "deleteSelfFromTeam", + group: "Team", + version: "1.1.1", + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

{}

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Removal from team successful.", \n "data": {}\n}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/leave/" + } + ] + }, + { + type: "get", + url: "/team/:id", + title: "get a team's information", + name: "getTeam", + group: "Team", + version: "0.0.8", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

MongoId of the team

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Team object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team retrieval successful", \n "data": { \n "team": {\n "name":"foo",\n "members": [\n ObjectId(\'...\')\n ],\n "devpostURL": "www.devpost.com/foo",\n "projectName": "fooey"\n },\n "members": [\n {\n "firstName": "John",\n "lastName": "Doe"\n }\n ],\n }\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: '{"message": "Team not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/:id" + } + ] + }, + { + type: "patch", + url: "/team/join/", + title: "Allows a logged in hacker to join a team by name", + name: "patchJoinTeam", + group: "Team", + version: "1.1.1", + parameter: { + fields: { + body: [ + { + group: "body", + type: "string", + optional: true, + field: "name", + description: "

Name of the team to join

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

{}

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team join successful.", \n "data": {}\n}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/join/" + } + ] + }, + { + type: "patch", + url: "/team/:hackerId", + title: + "Update a team's information. The team is specified by the hacker belonging to it.", + name: "patchTeam", + group: "Team", + version: "0.0.8", + description: + "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "hackerId", + description: "

a hacker's unique Id

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Team object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Team update successful.", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: + "

Query input that caused the error.

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Team not found", "data": {teamId}}', + type: "object" + } + ] + }, + filename: "routes/api/team.js", + groupTitle: "Team", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/team/:hackerId" + } + ] + }, + { + type: "post", + url: "/volunteer/", + title: "create a new volunteer", + name: "createVolunteer", + group: "Volunteer", + version: "0.0.8", + parameter: { + fields: { + body: [ + { + group: "body", + type: "MongoID", + optional: false, + field: "accountId", + description: + "

MongoID of the account of the volunteer

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "string", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "object", + optional: false, + field: "data", + description: "

Volunteer object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Volunteer creation successful", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "string", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Error while creating volunteer", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/volunteer.js", + groupTitle: "Volunteer", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/volunteer/" + } + ] + }, + { + type: "get", + url: "/volunteer/:id", + title: "get a volunteer's information", + name: "getVolunteer", + group: "Volunteer", + version: "1.3.0", + parameter: { + fields: { + param: [ + { + group: "param", + type: "ObjectId", + optional: false, + field: "id", + description: "

a volunteer's unique mongoID

" + } + ] + } + }, + success: { + fields: { + "Success 200": [ + { + group: "Success 200", + type: "String", + optional: false, + field: "message", + description: "

Success message

" + }, + { + group: "Success 200", + type: "Object", + optional: false, + field: "data", + description: "

Volunteer object

" + } + ] + }, + examples: [ + { + title: "Success-Response: ", + content: + '{\n "message": "Successfully retrieved volunteer information", \n "data": {...}\n }', + type: "object" + } + ] + }, + error: { + fields: { + "Error 4xx": [ + { + group: "Error 4xx", + type: "String", + optional: false, + field: "message", + description: "

Error message

" + }, + { + group: "Error 4xx", + type: "Object", + optional: false, + field: "data", + description: "

empty

" + } + ] + }, + examples: [ + { + title: "Error-Response: ", + content: + '{"message": "Volunteer not found", "data": {}}', + type: "object" + } + ] + }, + filename: "routes/api/volunteer.js", + groupTitle: "Volunteer", + sampleRequest: [ + { + url: "https://api.mchacks.ca/api/volunteer/:id" + } + ] + } + ] +}); diff --git a/docs/api/api_project.js b/docs/api/api_project.js index 0d68be91..20d06ee4 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -1,16 +1,16 @@ define({ - "name": "hackerAPI", - "version": "0.0.8", - "description": "Documentation for the API used for mchacks", - "defaultVersion": "0.0.8", - "title": "hackerAPI documentation", - "url": "https://api.mchacks.ca/api", - "sampleUrl": "https://api.mchacks.ca/api", - "apidoc": "0.3.0", - "generator": { - "name": "apidoc", - "time": "2019-05-06T17:36:31.903Z", - "url": "http://apidocjs.com", - "version": "0.17.7" - } -}); \ No newline at end of file + name: "hackerAPI", + version: "0.0.8", + description: "Documentation for the API used for mchacks", + defaultVersion: "0.0.8", + title: "hackerAPI documentation", + url: "https://api.mchacks.ca/api", + sampleUrl: "https://api.mchacks.ca/api", + apidoc: "0.3.0", + generator: { + name: "apidoc", + time: "2019-05-06T17:36:31.903Z", + url: "http://apidocjs.com", + version: "0.17.7" + } +}); diff --git a/docs/api/locales/ca.js b/docs/api/locales/ca.js index 65af5df2..c63484e5 100644 --- a/docs/api/locales/ca.js +++ b/docs/api/locales/ca.js @@ -1,25 +1,25 @@ define({ ca: { - 'Allowed values:' : 'Valors permesos:', - 'Compare all with predecessor': 'Comparar tot amb versió anterior', - 'compare changes to:' : 'comparar canvis amb:', - 'compared to' : 'comparat amb', - 'Default value:' : 'Valor per defecte:', - 'Description' : 'Descripció', - 'Field' : 'Camp', - 'General' : 'General', - 'Generated with' : 'Generat amb', - 'Name' : 'Nom', - 'No response values.' : 'Sense valors en la resposta.', - 'optional' : 'opcional', - 'Parameter' : 'Paràmetre', - 'Permission:' : 'Permisos:', - 'Response' : 'Resposta', - 'Send' : 'Enviar', - 'Send a Sample Request' : 'Enviar una petició d\'exemple', - 'show up to version:' : 'mostrar versió:', - 'Size range:' : 'Tamany de rang:', - 'Type' : 'Tipus', - 'url' : 'url' + "Allowed values:": "Valors permesos:", + "Compare all with predecessor": "Comparar tot amb versió anterior", + "compare changes to:": "comparar canvis amb:", + "compared to": "comparat amb", + "Default value:": "Valor per defecte:", + Description: "Descripció", + Field: "Camp", + General: "General", + "Generated with": "Generat amb", + Name: "Nom", + "No response values.": "Sense valors en la resposta.", + optional: "opcional", + Parameter: "Paràmetre", + "Permission:": "Permisos:", + Response: "Resposta", + Send: "Enviar", + "Send a Sample Request": "Enviar una petició d'exemple", + "show up to version:": "mostrar versió:", + "Size range:": "Tamany de rang:", + Type: "Tipus", + url: "url" } }); diff --git a/docs/api/locales/cs.js b/docs/api/locales/cs.js index 093a24b1..368c69e7 100644 --- a/docs/api/locales/cs.js +++ b/docs/api/locales/cs.js @@ -1,25 +1,25 @@ define({ cs: { - 'Allowed values:': 'Povolené hodnoty:', - 'Compare all with predecessor': 'Porovnat vše s předchozími verzemi', - 'compare changes to:': 'porovnat změny s:', - 'compared to': 'porovnat s', - 'Default value:': 'Výchozí hodnota:', - 'Description': 'Popis', - 'Field': 'Pole', - 'General': 'Obecné', - 'Generated with': 'Vygenerováno pomocí', - 'Name': 'Název', - 'No response values.': 'Nebyly vráceny žádné hodnoty.', - 'optional': 'volitelné', - 'Parameter': 'Parametr', - 'Permission:': 'Oprávnění:', - 'Response': 'Odpověď', - 'Send': 'Odeslat', - 'Send a Sample Request': 'Odeslat ukázkový požadavek', - 'show up to version:': 'zobrazit po verzi:', - 'Size range:': 'Rozsah velikosti:', - 'Type': 'Typ', - 'url': 'url' + "Allowed values:": "Povolené hodnoty:", + "Compare all with predecessor": "Porovnat vše s předchozími verzemi", + "compare changes to:": "porovnat změny s:", + "compared to": "porovnat s", + "Default value:": "Výchozí hodnota:", + Description: "Popis", + Field: "Pole", + General: "Obecné", + "Generated with": "Vygenerováno pomocí", + Name: "Název", + "No response values.": "Nebyly vráceny žádné hodnoty.", + optional: "volitelné", + Parameter: "Parametr", + "Permission:": "Oprávnění:", + Response: "Odpověď", + Send: "Odeslat", + "Send a Sample Request": "Odeslat ukázkový požadavek", + "show up to version:": "zobrazit po verzi:", + "Size range:": "Rozsah velikosti:", + Type: "Typ", + url: "url" } -}); \ No newline at end of file +}); diff --git a/docs/api/locales/de.js b/docs/api/locales/de.js index f66420d0..f238d855 100644 --- a/docs/api/locales/de.js +++ b/docs/api/locales/de.js @@ -1,25 +1,25 @@ define({ de: { - 'Allowed values:' : 'Erlaubte Werte:', - 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', - 'compare changes to:' : 'vergleiche Änderungen mit:', - 'compared to' : 'verglichen mit', - 'Default value:' : 'Standardwert:', - 'Description' : 'Beschreibung', - 'Field' : 'Feld', - 'General' : 'Allgemein', - 'Generated with' : 'Erstellt mit', - 'Name' : 'Name', - 'No response values.' : 'Keine Rückgabewerte.', - 'optional' : 'optional', - 'Parameter' : 'Parameter', - 'Permission:' : 'Berechtigung:', - 'Response' : 'Antwort', - 'Send' : 'Senden', - 'Send a Sample Request' : 'Eine Beispielanfrage senden', - 'show up to version:' : 'zeige bis zur Version:', - 'Size range:' : 'Größenbereich:', - 'Type' : 'Typ', - 'url' : 'url' + "Allowed values:": "Erlaubte Werte:", + "Compare all with predecessor": "Vergleiche alle mit ihren Vorgängern", + "compare changes to:": "vergleiche Änderungen mit:", + "compared to": "verglichen mit", + "Default value:": "Standardwert:", + Description: "Beschreibung", + Field: "Feld", + General: "Allgemein", + "Generated with": "Erstellt mit", + Name: "Name", + "No response values.": "Keine Rückgabewerte.", + optional: "optional", + Parameter: "Parameter", + "Permission:": "Berechtigung:", + Response: "Antwort", + Send: "Senden", + "Send a Sample Request": "Eine Beispielanfrage senden", + "show up to version:": "zeige bis zur Version:", + "Size range:": "Größenbereich:", + Type: "Typ", + url: "url" } }); diff --git a/docs/api/locales/es.js b/docs/api/locales/es.js index 3d47e800..ecb729ef 100644 --- a/docs/api/locales/es.js +++ b/docs/api/locales/es.js @@ -1,25 +1,25 @@ define({ es: { - 'Allowed values:' : 'Valores permitidos:', - 'Compare all with predecessor': 'Comparar todo con versión anterior', - 'compare changes to:' : 'comparar cambios con:', - 'compared to' : 'comparado con', - 'Default value:' : 'Valor por defecto:', - 'Description' : 'Descripción', - 'Field' : 'Campo', - 'General' : 'General', - 'Generated with' : 'Generado con', - 'Name' : 'Nombre', - 'No response values.' : 'Sin valores en la respuesta.', - 'optional' : 'opcional', - 'Parameter' : 'Parámetro', - 'Permission:' : 'Permisos:', - 'Response' : 'Respuesta', - 'Send' : 'Enviar', - 'Send a Sample Request' : 'Enviar una petición de ejemplo', - 'show up to version:' : 'mostrar a versión:', - 'Size range:' : 'Tamaño de rango:', - 'Type' : 'Tipo', - 'url' : 'url' + "Allowed values:": "Valores permitidos:", + "Compare all with predecessor": "Comparar todo con versión anterior", + "compare changes to:": "comparar cambios con:", + "compared to": "comparado con", + "Default value:": "Valor por defecto:", + Description: "Descripción", + Field: "Campo", + General: "General", + "Generated with": "Generado con", + Name: "Nombre", + "No response values.": "Sin valores en la respuesta.", + optional: "opcional", + Parameter: "Parámetro", + "Permission:": "Permisos:", + Response: "Respuesta", + Send: "Enviar", + "Send a Sample Request": "Enviar una petición de ejemplo", + "show up to version:": "mostrar a versión:", + "Size range:": "Tamaño de rango:", + Type: "Tipo", + url: "url" } }); diff --git a/docs/api/locales/fr.js b/docs/api/locales/fr.js index 100a6429..27ac480f 100644 --- a/docs/api/locales/fr.js +++ b/docs/api/locales/fr.js @@ -1,25 +1,25 @@ define({ fr: { - 'Allowed values:' : 'Valeurs autorisées :', - 'Compare all with predecessor': 'Tout comparer avec ...', - 'compare changes to:' : 'comparer les changements à :', - 'compared to' : 'comparer à', - 'Default value:' : 'Valeur par défaut :', - 'Description' : 'Description', - 'Field' : 'Champ', - 'General' : 'Général', - 'Generated with' : 'Généré avec', - 'Name' : 'Nom', - 'No response values.' : 'Aucune valeur de réponse.', - 'optional' : 'optionnel', - 'Parameter' : 'Paramètre', - 'Permission:' : 'Permission :', - 'Response' : 'Réponse', - 'Send' : 'Envoyer', - 'Send a Sample Request' : 'Envoyer une requête représentative', - 'show up to version:' : 'Montrer à partir de la version :', - 'Size range:' : 'Ordre de grandeur :', - 'Type' : 'Type', - 'url' : 'url' + "Allowed values:": "Valeurs autorisées :", + "Compare all with predecessor": "Tout comparer avec ...", + "compare changes to:": "comparer les changements à :", + "compared to": "comparer à", + "Default value:": "Valeur par défaut :", + Description: "Description", + Field: "Champ", + General: "Général", + "Generated with": "Généré avec", + Name: "Nom", + "No response values.": "Aucune valeur de réponse.", + optional: "optionnel", + Parameter: "Paramètre", + "Permission:": "Permission :", + Response: "Réponse", + Send: "Envoyer", + "Send a Sample Request": "Envoyer une requête représentative", + "show up to version:": "Montrer à partir de la version :", + "Size range:": "Ordre de grandeur :", + Type: "Type", + url: "url" } }); diff --git a/docs/api/locales/it.js b/docs/api/locales/it.js index 8117108c..15053923 100644 --- a/docs/api/locales/it.js +++ b/docs/api/locales/it.js @@ -1,25 +1,26 @@ define({ it: { - 'Allowed values:' : 'Valori permessi:', - 'Compare all with predecessor': 'Confronta tutto con versioni precedenti', - 'compare changes to:' : 'confronta modifiche con:', - 'compared to' : 'confrontato con', - 'Default value:' : 'Valore predefinito:', - 'Description' : 'Descrizione', - 'Field' : 'Campo', - 'General' : 'Generale', - 'Generated with' : 'Creato con', - 'Name' : 'Nome', - 'No response values.' : 'Nessun valore di risposta.', - 'optional' : 'opzionale', - 'Parameter' : 'Parametro', - 'Permission:' : 'Permessi:', - 'Response' : 'Risposta', - 'Send' : 'Invia', - 'Send a Sample Request' : 'Invia una richiesta di esempio', - 'show up to version:' : 'mostra alla versione:', - 'Size range:' : 'Intervallo dimensione:', - 'Type' : 'Tipo', - 'url' : 'url' + "Allowed values:": "Valori permessi:", + "Compare all with predecessor": + "Confronta tutto con versioni precedenti", + "compare changes to:": "confronta modifiche con:", + "compared to": "confrontato con", + "Default value:": "Valore predefinito:", + Description: "Descrizione", + Field: "Campo", + General: "Generale", + "Generated with": "Creato con", + Name: "Nome", + "No response values.": "Nessun valore di risposta.", + optional: "opzionale", + Parameter: "Parametro", + "Permission:": "Permessi:", + Response: "Risposta", + Send: "Invia", + "Send a Sample Request": "Invia una richiesta di esempio", + "show up to version:": "mostra alla versione:", + "Size range:": "Intervallo dimensione:", + Type: "Tipo", + url: "url" } }); diff --git a/docs/api/locales/locale.js b/docs/api/locales/locale.js index 880a96cf..c6259068 100644 --- a/docs/api/locales/locale.js +++ b/docs/api/locales/locale.js @@ -1,21 +1,23 @@ define([ - './locales/ca.js', - './locales/cs.js', - './locales/de.js', - './locales/es.js', - './locales/fr.js', - './locales/it.js', - './locales/nl.js', - './locales/pl.js', - './locales/pt_br.js', - './locales/ro.js', - './locales/ru.js', - './locales/tr.js', - './locales/vi.js', - './locales/zh.js', - './locales/zh_cn.js' -], function () { - var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); + "./locales/ca.js", + "./locales/cs.js", + "./locales/de.js", + "./locales/es.js", + "./locales/fr.js", + "./locales/it.js", + "./locales/nl.js", + "./locales/pl.js", + "./locales/pt_br.js", + "./locales/ro.js", + "./locales/ru.js", + "./locales/tr.js", + "./locales/vi.js", + "./locales/zh.js", + "./locales/zh_cn.js" +], function() { + var langId = (navigator.language || navigator.userLanguage) + .toLowerCase() + .replace("-", "_"); var language = langId.substr(0, 2); var locales = {}; @@ -23,20 +25,17 @@ define([ for (property in arguments[index]) locales[property] = arguments[index][property]; } - if (!locales['en']) - locales['en'] = {}; + if (!locales["en"]) locales["en"] = {}; - if (!locales[langId] && !locales[language]) - language = 'en'; + if (!locales[langId] && !locales[language]) language = "en"; - var locale = (locales[langId] ? locales[langId] : locales[language]); + var locale = locales[langId] ? locales[langId] : locales[language]; function __(text) { var index = locale[text]; - if (index === undefined) - return text; + if (index === undefined) return text; return index; - }; + } function setLanguage(language) { locale = locales[language]; @@ -48,4 +47,4 @@ define([ locale: locale, setLanguage: setLanguage }; -}); \ No newline at end of file +}); diff --git a/docs/api/locales/nl.js b/docs/api/locales/nl.js index bddfeeb1..c64b6d06 100644 --- a/docs/api/locales/nl.js +++ b/docs/api/locales/nl.js @@ -1,25 +1,25 @@ define({ nl: { - 'Allowed values:' : 'Toegestane waarden:', - 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', - 'compare changes to:' : 'vergelijk veranderingen met:', - 'compared to' : 'vergelijk met', - 'Default value:' : 'Standaard waarde:', - 'Description' : 'Omschrijving', - 'Field' : 'Veld', - 'General' : 'Algemeen', - 'Generated with' : 'Gegenereerd met', - 'Name' : 'Naam', - 'No response values.' : 'Geen response waardes.', - 'optional' : 'optioneel', - 'Parameter' : 'Parameter', - 'Permission:' : 'Permissie:', - 'Response' : 'Antwoorden', - 'Send' : 'Sturen', - 'Send a Sample Request' : 'Stuur een sample aanvragen', - 'show up to version:' : 'toon tot en met versie:', - 'Size range:' : 'Maatbereik:', - 'Type' : 'Type', - 'url' : 'url' + "Allowed values:": "Toegestane waarden:", + "Compare all with predecessor": "Vergelijk alle met voorgaande versie", + "compare changes to:": "vergelijk veranderingen met:", + "compared to": "vergelijk met", + "Default value:": "Standaard waarde:", + Description: "Omschrijving", + Field: "Veld", + General: "Algemeen", + "Generated with": "Gegenereerd met", + Name: "Naam", + "No response values.": "Geen response waardes.", + optional: "optioneel", + Parameter: "Parameter", + "Permission:": "Permissie:", + Response: "Antwoorden", + Send: "Sturen", + "Send a Sample Request": "Stuur een sample aanvragen", + "show up to version:": "toon tot en met versie:", + "Size range:": "Maatbereik:", + Type: "Type", + url: "url" } }); diff --git a/docs/api/locales/pl.js b/docs/api/locales/pl.js index db645ee1..bb7e69fc 100644 --- a/docs/api/locales/pl.js +++ b/docs/api/locales/pl.js @@ -1,25 +1,25 @@ define({ pl: { - 'Allowed values:' : 'Dozwolone wartości:', - 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', - 'compare changes to:' : 'porównaj zmiany do:', - 'compared to' : 'porównaj do:', - 'Default value:' : 'Wartość domyślna:', - 'Description' : 'Opis', - 'Field' : 'Pole', - 'General' : 'Generalnie', - 'Generated with' : 'Wygenerowano z', - 'Name' : 'Nazwa', - 'No response values.' : 'Brak odpowiedzi.', - 'optional' : 'opcjonalny', - 'Parameter' : 'Parametr', - 'Permission:' : 'Uprawnienia:', - 'Response' : 'Odpowiedź', - 'Send' : 'Wyślij', - 'Send a Sample Request' : 'Wyślij przykładowe żądanie', - 'show up to version:' : 'pokaż do wersji:', - 'Size range:' : 'Zakres rozmiaru:', - 'Type' : 'Typ', - 'url' : 'url' + "Allowed values:": "Dozwolone wartości:", + "Compare all with predecessor": "Porównaj z poprzednimi wersjami", + "compare changes to:": "porównaj zmiany do:", + "compared to": "porównaj do:", + "Default value:": "Wartość domyślna:", + Description: "Opis", + Field: "Pole", + General: "Generalnie", + "Generated with": "Wygenerowano z", + Name: "Nazwa", + "No response values.": "Brak odpowiedzi.", + optional: "opcjonalny", + Parameter: "Parametr", + "Permission:": "Uprawnienia:", + Response: "Odpowiedź", + Send: "Wyślij", + "Send a Sample Request": "Wyślij przykładowe żądanie", + "show up to version:": "pokaż do wersji:", + "Size range:": "Zakres rozmiaru:", + Type: "Typ", + url: "url" } }); diff --git a/docs/api/locales/pt_br.js b/docs/api/locales/pt_br.js index 2bd78b0d..30bd0f3d 100644 --- a/docs/api/locales/pt_br.js +++ b/docs/api/locales/pt_br.js @@ -1,25 +1,25 @@ define({ - 'pt_br': { - 'Allowed values:' : 'Valores permitidos:', - 'Compare all with predecessor': 'Compare todos com antecessores', - 'compare changes to:' : 'comparar alterações com:', - 'compared to' : 'comparado com', - 'Default value:' : 'Valor padrão:', - 'Description' : 'Descrição', - 'Field' : 'Campo', - 'General' : 'Geral', - 'Generated with' : 'Gerado com', - 'Name' : 'Nome', - 'No response values.' : 'Sem valores de resposta.', - 'optional' : 'opcional', - 'Parameter' : 'Parâmetro', - 'Permission:' : 'Permissão:', - 'Response' : 'Resposta', - 'Send' : 'Enviar', - 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', - 'show up to version:' : 'aparecer para a versão:', - 'Size range:' : 'Faixa de tamanho:', - 'Type' : 'Tipo', - 'url' : 'url' + pt_br: { + "Allowed values:": "Valores permitidos:", + "Compare all with predecessor": "Compare todos com antecessores", + "compare changes to:": "comparar alterações com:", + "compared to": "comparado com", + "Default value:": "Valor padrão:", + Description: "Descrição", + Field: "Campo", + General: "Geral", + "Generated with": "Gerado com", + Name: "Nome", + "No response values.": "Sem valores de resposta.", + optional: "opcional", + Parameter: "Parâmetro", + "Permission:": "Permissão:", + Response: "Resposta", + Send: "Enviar", + "Send a Sample Request": "Enviar um Exemplo de Pedido", + "show up to version:": "aparecer para a versão:", + "Size range:": "Faixa de tamanho:", + Type: "Tipo", + url: "url" } }); diff --git a/docs/api/locales/ro.js b/docs/api/locales/ro.js index 8d4e4ed8..0039c00d 100644 --- a/docs/api/locales/ro.js +++ b/docs/api/locales/ro.js @@ -1,25 +1,25 @@ define({ ro: { - 'Allowed values:' : 'Valori permise:', - 'Compare all with predecessor': 'Compară toate cu versiunea precedentă', - 'compare changes to:' : 'compară cu versiunea:', - 'compared to' : 'comparat cu', - 'Default value:' : 'Valoare implicită:', - 'Description' : 'Descriere', - 'Field' : 'Câmp', - 'General' : 'General', - 'Generated with' : 'Generat cu', - 'Name' : 'Nume', - 'No response values.' : 'Nici o valoare returnată.', - 'optional' : 'opțional', - 'Parameter' : 'Parametru', - 'Permission:' : 'Permisiune:', - 'Response' : 'Răspuns', - 'Send' : 'Trimite', - 'Send a Sample Request' : 'Trimite o cerere de probă', - 'show up to version:' : 'arată până la versiunea:', - 'Size range:' : 'Interval permis:', - 'Type' : 'Tip', - 'url' : 'url' + "Allowed values:": "Valori permise:", + "Compare all with predecessor": "Compară toate cu versiunea precedentă", + "compare changes to:": "compară cu versiunea:", + "compared to": "comparat cu", + "Default value:": "Valoare implicită:", + Description: "Descriere", + Field: "Câmp", + General: "General", + "Generated with": "Generat cu", + Name: "Nume", + "No response values.": "Nici o valoare returnată.", + optional: "opțional", + Parameter: "Parametru", + "Permission:": "Permisiune:", + Response: "Răspuns", + Send: "Trimite", + "Send a Sample Request": "Trimite o cerere de probă", + "show up to version:": "arată până la versiunea:", + "Size range:": "Interval permis:", + Type: "Tip", + url: "url" } }); diff --git a/docs/api/locales/ru.js b/docs/api/locales/ru.js index c5f33821..fd87310a 100644 --- a/docs/api/locales/ru.js +++ b/docs/api/locales/ru.js @@ -1,25 +1,25 @@ define({ ru: { - 'Allowed values:' : 'Допустимые значения:', - 'Compare all with predecessor': 'Сравнить с предыдущей версией', - 'compare changes to:' : 'сравнить с:', - 'compared to' : 'в сравнении с', - 'Default value:' : 'По умолчанию:', - 'Description' : 'Описание', - 'Field' : 'Название', - 'General' : 'Общая информация', - 'Generated with' : 'Сгенерировано с помощью', - 'Name' : 'Название', - 'No response values.' : 'Нет значений для ответа.', - 'optional' : 'необязательный', - 'Parameter' : 'Параметр', - 'Permission:' : 'Разрешено:', - 'Response' : 'Ответ', - 'Send' : 'Отправить', - 'Send a Sample Request' : 'Отправить тестовый запрос', - 'show up to version:' : 'показать версию:', - 'Size range:' : 'Ограничения:', - 'Type' : 'Тип', - 'url' : 'URL' + "Allowed values:": "Допустимые значения:", + "Compare all with predecessor": "Сравнить с предыдущей версией", + "compare changes to:": "сравнить с:", + "compared to": "в сравнении с", + "Default value:": "По умолчанию:", + Description: "Описание", + Field: "Название", + General: "Общая информация", + "Generated with": "Сгенерировано с помощью", + Name: "Название", + "No response values.": "Нет значений для ответа.", + optional: "необязательный", + Parameter: "Параметр", + "Permission:": "Разрешено:", + Response: "Ответ", + Send: "Отправить", + "Send a Sample Request": "Отправить тестовый запрос", + "show up to version:": "показать версию:", + "Size range:": "Ограничения:", + Type: "Тип", + url: "URL" } }); diff --git a/docs/api/locales/tr.js b/docs/api/locales/tr.js index 5c64e52d..5b89388b 100644 --- a/docs/api/locales/tr.js +++ b/docs/api/locales/tr.js @@ -1,25 +1,25 @@ define({ tr: { - 'Allowed values:' : 'İzin verilen değerler:', - 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır', - 'compare changes to:' : 'değişiklikleri karşılaştır:', - 'compared to' : 'karşılaştır', - 'Default value:' : 'Varsayılan değer:', - 'Description' : 'Açıklama', - 'Field' : 'Alan', - 'General' : 'Genel', - 'Generated with' : 'Oluşturan', - 'Name' : 'İsim', - 'No response values.' : 'Dönüş verisi yok.', - 'optional' : 'opsiyonel', - 'Parameter' : 'Parametre', - 'Permission:' : 'İzin:', - 'Response' : 'Dönüş', - 'Send' : 'Gönder', - 'Send a Sample Request' : 'Örnek istek gönder', - 'show up to version:' : 'bu versiyona kadar göster:', - 'Size range:' : 'Boyut aralığı:', - 'Type' : 'Tip', - 'url' : 'url' + "Allowed values:": "İzin verilen değerler:", + "Compare all with predecessor": "Tümünü öncekiler ile karşılaştır", + "compare changes to:": "değişiklikleri karşılaştır:", + "compared to": "karşılaştır", + "Default value:": "Varsayılan değer:", + Description: "Açıklama", + Field: "Alan", + General: "Genel", + "Generated with": "Oluşturan", + Name: "İsim", + "No response values.": "Dönüş verisi yok.", + optional: "opsiyonel", + Parameter: "Parametre", + "Permission:": "İzin:", + Response: "Dönüş", + Send: "Gönder", + "Send a Sample Request": "Örnek istek gönder", + "show up to version:": "bu versiyona kadar göster:", + "Size range:": "Boyut aralığı:", + Type: "Tip", + url: "url" } }); diff --git a/docs/api/locales/vi.js b/docs/api/locales/vi.js index 7ce77050..cddc87a1 100644 --- a/docs/api/locales/vi.js +++ b/docs/api/locales/vi.js @@ -1,25 +1,25 @@ define({ vi: { - 'Allowed values:' : 'Giá trị chấp nhận:', - 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước', - 'compare changes to:' : 'so sánh sự thay đổi với:', - 'compared to' : 'so sánh với', - 'Default value:' : 'Giá trị mặc định:', - 'Description' : 'Chú thích', - 'Field' : 'Trường dữ liệu', - 'General' : 'Tổng quan', - 'Generated with' : 'Được tạo bởi', - 'Name' : 'Tên', - 'No response values.' : 'Không có kết quả trả về.', - 'optional' : 'Tùy chọn', - 'Parameter' : 'Tham số', - 'Permission:' : 'Quyền hạn:', - 'Response' : 'Kết quả', - 'Send' : 'Gửi', - 'Send a Sample Request' : 'Gửi một yêu cầu mẫu', - 'show up to version:' : 'hiển thị phiên bản:', - 'Size range:' : 'Kích cỡ:', - 'Type' : 'Kiểu', - 'url' : 'liên kết' + "Allowed values:": "Giá trị chấp nhận:", + "Compare all with predecessor": "So sánh với tất cả phiên bản trước", + "compare changes to:": "so sánh sự thay đổi với:", + "compared to": "so sánh với", + "Default value:": "Giá trị mặc định:", + Description: "Chú thích", + Field: "Trường dữ liệu", + General: "Tổng quan", + "Generated with": "Được tạo bởi", + Name: "Tên", + "No response values.": "Không có kết quả trả về.", + optional: "Tùy chọn", + Parameter: "Tham số", + "Permission:": "Quyền hạn:", + Response: "Kết quả", + Send: "Gửi", + "Send a Sample Request": "Gửi một yêu cầu mẫu", + "show up to version:": "hiển thị phiên bản:", + "Size range:": "Kích cỡ:", + Type: "Kiểu", + url: "liên kết" } }); diff --git a/docs/api/locales/zh.js b/docs/api/locales/zh.js index 66522067..1ecb496d 100644 --- a/docs/api/locales/zh.js +++ b/docs/api/locales/zh.js @@ -1,25 +1,25 @@ define({ zh: { - 'Allowed values​​:' : '允許值:', - 'Compare all with predecessor': '預先比較所有', - 'compare changes to:' : '比較變更:', - 'compared to' : '對比', - 'Default value:' : '默認值:', - 'Description' : '描述', - 'Field' : '字段', - 'General' : '概括', - 'Generated with' : '生成工具', - 'Name' : '名稱', - 'No response values​​.' : '無對應資料.', - 'optional' : '選項', - 'Parameter' : '參數', - 'Permission:' : '允許:', - 'Response' : '回應', - 'Send' : '發送', - 'Send a Sample Request' : '發送試用需求', - 'show up to version:' : '顯示到版本:', - 'Size range:' : '尺寸範圍:', - 'Type' : '類型', - 'url' : '網址' + "Allowed values​​:": "允許值:", + "Compare all with predecessor": "預先比較所有", + "compare changes to:": "比較變更:", + "compared to": "對比", + "Default value:": "默認值:", + Description: "描述", + Field: "字段", + General: "概括", + "Generated with": "生成工具", + Name: "名稱", + "No response values​​.": "無對應資料.", + optional: "選項", + Parameter: "參數", + "Permission:": "允許:", + Response: "回應", + Send: "發送", + "Send a Sample Request": "發送試用需求", + "show up to version:": "顯示到版本:", + "Size range:": "尺寸範圍:", + Type: "類型", + url: "網址" } }); diff --git a/docs/api/locales/zh_cn.js b/docs/api/locales/zh_cn.js index 1938ca18..fc6e1fc8 100644 --- a/docs/api/locales/zh_cn.js +++ b/docs/api/locales/zh_cn.js @@ -1,25 +1,25 @@ define({ - 'zh_cn': { - 'Allowed values:' : '允许值:', - 'Compare all with predecessor': '与所有较早的比较', - 'compare changes to:' : '将当前版本与指定版本比较:', - 'compared to' : '相比于', - 'Default value:' : '默认值:', - 'Description' : '描述', - 'Field' : '字段', - 'General' : '概要', - 'Generated with' : '基于', - 'Name' : '名称', - 'No response values.' : '无返回值.', - 'optional' : '可选', - 'Parameter' : '参数', - 'Permission:' : '权限:', - 'Response' : '返回', - 'Send' : '发送', - 'Send a Sample Request' : '发送示例请求', - 'show up to version:' : '显示到指定版本:', - 'Size range:' : '取值范围:', - 'Type' : '类型', - 'url' : '网址' + zh_cn: { + "Allowed values:": "允许值:", + "Compare all with predecessor": "与所有较早的比较", + "compare changes to:": "将当前版本与指定版本比较:", + "compared to": "相比于", + "Default value:": "默认值:", + Description: "描述", + Field: "字段", + General: "概要", + "Generated with": "基于", + Name: "名称", + "No response values.": "无返回值.", + optional: "可选", + Parameter: "参数", + "Permission:": "权限:", + Response: "返回", + Send: "发送", + "Send a Sample Request": "发送示例请求", + "show up to version:": "显示到指定版本:", + "Size range:": "取值范围:", + Type: "类型", + url: "网址" } }); diff --git a/docs/api/main.js b/docs/api/main.js index 9d31fa5f..1cd9e952 100644 --- a/docs/api/main.js +++ b/docs/api/main.js @@ -1,57 +1,67 @@ require.config({ paths: { - bootstrap: './vendor/bootstrap.min', - diffMatchPatch: './vendor/diff_match_patch.min', - handlebars: './vendor/handlebars.min', - handlebarsExtended: './utils/handlebars_helper', - jquery: './vendor/jquery.min', - locales: './locales/locale', - lodash: './vendor/lodash.custom.min', - pathToRegexp: './vendor/path-to-regexp/index', - prettify: './vendor/prettify/prettify', - semver: './vendor/semver.min', - utilsSampleRequest: './utils/send_sample_request', - webfontloader: './vendor/webfontloader', - list: './vendor/list.min' + bootstrap: "./vendor/bootstrap.min", + diffMatchPatch: "./vendor/diff_match_patch.min", + handlebars: "./vendor/handlebars.min", + handlebarsExtended: "./utils/handlebars_helper", + jquery: "./vendor/jquery.min", + locales: "./locales/locale", + lodash: "./vendor/lodash.custom.min", + pathToRegexp: "./vendor/path-to-regexp/index", + prettify: "./vendor/prettify/prettify", + semver: "./vendor/semver.min", + utilsSampleRequest: "./utils/send_sample_request", + webfontloader: "./vendor/webfontloader", + list: "./vendor/list.min" }, shim: { bootstrap: { - deps: ['jquery'] + deps: ["jquery"] }, diffMatchPatch: { - exports: 'diff_match_patch' + exports: "diff_match_patch" }, handlebars: { - exports: 'Handlebars' + exports: "Handlebars" }, handlebarsExtended: { - deps: ['jquery', 'handlebars'], - exports: 'Handlebars' + deps: ["jquery", "handlebars"], + exports: "Handlebars" }, prettify: { - exports: 'prettyPrint' + exports: "prettyPrint" } }, - urlArgs: 'v=' + (new Date()).getTime(), + urlArgs: "v=" + new Date().getTime(), waitSeconds: 15 }); require([ - 'jquery', - 'lodash', - 'locales', - 'handlebarsExtended', - './api_project.js', - './api_data.js', - 'prettify', - 'utilsSampleRequest', - 'semver', - 'webfontloader', - 'bootstrap', - 'pathToRegexp', - 'list' -], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) { - + "jquery", + "lodash", + "locales", + "handlebarsExtended", + "./api_project.js", + "./api_data.js", + "prettify", + "utilsSampleRequest", + "semver", + "webfontloader", + "bootstrap", + "pathToRegexp", + "list" +], function( + $, + _, + locale, + Handlebars, + apiProject, + apiData, + prettyPrint, + sampleRequest, + semver, + WebFont +) { // load google web fonts loadGoogleFontCss(); @@ -60,20 +70,21 @@ require([ // // Templates // - var templateHeader = Handlebars.compile( $('#template-header').html() ); - var templateFooter = Handlebars.compile( $('#template-footer').html() ); - var templateArticle = Handlebars.compile( $('#template-article').html() ); - var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() ); - var templateGenerator = Handlebars.compile( $('#template-generator').html() ); - var templateProject = Handlebars.compile( $('#template-project').html() ); - var templateSections = Handlebars.compile( $('#template-sections').html() ); - var templateSidenav = Handlebars.compile( $('#template-sidenav').html() ); + var templateHeader = Handlebars.compile($("#template-header").html()); + var templateFooter = Handlebars.compile($("#template-footer").html()); + var templateArticle = Handlebars.compile($("#template-article").html()); + var templateCompareArticle = Handlebars.compile( + $("#template-compare-article").html() + ); + var templateGenerator = Handlebars.compile($("#template-generator").html()); + var templateProject = Handlebars.compile($("#template-project").html()); + var templateSections = Handlebars.compile($("#template-sections").html()); + var templateSidenav = Handlebars.compile($("#template-sidenav").html()); // // apiProject defaults // - if ( ! apiProject.template) - apiProject.template = {}; + if (!apiProject.template) apiProject.template = {}; if (apiProject.template.withCompare == null) apiProject.template.withCompare = true; @@ -107,15 +118,17 @@ require([ // sort api within a group by title ASC and custom order // var newList = []; - var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0 - $.each (apiByGroupAndName, function(index, groupEntries) { + var umlauts = { ä: "ae", ü: "ue", ö: "oe", ß: "ss" }; // TODO: remove in version 1.0 + $.each(apiByGroupAndName, function(index, groupEntries) { // get titles from the first entry of group[].name[] (name has versioning) var titles = []; - $.each (groupEntries, function(titleName, entries) { + $.each(groupEntries, function(titleName, entries) { var title = entries[0].title; - if(title !== undefined) { - title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; }); - titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting + if (title !== undefined) { + title.toLowerCase().replace(/[äöüß]/g, function($0) { + return umlauts[$0]; + }); + titles.push(title + "#~#" + titleName); // '#~#' keep reference to titleName after sorting } }); // sort by name ASC @@ -123,11 +136,11 @@ require([ // custom order if (apiProject.order) - titles = sortByOrder(titles, apiProject.order, '#~#'); + titles = sortByOrder(titles, apiProject.order, "#~#"); // add single elements to the new list titles.forEach(function(name) { - var values = name.split('#~#'); + var values = name.split("#~#"); var key = values[1]; groupEntries[key].forEach(function(entry) { newList.push(entry); @@ -156,8 +169,7 @@ require([ apiGroups.sort(); // custom order - if (apiProject.order) - apiGroups = sortByOrder(apiGroups, apiProject.order); + if (apiProject.order) apiGroups = sortByOrder(apiGroups, apiProject.order); // sort versions DESC apiVersions = Object.keys(apiVersions); @@ -177,7 +189,7 @@ require([ }); // Submenu - var oldName = ''; + var oldName = ""; api.forEach(function(entry) { if (entry.group === group) { if (oldName !== entry.name) { @@ -212,39 +224,39 @@ require([ */ function add_nav(nav, content, index) { var found_level1 = false; - if ( ! content) { - return found_level1; + if (!content) { + return found_level1; } var topics = content.match(/(.+?)<\/h(1|2)>/gi); - if ( topics ) { - topics.forEach(function(entry) { - var level = entry.substring(2,3); - var title = entry.replace(/<.+?>/g, ''); // Remove all HTML tags for the title - var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/); // Find the group and name in the id property - var group = (entry_tags ? entry_tags[1] : null); - var name = (entry_tags ? entry_tags[2] : null); - if (level==1 && title && group) { - nav.splice(index, 0, { - group: group, - isHeader: true, - title: title, - isFixed: true - }); - index++; - found_level1 = true; - } - if (level==2 && title && group && name) { - nav.splice(index, 0, { - group: group, - name: name, - isHeader: false, - title: title, - isFixed: false, - version: '1.0' - }); - index++; - } - }); + if (topics) { + topics.forEach(function(entry) { + var level = entry.substring(2, 3); + var title = entry.replace(/<.+?>/g, ""); // Remove all HTML tags for the title + var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/); // Find the group and name in the id property + var group = entry_tags ? entry_tags[1] : null; + var name = entry_tags ? entry_tags[2] : null; + if (level == 1 && title && group) { + nav.splice(index, 0, { + group: group, + isHeader: true, + title: title, + isFixed: true + }); + index++; + found_level1 = true; + } + if (level == 2 && title && group && name) { + nav.splice(index, 0, { + group: group, + name: name, + isHeader: false, + title: title, + isFixed: false, + version: "1.0" + }); + index++; + } + }); } return found_level1; } @@ -252,11 +264,15 @@ require([ // Mainmenu Header entry if (apiProject.header) { var found_level1 = add_nav(nav, apiProject.header.content, 0); // Add level 1 and 2 titles - if (!found_level1) { // If no Level 1 tags were found, make a title + if (!found_level1) { + // If no Level 1 tags were found, make a title nav.unshift({ - group: '_', + group: "_", isHeader: true, - title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title, + title: + apiProject.header.title == null + ? locale.__("General") + : apiProject.header.title, isFixed: true }); } @@ -266,9 +282,10 @@ require([ if (apiProject.footer) { var last_nav_index = nav.length; var found_level1 = add_nav(nav, apiProject.footer.content, nav.length); // Add level 1 and 2 titles - if (!found_level1 && apiProject.footer.title != null) { // If no Level 1 tags were found, make a title + if (!found_level1 && apiProject.footer.title != null) { + // If no Level 1 tags were found, make a title nav.splice(last_nav_index, 0, { - group: '_footer', + group: "_footer", isHeader: true, title: apiProject.footer.title, isFixed: true @@ -277,56 +294,67 @@ require([ } // render pagetitle - var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version; - $(document).attr('title', title); + var title = apiProject.title + ? apiProject.title + : "apiDoc: " + apiProject.name + " - " + apiProject.version; + $(document).attr("title", title); // remove loader - $('#loader').remove(); + $("#loader").remove(); // render sidenav var fields = { nav: nav }; - $('#sidenav').append( templateSidenav(fields) ); + $("#sidenav").append(templateSidenav(fields)); // render Generator - $('#generator').append( templateGenerator(apiProject) ); + $("#generator").append(templateGenerator(apiProject)); // render Project - _.extend(apiProject, { versions: apiVersions}); - $('#project').append( templateProject(apiProject) ); + _.extend(apiProject, { versions: apiVersions }); + $("#project").append(templateProject(apiProject)); // render apiDoc, header/footer documentation if (apiProject.header) - $('#header').append( templateHeader(apiProject.header) ); + $("#header").append(templateHeader(apiProject.header)); if (apiProject.footer) - $('#footer').append( templateFooter(apiProject.footer) ); + $("#footer").append(templateFooter(apiProject.footer)); // // Render Sections and Articles // var articleVersions = {}; - var content = ''; + var content = ""; apiGroups.forEach(function(groupEntry) { var articles = []; - var oldName = ''; + var oldName = ""; var fields = {}; var title = groupEntry; - var description = ''; + var description = ""; articleVersions[groupEntry] = {}; // render all articles of a group api.forEach(function(entry) { - if(groupEntry === entry.group) { + if (groupEntry === entry.group) { if (oldName !== entry.name) { // determine versions api.forEach(function(versionEntry) { - if (groupEntry === versionEntry.group && entry.name === versionEntry.name) { - if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) { + if ( + groupEntry === versionEntry.group && + entry.name === versionEntry.name + ) { + if ( + !articleVersions[entry.group].hasOwnProperty( + entry.name + ) + ) { articleVersions[entry.group][entry.name] = []; } - articleVersions[entry.group][entry.name].push(versionEntry.version); + articleVersions[entry.group][entry.name].push( + versionEntry.version + ); } }); fields = { @@ -347,8 +375,7 @@ require([ addArticleSettings(fields, entry); - if (entry.groupTitle) - title = entry.groupTitle; + if (entry.groupTitle) title = entry.groupTitle; // TODO: make groupDescription compareable with older versions (not important for the moment) if (entry.groupDescription) @@ -372,25 +399,33 @@ require([ }; content += templateSections(fields); }); - $('#sections').append( content ); + $("#sections").append(content); // Bootstrap Scrollspy - $(this).scrollspy({ target: '#scrollingNav', offset: 18 }); + $(this).scrollspy({ target: "#scrollingNav", offset: 18 }); // Content-Scroll on Navigation click. - $('.sidenav').find('a').on('click', function(e) { - e.preventDefault(); - var id = $(this).attr('href'); - if ($(id).length > 0) - $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400); - window.location.hash = $(this).attr('href'); - }); + $(".sidenav") + .find("a") + .on("click", function(e) { + e.preventDefault(); + var id = $(this).attr("href"); + if ($(id).length > 0) + $("html,body").animate( + { scrollTop: parseInt($(id).offset().top) }, + 400 + ); + window.location.hash = $(this).attr("href"); + }); // Quickjump on Pageload to hash position. - if(window.location.hash) { + if (window.location.hash) { var id = window.location.hash; if ($(id).length > 0) - $('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0); + $("html,body").animate( + { scrollTop: parseInt($(id).offset().top) }, + 0 + ); } /** @@ -403,7 +438,11 @@ require([ function _hasTypeInFields(fields) { var result = false; $.each(fields, function(name) { - result = result || _.some(fields[name], function(item) { return item.type; }); + result = + result || + _.some(fields[name], function(item) { + return item.type; + }); }); return result; } @@ -413,39 +452,58 @@ require([ */ function initDynamic() { // Bootstrap popover - $('button[data-toggle="popover"]').popover().click(function(e) { - e.preventDefault(); - }); + $('button[data-toggle="popover"]') + .popover() + .click(function(e) { + e.preventDefault(); + }); - var version = $('#version strong').html(); - $('#sidenav li').removeClass('is-new'); + var version = $("#version strong").html(); + $("#sidenav li").removeClass("is-new"); if (apiProject.template.withCompare) { - $('#sidenav li[data-version=\'' + version + '\']').each(function(){ - var group = $(this).data('group'); - var name = $(this).data('name'); - var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length; - var index = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').index($(this)); - if (length === 1 || index === (length - 1)) - $(this).addClass('is-new'); + $("#sidenav li[data-version='" + version + "']").each(function() { + var group = $(this).data("group"); + var name = $(this).data("name"); + var length = $( + "#sidenav li[data-group='" + + group + + "'][data-name='" + + name + + "']" + ).length; + var index = $( + "#sidenav li[data-group='" + + group + + "'][data-name='" + + name + + "']" + ).index($(this)); + if (length === 1 || index === length - 1) + $(this).addClass("is-new"); }); } // tabs - $('.nav-tabs-examples a').click(function (e) { + $(".nav-tabs-examples a").click(function(e) { e.preventDefault(); - $(this).tab('show'); + $(this).tab("show"); }); - $('.nav-tabs-examples').find('a:first').tab('show'); + $(".nav-tabs-examples") + .find("a:first") + .tab("show"); // sample request switch - $('.sample-request-switch').click(function (e) { - var name = '.' + $(this).attr('name') + '-fields'; - $(name).addClass('hide'); - $(this).parent().next(name).removeClass('hide'); + $(".sample-request-switch").click(function(e) { + var name = "." + $(this).attr("name") + "-fields"; + $(name).addClass("hide"); + $(this) + .parent() + .next(name) + .removeClass("hide"); }); // call scrollspy refresh method - $(window).scrollspy('refresh'); + $(window).scrollspy("refresh"); // init modules sampleRequest.initDynamic(); @@ -459,41 +517,67 @@ require([ // HTML-Template specific jQuery-Functions // // Change Main Version - $('#versions li.version a').on('click', function(e) { + $("#versions li.version a").on("click", function(e) { e.preventDefault(); var selectedVersion = $(this).html(); - $('#version strong').html(selectedVersion); + $("#version strong").html(selectedVersion); // hide all - $('article').addClass('hide'); - $('#sidenav li:not(.nav-fixed)').addClass('hide'); + $("article").addClass("hide"); + $("#sidenav li:not(.nav-fixed)").addClass("hide"); // show 1st equal or lower Version of each entry - $('article[data-version]').each(function(index) { - var group = $(this).data('group'); - var name = $(this).data('name'); - var version = $(this).data('version'); + $("article[data-version]").each(function(index) { + var group = $(this).data("group"); + var name = $(this).data("name"); + var version = $(this).data("version"); if (semver.lte(version, selectedVersion)) { - if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) { + if ( + $( + "article[data-group='" + + group + + "'][data-name='" + + name + + "']:visible" + ).length === 0 + ) { // enable Article - $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); + $( + "article[data-group='" + + group + + "'][data-name='" + + name + + "'][data-version='" + + version + + "']" + ).removeClass("hide"); // enable Navigation - $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide'); - $('#sidenav li.nav-header[data-group=\'' + group + '\']').removeClass('hide'); + $( + "#sidenav li[data-group='" + + group + + "'][data-name='" + + name + + "'][data-version='" + + version + + "']" + ).removeClass("hide"); + $( + "#sidenav li.nav-header[data-group='" + group + "']" + ).removeClass("hide"); } } }); // show 1st equal or lower Version of each entry - $('article[data-version]').each(function(index) { - var group = $(this).data('group'); - $('section#api-' + group).removeClass('hide'); - if ($('section#api-' + group + ' article:visible').length === 0) { - $('section#api-' + group).addClass('hide'); + $("article[data-version]").each(function(index) { + var group = $(this).data("group"); + $("section#api-" + group).removeClass("hide"); + if ($("section#api-" + group + " article:visible").length === 0) { + $("section#api-" + group).addClass("hide"); } else { - $('section#api-' + group).removeClass('hide'); + $("section#api-" + group).removeClass("hide"); } }); @@ -502,24 +586,29 @@ require([ }); // compare all article with their predecessor - $('#compareAllWithPredecessor').on('click', changeAllVersionCompareTo); + $("#compareAllWithPredecessor").on("click", changeAllVersionCompareTo); // change version of an article - $('article .versions li.version a').on('click', changeVersionCompareTo); + $("article .versions li.version a").on("click", changeVersionCompareTo); // compare url-parameter $.urlParam = function(name) { - var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); - return (results && results[1]) ? results[1] : null; + var results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec( + window.location.href + ); + return results && results[1] ? results[1] : null; }; - if ($.urlParam('compare')) { + if ($.urlParam("compare")) { // URL Paramter ?compare=1 is set - $('#compareAllWithPredecessor').trigger('click'); + $("#compareAllWithPredecessor").trigger("click"); if (window.location.hash) { var id = window.location.hash; - $('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0); + $("html,body").animate( + { scrollTop: parseInt($(id).offset().top) - 18 }, + 0 + ); } } @@ -527,31 +616,30 @@ require([ * Initialize search */ var options = { - valueNames: [ 'nav-list-item' ] + valueNames: ["nav-list-item"] }; - var endpointsList = new List('scrollingNav', options); + var endpointsList = new List("scrollingNav", options); /** * Set initial focus to search input */ - $('#scrollingNav .sidenav-search input.search').focus(); + $("#scrollingNav .sidenav-search input.search").focus(); /** * Detect ESC key to reset search */ $(document).keyup(function(e) { - if (e.keyCode === 27) $('span.search-reset').click(); + if (e.keyCode === 27) $("span.search-reset").click(); }); /** * Search reset */ - $('span.search-reset').on('click', function() { - $('#scrollingNav .sidenav-search input.search') - .val("") - .focus() - ; - endpointsList.search(); + $("span.search-reset").on("click", function() { + $("#scrollingNav .sidenav-search input.search") + .val("") + .focus(); + endpointsList.search(); }); /** @@ -560,37 +648,45 @@ require([ function changeVersionCompareTo(e) { e.preventDefault(); - var $root = $(this).parents('article'); + var $root = $(this).parents("article"); var selectedVersion = $(this).html(); - var $button = $root.find('.version'); - var currentVersion = $button.find('strong').html(); - $button.find('strong').html(selectedVersion); + var $button = $root.find(".version"); + var currentVersion = $button.find("strong").html(); + $button.find("strong").html(selectedVersion); - var group = $root.data('group'); - var name = $root.data('name'); - var version = $root.data('version'); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); - var compareVersion = $root.data('compare-version'); + var compareVersion = $root.data("compare-version"); - if (compareVersion === selectedVersion) - return; + if (compareVersion === selectedVersion) return; - if ( ! compareVersion && version == selectedVersion) - return; + if (!compareVersion && version == selectedVersion) return; - if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) { + if ( + (compareVersion && + articleVersions[group][name][0] === selectedVersion) || + version === selectedVersion + ) { // the version of the entry is set to the highest version (reset) resetArticle(group, name, version); } else { - var $compareToArticle = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + selectedVersion + '\']'); + var $compareToArticle = $( + "article[data-group='" + + group + + "'][data-name='" + + name + + "'][data-version='" + + selectedVersion + + "']" + ); var sourceEntry = {}; var compareEntry = {}; $.each(apiByGroupAndName[group][name], function(index, entry) { - if (entry.version === version) - sourceEntry = entry; - if (entry.version === selectedVersion) - compareEntry = entry; + if (entry.version === version) sourceEntry = entry; + if (entry.version === selectedVersion) compareEntry = entry; }); var fields = { @@ -601,47 +697,99 @@ require([ // add unique id // TODO: replace all group-name-version in template with id. - fields.article.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; - fields.article.id = fields.article.id.replace(/\./g, '_'); - - fields.compare.id = fields.compare.group + '-' + fields.compare.name + '-' + fields.compare.version; - fields.compare.id = fields.compare.id.replace(/\./g, '_'); + fields.article.id = + fields.article.group + + "-" + + fields.article.name + + "-" + + fields.article.version; + fields.article.id = fields.article.id.replace(/\./g, "_"); + + fields.compare.id = + fields.compare.group + + "-" + + fields.compare.name + + "-" + + fields.compare.version; + fields.compare.id = fields.compare.id.replace(/\./g, "_"); var entry = sourceEntry; if (entry.parameter && entry.parameter.fields) - fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + fields._hasTypeInParameterFields = _hasTypeInFields( + entry.parameter.fields + ); if (entry.error && entry.error.fields) - fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); + fields._hasTypeInErrorFields = _hasTypeInFields( + entry.error.fields + ); if (entry.success && entry.success.fields) - fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + fields._hasTypeInSuccessFields = _hasTypeInFields( + entry.success.fields + ); if (entry.info && entry.info.fields) - fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + fields._hasTypeInInfoFields = _hasTypeInFields( + entry.info.fields + ); var entry = compareEntry; - if (fields._hasTypeInParameterFields !== true && entry.parameter && entry.parameter.fields) - fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); - - if (fields._hasTypeInErrorFields !== true && entry.error && entry.error.fields) - fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields); - - if (fields._hasTypeInSuccessFields !== true && entry.success && entry.success.fields) - fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); - - if (fields._hasTypeInInfoFields !== true && entry.info && entry.info.fields) - fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields); + if ( + fields._hasTypeInParameterFields !== true && + entry.parameter && + entry.parameter.fields + ) + fields._hasTypeInParameterFields = _hasTypeInFields( + entry.parameter.fields + ); + + if ( + fields._hasTypeInErrorFields !== true && + entry.error && + entry.error.fields + ) + fields._hasTypeInErrorFields = _hasTypeInFields( + entry.error.fields + ); + + if ( + fields._hasTypeInSuccessFields !== true && + entry.success && + entry.success.fields + ) + fields._hasTypeInSuccessFields = _hasTypeInFields( + entry.success.fields + ); + + if ( + fields._hasTypeInInfoFields !== true && + entry.info && + entry.info.fields + ) + fields._hasTypeInInfoFields = _hasTypeInFields( + entry.info.fields + ); var content = templateCompareArticle(fields); $root.after(content); var $content = $root.next(); // Event on.click re-assign - $content.find('.versions li.version a').on('click', changeVersionCompareTo); + $content + .find(".versions li.version a") + .on("click", changeVersionCompareTo); // select navigation - $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + currentVersion + '\']').addClass('has-modifications'); + $( + "#sidenav li[data-group='" + + group + + "'][data-name='" + + name + + "'][data-version='" + + currentVersion + + "']" + ).addClass("has-modifications"); $root.remove(); // TODO: on change main version or select the highest version re-render @@ -655,18 +803,19 @@ require([ */ function changeAllVersionCompareTo(e) { e.preventDefault(); - $('article:visible .versions').each(function(){ - var $root = $(this).parents('article'); - var currentVersion = $root.data('version'); + $("article:visible .versions").each(function() { + var $root = $(this).parents("article"); + var currentVersion = $root.data("version"); var $foundElement = null; - $(this).find('li.version a').each(function() { - var selectVersion = $(this).html(); - if (selectVersion < currentVersion && ! $foundElement) - $foundElement = $(this); - }); + $(this) + .find("li.version a") + .each(function() { + var selectVersion = $(this).html(); + if (selectVersion < currentVersion && !$foundElement) + $foundElement = $(this); + }); - if($foundElement) - $foundElement.trigger('click'); + if ($foundElement) $foundElement.trigger("click"); }); initDynamic(); } @@ -675,24 +824,33 @@ require([ * Sort the fields. */ function sortFields(fields_object) { - $.each(fields_object, function (key, fields) { + $.each(fields_object, function(key, fields) { + var reversed = fields.slice().reverse(); - var reversed = fields.slice().reverse() - - var max_dot_count = Math.max.apply(null, reversed.map(function (item) { - return item.field.split(".").length - 1; - })) + var max_dot_count = Math.max.apply( + null, + reversed.map(function(item) { + return item.field.split(".").length - 1; + }) + ); for (var dot_count = 1; dot_count <= max_dot_count; dot_count++) { - reversed.forEach(function (item, index) { + reversed.forEach(function(item, index) { var parts = item.field.split("."); if (parts.length - 1 == dot_count) { - var fields_names = fields.map(function (item) { return item.field; }); - if (parts.slice(1).length >= 1) { - var prefix = parts.slice(0, parts.length - 1).join("."); + var fields_names = fields.map(function(item) { + return item.field; + }); + if (parts.slice(1).length >= 1) { + var prefix = parts + .slice(0, parts.length - 1) + .join("."); var prefix_index = fields_names.indexOf(prefix); if (prefix_index > -1) { - fields.splice(fields_names.indexOf(item.field), 1); + fields.splice( + fields_names.indexOf(item.field), + 1 + ); fields.splice(prefix_index + 1, 0, item); } } @@ -708,17 +866,26 @@ require([ function addArticleSettings(fields, entry) { // add unique id // TODO: replace all group-name-version in template with id. - fields.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version; - fields.id = fields.id.replace(/\./g, '_'); + fields.id = + fields.article.group + + "-" + + fields.article.name + + "-" + + fields.article.version; + fields.id = fields.id.replace(/\./g, "_"); if (entry.header && entry.header.fields) { sortFields(entry.header.fields); - fields._hasTypeInHeaderFields = _hasTypeInFields(entry.header.fields); + fields._hasTypeInHeaderFields = _hasTypeInFields( + entry.header.fields + ); } if (entry.parameter && entry.parameter.fields) { sortFields(entry.parameter.fields); - fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields); + fields._hasTypeInParameterFields = _hasTypeInFields( + entry.parameter.fields + ); } if (entry.error && entry.error.fields) { @@ -728,7 +895,9 @@ require([ if (entry.success && entry.success.fields) { sortFields(entry.success.fields); - fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields); + fields._hasTypeInSuccessFields = _hasTypeInFields( + entry.success.fields + ); } if (entry.info && entry.info.fields) { @@ -746,8 +915,7 @@ require([ function renderArticle(group, name, version) { var entry = {}; $.each(apiByGroupAndName[group][name], function(index, currentEntry) { - if (currentEntry.version === version) - entry = currentEntry; + if (currentEntry.version === version) entry = currentEntry; }); var fields = { article: entry, @@ -763,16 +931,32 @@ require([ * Render original Article and remove the current visible Article. */ function resetArticle(group, name, version) { - var $root = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible'); + var $root = $( + "article[data-group='" + + group + + "'][data-name='" + + name + + "']:visible" + ); var content = renderArticle(group, name, version); $root.after(content); var $content = $root.next(); // Event on.click muss neu zugewiesen werden (sollte eigentlich mit on automatisch funktionieren... sollte) - $content.find('.versions li.version a').on('click', changeVersionCompareTo); - - $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('has-modifications'); + $content + .find(".versions li.version a") + .on("click", changeVersionCompareTo); + + $( + "#sidenav li[data-group='" + + group + + "'][data-name='" + + name + + "'][data-version='" + + version + + "']" + ).removeClass("has-modifications"); $root.remove(); return; @@ -785,10 +969,10 @@ require([ WebFont.load({ active: function() { // Update scrollspy - $(window).scrollspy('refresh') + $(window).scrollspy("refresh"); }, google: { - families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7'] + families: ["Source Code Pro", "Source Sans Pro:n4,n6,n7"] } }); } @@ -802,26 +986,22 @@ require([ */ function sortByOrder(elements, order, splitBy) { var results = []; - order.forEach (function(name) { + order.forEach(function(name) { if (splitBy) - elements.forEach (function(element) { + elements.forEach(function(element) { var parts = element.split(splitBy); var key = parts[1]; // reference keep for sorting - if (key == name) - results.push(element); + if (key == name) results.push(element); }); else - elements.forEach (function(key) { - if (key == name) - results.push(name); + elements.forEach(function(key) { + if (key == name) results.push(name); }); }); // Append all other entries that ar not defined in order elements.forEach(function(element) { - if (results.indexOf(element) === -1) - results.push(element); + if (results.indexOf(element) === -1) results.push(element); }); return results; } - }); diff --git a/docs/api/utils/handlebars_helper.js b/docs/api/utils/handlebars_helper.js index a5d5c4fd..dee3afed 100644 --- a/docs/api/utils/handlebars_helper.js +++ b/docs/api/utils/handlebars_helper.js @@ -1,22 +1,29 @@ -define([ - 'locales', - 'handlebars', - 'diffMatchPatch' -], function(locale, Handlebars, DiffMatchPatch) { - +define(["locales", "handlebars", "diffMatchPatch"], function( + locale, + Handlebars, + DiffMatchPatch +) { /** * Return a text as markdown. * Currently only a little helper to replace apidoc-inline Links (#Group:Name). * Should be replaced with a full markdown lib. * @param string text */ - Handlebars.registerHelper('markdown', function(text) { - if ( ! text ) { - return text; + Handlebars.registerHelper("markdown", function(text) { + if (!text) { + return text; } - text = text.replace(/((\[(.*?)\])?\(#)((.+?):(.+?))(\))/mg, function(match, p1, p2, p3, p4, p5, p6) { - var link = p3 || p5 + '/' + p6; - return '' + link + ''; + text = text.replace(/((\[(.*?)\])?\(#)((.+?):(.+?))(\))/gm, function( + match, + p1, + p2, + p3, + p4, + p5, + p6 + ) { + var link = p3 || p5 + "/" + p6; + return '' + link + ""; }); return text; }); @@ -25,21 +32,21 @@ define([ * start/stop timer for simple performance check. */ var timer; - Handlebars.registerHelper('startTimer', function(text) { + Handlebars.registerHelper("startTimer", function(text) { timer = new Date(); - return ''; + return ""; }); - Handlebars.registerHelper('stopTimer', function(text) { + Handlebars.registerHelper("stopTimer", function(text) { console.log(new Date() - timer); - return ''; + return ""; }); /** * Return localized Text. * @param string text */ - Handlebars.registerHelper('__', function(text) { + Handlebars.registerHelper("__", function(text) { return locale.__(text); }); @@ -47,50 +54,55 @@ define([ * Console log. * @param mixed obj */ - Handlebars.registerHelper('cl', function(obj) { + Handlebars.registerHelper("cl", function(obj) { console.log(obj); - return ''; + return ""; }); /** * Replace underscore with space. * @param string text */ - Handlebars.registerHelper('underscoreToSpace', function(text) { - return text.replace(/(_+)/g, ' '); + Handlebars.registerHelper("underscoreToSpace", function(text) { + return text.replace(/(_+)/g, " "); }); /** * */ - Handlebars.registerHelper('assign', function(name) { - if(arguments.length > 0) { - var type = typeof(arguments[1]); + Handlebars.registerHelper("assign", function(name) { + if (arguments.length > 0) { + var type = typeof arguments[1]; var arg = null; - if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1]; - Handlebars.registerHelper(name, function() { return arg; }); + if (type === "string" || type === "number" || type === "boolean") + arg = arguments[1]; + Handlebars.registerHelper(name, function() { + return arg; + }); } - return ''; + return ""; }); /** * */ - Handlebars.registerHelper('nl2br', function(text) { + Handlebars.registerHelper("nl2br", function(text) { return _handlebarsNewlineToBreak(text); }); /** * */ - Handlebars.registerHelper('if_eq', function(context, options) { + Handlebars.registerHelper("if_eq", function(context, options) { var compare = context; // Get length if context is an object - if (context instanceof Object && ! (options.hash.compare instanceof Object)) - compare = Object.keys(context).length; + if ( + context instanceof Object && + !(options.hash.compare instanceof Object) + ) + compare = Object.keys(context).length; - if (compare === options.hash.compare) - return options.fn(this); + if (compare === options.hash.compare) return options.fn(this); return options.inverse(this); }); @@ -98,14 +110,16 @@ define([ /** * */ - Handlebars.registerHelper('if_gt', function(context, options) { + Handlebars.registerHelper("if_gt", function(context, options) { var compare = context; // Get length if context is an object - if (context instanceof Object && ! (options.hash.compare instanceof Object)) - compare = Object.keys(context).length; + if ( + context instanceof Object && + !(options.hash.compare instanceof Object) + ) + compare = Object.keys(context).length; - if(compare > options.hash.compare) - return options.fn(this); + if (compare > options.hash.compare) return options.fn(this); return options.inverse(this); }); @@ -114,28 +128,36 @@ define([ * */ var templateCache = {}; - Handlebars.registerHelper('subTemplate', function(name, sourceContext) { - if ( ! templateCache[name]) - templateCache[name] = Handlebars.compile($('#template-' + name).html()); + Handlebars.registerHelper("subTemplate", function(name, sourceContext) { + if (!templateCache[name]) + templateCache[name] = Handlebars.compile( + $("#template-" + name).html() + ); var template = templateCache[name]; var templateContext = $.extend({}, this, sourceContext.hash); - return new Handlebars.SafeString( template(templateContext) ); + return new Handlebars.SafeString(template(templateContext)); }); /** * */ - Handlebars.registerHelper('toLowerCase', function(value) { - return (value && typeof value === 'string') ? value.toLowerCase() : ''; + Handlebars.registerHelper("toLowerCase", function(value) { + return value && typeof value === "string" ? value.toLowerCase() : ""; }); /** * */ - Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) { + Handlebars.registerHelper("splitFill", function( + value, + splitChar, + fillChar + ) { var splits = value.split(splitChar); - return new Array(splits.length).join(fillChar) + splits[splits.length - 1]; + return ( + new Array(splits.length).join(fillChar) + splits[splits.length - 1] + ); }); /** @@ -145,19 +167,26 @@ define([ * @returns {String} */ function _handlebarsNewlineToBreak(text) { - return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '
' + '$2'); + return ("" + text).replace( + /([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, + "$1" + "
" + "$2" + ); } /** * */ - Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) { + Handlebars.registerHelper("each_compare_list_field", function( + source, + compare, + options + ) { var fieldName = options.hash.field; var newSource = []; if (source) { source.forEach(function(entry) { var values = entry; - values['key'] = entry[fieldName]; + values["key"] = entry[fieldName]; newSource.push(values); }); } @@ -166,24 +195,28 @@ define([ if (compare) { compare.forEach(function(entry) { var values = entry; - values['key'] = entry[fieldName]; + values["key"] = entry[fieldName]; newCompare.push(values); }); } - return _handlebarsEachCompared('key', newSource, newCompare, options); + return _handlebarsEachCompared("key", newSource, newCompare, options); }); /** * */ - Handlebars.registerHelper('each_compare_keys', function(source, compare, options) { + Handlebars.registerHelper("each_compare_keys", function( + source, + compare, + options + ) { var newSource = []; if (source) { var sourceFields = Object.keys(source); sourceFields.forEach(function(name) { var values = {}; - values['value'] = source[name]; - values['key'] = name; + values["value"] = source[name]; + values["key"] = name; newSource.push(values); }); } @@ -193,62 +226,65 @@ define([ var compareFields = Object.keys(compare); compareFields.forEach(function(name) { var values = {}; - values['value'] = compare[name]; - values['key'] = name; + values["value"] = compare[name]; + values["key"] = name; newCompare.push(values); }); } - return _handlebarsEachCompared('key', newSource, newCompare, options); + return _handlebarsEachCompared("key", newSource, newCompare, options); }); /** * */ - Handlebars.registerHelper('each_compare_field', function(source, compare, options) { - return _handlebarsEachCompared('field', source, compare, options); + Handlebars.registerHelper("each_compare_field", function( + source, + compare, + options + ) { + return _handlebarsEachCompared("field", source, compare, options); }); /** * */ - Handlebars.registerHelper('each_compare_title', function(source, compare, options) { - return _handlebarsEachCompared('title', source, compare, options); + Handlebars.registerHelper("each_compare_title", function( + source, + compare, + options + ) { + return _handlebarsEachCompared("title", source, compare, options); }); /** * */ - Handlebars.registerHelper('reformat', function(source, type){ - if (type == 'json') + Handlebars.registerHelper("reformat", function(source, type) { + if (type == "json") try { - return JSON.stringify(JSON.parse(source.trim()),null, " "); - } catch(e) { - - } - return source + return JSON.stringify(JSON.parse(source.trim()), null, " "); + } catch (e) {} + return source; }); /** * */ - Handlebars.registerHelper('showDiff', function(source, compare, options) { - var ds = ''; - if(source === compare) { + Handlebars.registerHelper("showDiff", function(source, compare, options) { + var ds = ""; + if (source === compare) { ds = source; } else { - if( ! source) - return compare; + if (!source) return compare; - if( ! compare) - return source; + if (!compare) return source; var d = diffMatchPatch.diff_main(compare, source); diffMatchPatch.diff_cleanupSemantic(d); ds = diffMatchPatch.diff_prettyHtml(d); - ds = ds.replace(/¶/gm, ''); + ds = ds.replace(/¶/gm, ""); } - if(options === 'nl2br') - ds = _handlebarsNewlineToBreak(ds); + if (options === "nl2br") ds = _handlebarsNewlineToBreak(ds); return ds; }); @@ -256,16 +292,17 @@ define([ /** * */ - function _handlebarsEachCompared(fieldname, source, compare, options) - { + function _handlebarsEachCompared(fieldname, source, compare, options) { var dataList = []; var index = 0; - if(source) { + if (source) { source.forEach(function(sourceEntry) { var found = false; if (compare) { compare.forEach(function(compareEntry) { - if(sourceEntry[fieldname] === compareEntry[fieldname]) { + if ( + sourceEntry[fieldname] === compareEntry[fieldname] + ) { var data = { typeSame: true, source: sourceEntry, @@ -278,7 +315,7 @@ define([ } }); } - if ( ! found) { + if (!found) { var data = { typeIns: true, source: sourceEntry, @@ -295,11 +332,11 @@ define([ var found = false; if (source) { source.forEach(function(sourceEntry) { - if(sourceEntry[fieldname] === compareEntry[fieldname]) + if (sourceEntry[fieldname] === compareEntry[fieldname]) found = true; }); } - if ( ! found) { + if (!found) { var data = { typeDel: true, compare: compareEntry, @@ -311,11 +348,10 @@ define([ }); } - var ret = ''; + var ret = ""; var length = dataList.length; for (var index in dataList) { - if(index == (length - 1)) - dataList[index]['_last'] = true; + if (index == length - 1) dataList[index]["_last"] = true; ret = ret + options.fn(dataList[index]); } return ret; @@ -327,29 +363,32 @@ define([ * Overwrite Colors */ DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) { - var html = []; - var pattern_amp = /&/g; - var pattern_lt = //g; - var pattern_para = /\n/g; - for (var x = 0; x < diffs.length; x++) { - var op = diffs[x][0]; // Operation (insert, delete, equal) - var data = diffs[x][1]; // Text of change. - var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<') - .replace(pattern_gt, '>').replace(pattern_para, '¶
'); - switch (op) { - case DIFF_INSERT: - html[x] = '' + text + ''; - break; - case DIFF_DELETE: - html[x] = '' + text + ''; - break; - case DIFF_EQUAL: - html[x] = '' + text + ''; - break; + var html = []; + var pattern_amp = /&/g; + var pattern_lt = //g; + var pattern_para = /\n/g; + for (var x = 0; x < diffs.length; x++) { + var op = diffs[x][0]; // Operation (insert, delete, equal) + var data = diffs[x][1]; // Text of change. + var text = data + .replace(pattern_amp, "&") + .replace(pattern_lt, "<") + .replace(pattern_gt, ">") + .replace(pattern_para, "¶
"); + switch (op) { + case DIFF_INSERT: + html[x] = "" + text + ""; + break; + case DIFF_DELETE: + html[x] = "" + text + ""; + break; + case DIFF_EQUAL: + html[x] = "" + text + ""; + break; + } } - } - return html.join(''); + return html.join(""); }; // Exports diff --git a/docs/api/utils/send_sample_request.js b/docs/api/utils/send_sample_request.js index f2396ea9..673cb12e 100755 --- a/docs/api/utils/send_sample_request.js +++ b/docs/api/utils/send_sample_request.js @@ -1,184 +1,206 @@ -define([ - 'jquery', - 'lodash' -], function($, _) { - - var initDynamic = function() { - // Button send - $(".sample-request-send").off("click"); - $(".sample-request-send").on("click", function(e) { - e.preventDefault(); - var $root = $(this).parents("article"); - var group = $root.data("group"); - var name = $root.data("name"); - var version = $root.data("version"); - sendSampleRequest(group, name, version, $(this).data("sample-request-type")); - }); - - // Button clear - $(".sample-request-clear").off("click"); - $(".sample-request-clear").on("click", function(e) { - e.preventDefault(); - var $root = $(this).parents("article"); - var group = $root.data("group"); - var name = $root.data("name"); - var version = $root.data("version"); - clearSampleRequest(group, name, version); - }); - }; // initDynamic - - function sendSampleRequest(group, name, version, type) - { - var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); - - // Optional header - var header = {}; - $root.find(".sample-request-header:checked").each(function(i, element) { - var group = $(element).data("sample-request-header-group-id"); - $root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) { - var key = $(element).data("sample-request-header-name"); - var value = element.value; - if ( ! element.optional && element.defaultValue !== '') { - value = element.defaultValue; +define(["jquery", "lodash"], function($, _) { + var initDynamic = function() { + // Button send + $(".sample-request-send").off("click"); + $(".sample-request-send").on("click", function(e) { + e.preventDefault(); + var $root = $(this).parents("article"); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); + sendSampleRequest( + group, + name, + version, + $(this).data("sample-request-type") + ); + }); + + // Button clear + $(".sample-request-clear").off("click"); + $(".sample-request-clear").on("click", function(e) { + e.preventDefault(); + var $root = $(this).parents("article"); + var group = $root.data("group"); + var name = $root.data("name"); + var version = $root.data("version"); + clearSampleRequest(group, name, version); + }); + }; // initDynamic + + function sendSampleRequest(group, name, version, type) { + var $root = $( + 'article[data-group="' + + group + + '"][data-name="' + + name + + '"][data-version="' + + version + + '"]' + ); + + // Optional header + var header = {}; + $root.find(".sample-request-header:checked").each(function(i, element) { + var group = $(element).data("sample-request-header-group-id"); + $root + .find('[data-sample-request-header-group="' + group + '"]') + .each(function(i, element) { + var key = $(element).data("sample-request-header-name"); + var value = element.value; + if (!element.optional && element.defaultValue !== "") { + value = element.defaultValue; + } + header[key] = value; + }); + }); + + // create JSON dictionary of parameters + var param = {}; + var paramType = {}; + $root.find(".sample-request-param:checked").each(function(i, element) { + var group = $(element).data("sample-request-param-group-id"); + $root + .find('[data-sample-request-param-group="' + group + '"]') + .not(function() { + return ( + $(this).val() == "" && + $(this).is( + "[data-sample-request-param-optional='true']" + ) + ); + }) + .each(function(i, element) { + var key = $(element).data("sample-request-param-name"); + var value = element.value; + if (!element.optional && element.defaultValue !== "") { + value = element.defaultValue; + } + param[key] = value; + paramType[key] = $(element) + .next() + .text(); + }); + }); + + // grab user-inputted URL + var url = $root.find(".sample-request-url").val(); + + // Insert url parameter + var pattern = pathToRegexp(url, null); + var matches = pattern.exec(url); + for (var i = 1; i < matches.length; i++) { + var key = matches[i].substr(1); + if (param[key] !== undefined) { + url = url.replace(matches[i], encodeURIComponent(param[key])); + + // remove URL parameters from list + delete param[key]; } - header[key] = value; - }); - }); - - // create JSON dictionary of parameters - var param = {}; - var paramType = {}; - $root.find(".sample-request-param:checked").each(function(i, element) { - var group = $(element).data("sample-request-param-group-id"); - $root.find("[data-sample-request-param-group=\"" + group + "\"]").not(function(){ - return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']"); - }).each(function(i, element) { - var key = $(element).data("sample-request-param-name"); - var value = element.value; - if ( ! element.optional && element.defaultValue !== '') { - value = element.defaultValue; + } // for + + $root.find(".sample-request-response").fadeTo(250, 1); + $root.find(".sample-request-response-json").html("Loading..."); + refreshScrollSpy(); + + _.each(param, function(val, key) { + var t = paramType[key].toLowerCase(); + if (t === "object" || t === "array") { + try { + param[key] = JSON.parse(val); + } catch (e) {} + } + }); + + // send AJAX request, catch success or error callback + var ajaxRequest = { + url: url, + headers: header, + data: param, + type: type.toUpperCase(), + success: displaySuccess, + error: displayError + }; + + $.ajax(ajaxRequest); + + function displaySuccess(data, status, jqXHR) { + var jsonResponse; + try { + jsonResponse = JSON.parse(jqXHR.responseText); + jsonResponse = JSON.stringify(jsonResponse, null, 4); + } catch (e) { + jsonResponse = data; + } + $root.find(".sample-request-response-json").html(jsonResponse); + refreshScrollSpy(); + } + + function displayError(jqXHR, textStatus, error) { + var message = "Error " + jqXHR.status + ": " + error; + var jsonResponse; + try { + jsonResponse = JSON.parse(jqXHR.responseText); + jsonResponse = JSON.stringify(jsonResponse, null, 4); + } catch (e) { + jsonResponse = escape(jqXHR.responseText); } - param[key] = value; - paramType[key] = $(element).next().text(); - }); - }); - - // grab user-inputted URL - var url = $root.find(".sample-request-url").val(); - - // Insert url parameter - var pattern = pathToRegexp(url, null); - var matches = pattern.exec(url); - for (var i = 1; i < matches.length; i++) { - var key = matches[i].substr(1); - if (param[key] !== undefined) { - url = url.replace(matches[i], encodeURIComponent(param[key])); - - // remove URL parameters from list - delete param[key]; - } - } // for - - $root.find(".sample-request-response").fadeTo(250, 1); - $root.find(".sample-request-response-json").html("Loading..."); - refreshScrollSpy(); - - _.each( param, function( val, key ) { - var t = paramType[ key ].toLowerCase(); - if ( t === 'object' || t === 'array' ) { - try { - param[ key ] = JSON.parse( val ); - } catch (e) { - } - } - }); - - // send AJAX request, catch success or error callback - var ajaxRequest = { - url : url, - headers : header, - data : param, - type : type.toUpperCase(), - success : displaySuccess, - error : displayError - }; - - $.ajax(ajaxRequest); - - - function displaySuccess(data, status, jqXHR) { - var jsonResponse; - try { - jsonResponse = JSON.parse(jqXHR.responseText); - jsonResponse = JSON.stringify(jsonResponse, null, 4); - } catch (e) { - jsonResponse = data; - } - $root.find(".sample-request-response-json").html(jsonResponse); - refreshScrollSpy(); - }; - - function displayError(jqXHR, textStatus, error) { - var message = "Error " + jqXHR.status + ": " + error; - var jsonResponse; - try { - jsonResponse = JSON.parse(jqXHR.responseText); - jsonResponse = JSON.stringify(jsonResponse, null, 4); - } catch (e) { - jsonResponse = escape(jqXHR.responseText); - } - - if (jsonResponse) - message += "
" + jsonResponse; - - // flicker on previous error to make clear that there is a new response - if($root.find(".sample-request-response").is(":visible")) - $root.find(".sample-request-response").fadeTo(1, 0.1); - - $root.find(".sample-request-response").fadeTo(250, 1); - $root.find(".sample-request-response-json").html(message); - refreshScrollSpy(); - }; - } - - function clearSampleRequest(group, name, version) - { - var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]'); - - // hide sample response - $root.find(".sample-request-response-json").html(""); - $root.find(".sample-request-response").hide(); - - // reset value of parameters - $root.find(".sample-request-param").each(function(i, element) { - element.value = ""; - }); - - // restore default URL - var $urlElement = $root.find(".sample-request-url"); - $urlElement.val($urlElement.prop("defaultValue")); - - refreshScrollSpy(); - } - - function refreshScrollSpy() - { - $('[data-spy="scroll"]').each(function () { - $(this).scrollspy("refresh"); - }); - } - - function escapeHtml(str) { - var div = document.createElement("div"); - div.appendChild(document.createTextNode(str)); - return div.innerHTML; - } - - /** - * Exports. - */ - return { - initDynamic: initDynamic - }; + if (jsonResponse) message += "
" + jsonResponse; + + // flicker on previous error to make clear that there is a new response + if ($root.find(".sample-request-response").is(":visible")) + $root.find(".sample-request-response").fadeTo(1, 0.1); + + $root.find(".sample-request-response").fadeTo(250, 1); + $root.find(".sample-request-response-json").html(message); + refreshScrollSpy(); + } + } + + function clearSampleRequest(group, name, version) { + var $root = $( + 'article[data-group="' + + group + + '"][data-name="' + + name + + '"][data-version="' + + version + + '"]' + ); + + // hide sample response + $root.find(".sample-request-response-json").html(""); + $root.find(".sample-request-response").hide(); + + // reset value of parameters + $root.find(".sample-request-param").each(function(i, element) { + element.value = ""; + }); + + // restore default URL + var $urlElement = $root.find(".sample-request-url"); + $urlElement.val($urlElement.prop("defaultValue")); + + refreshScrollSpy(); + } + + function refreshScrollSpy() { + $('[data-spy="scroll"]').each(function() { + $(this).scrollspy("refresh"); + }); + } + + function escapeHtml(str) { + var div = document.createElement("div"); + div.appendChild(document.createTextNode(str)); + return div.innerHTML; + } + + /** + * Exports. + */ + return { + initDynamic: initDynamic + }; }); diff --git a/docs/api/vendor/bootstrap.min.js b/docs/api/vendor/bootstrap.min.js index 9bcd2fcc..19489981 100644 --- a/docs/api/vendor/bootstrap.min.js +++ b/docs/api/vendor/bootstrap.min.js @@ -3,5 +3,1900 @@ * Copyright 2011-2016 Twitter, Inc. * Licensed under the MIT license */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file +if ("undefined" == typeof jQuery) + throw new Error("Bootstrap's JavaScript requires jQuery"); ++(function(a) { + "use strict"; + var b = a.fn.jquery.split(" ")[0].split("."); + if ( + (b[0] < 2 && b[1] < 9) || + (1 == b[0] && 9 == b[1] && b[2] < 1) || + b[0] > 3 + ) + throw new Error( + "Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4" + ); +})(jQuery), + +(function(a) { + "use strict"; + function b() { + var a = document.createElement("bootstrap"), + b = { + WebkitTransition: "webkitTransitionEnd", + MozTransition: "transitionend", + OTransition: "oTransitionEnd otransitionend", + transition: "transitionend" + }; + for (var c in b) if (void 0 !== a.style[c]) return { end: b[c] }; + return !1; + } + (a.fn.emulateTransitionEnd = function(b) { + var c = !1, + d = this; + a(this).one("bsTransitionEnd", function() { + c = !0; + }); + var e = function() { + c || a(d).trigger(a.support.transition.end); + }; + return setTimeout(e, b), this; + }), + a(function() { + (a.support.transition = b()), + a.support.transition && + (a.event.special.bsTransitionEnd = { + bindType: a.support.transition.end, + delegateType: a.support.transition.end, + handle: function(b) { + if (a(b.target).is(this)) + return b.handleObj.handler.apply( + this, + arguments + ); + } + }); + }); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var c = a(this), + e = c.data("bs.alert"); + e || c.data("bs.alert", (e = new d(this))), + "string" == typeof b && e[b].call(c); + }); + } + var c = '[data-dismiss="alert"]', + d = function(b) { + a(b).on("click", c, this.close); + }; + (d.VERSION = "3.3.7"), + (d.TRANSITION_DURATION = 150), + (d.prototype.close = function(b) { + function c() { + g.detach() + .trigger("closed.bs.alert") + .remove(); + } + var e = a(this), + f = e.attr("data-target"); + f || + ((f = e.attr("href")), + (f = f && f.replace(/.*(?=#[^\s]*$)/, ""))); + var g = a("#" === f ? [] : f); + b && b.preventDefault(), + g.length || (g = e.closest(".alert")), + g.trigger((b = a.Event("close.bs.alert"))), + b.isDefaultPrevented() || + (g.removeClass("in"), + a.support.transition && g.hasClass("fade") + ? g + .one("bsTransitionEnd", c) + .emulateTransitionEnd(d.TRANSITION_DURATION) + : c()); + }); + var e = a.fn.alert; + (a.fn.alert = b), + (a.fn.alert.Constructor = d), + (a.fn.alert.noConflict = function() { + return (a.fn.alert = e), this; + }), + a(document).on("click.bs.alert.data-api", c, d.prototype.close); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var d = a(this), + e = d.data("bs.button"), + f = "object" == typeof b && b; + e || d.data("bs.button", (e = new c(this, f))), + "toggle" == b ? e.toggle() : b && e.setState(b); + }); + } + var c = function(b, d) { + (this.$element = a(b)), + (this.options = a.extend({}, c.DEFAULTS, d)), + (this.isLoading = !1); + }; + (c.VERSION = "3.3.7"), + (c.DEFAULTS = { loadingText: "loading..." }), + (c.prototype.setState = function(b) { + var c = "disabled", + d = this.$element, + e = d.is("input") ? "val" : "html", + f = d.data(); + (b += "Text"), + null == f.resetText && d.data("resetText", d[e]()), + setTimeout( + a.proxy(function() { + d[e](null == f[b] ? this.options[b] : f[b]), + "loadingText" == b + ? ((this.isLoading = !0), + d + .addClass(c) + .attr(c, c) + .prop(c, !0)) + : this.isLoading && + ((this.isLoading = !1), + d + .removeClass(c) + .removeAttr(c) + .prop(c, !1)); + }, this), + 0 + ); + }), + (c.prototype.toggle = function() { + var a = !0, + b = this.$element.closest('[data-toggle="buttons"]'); + if (b.length) { + var c = this.$element.find("input"); + "radio" == c.prop("type") + ? (c.prop("checked") && (a = !1), + b.find(".active").removeClass("active"), + this.$element.addClass("active")) + : "checkbox" == c.prop("type") && + (c.prop("checked") !== + this.$element.hasClass("active") && (a = !1), + this.$element.toggleClass("active")), + c.prop("checked", this.$element.hasClass("active")), + a && c.trigger("change"); + } else + this.$element.attr( + "aria-pressed", + !this.$element.hasClass("active") + ), + this.$element.toggleClass("active"); + }); + var d = a.fn.button; + (a.fn.button = b), + (a.fn.button.Constructor = c), + (a.fn.button.noConflict = function() { + return (a.fn.button = d), this; + }), + a(document) + .on( + "click.bs.button.data-api", + '[data-toggle^="button"]', + function(c) { + var d = a(c.target).closest(".btn"); + b.call(d, "toggle"), + a(c.target).is( + 'input[type="radio"], input[type="checkbox"]' + ) || + (c.preventDefault(), + d.is("input,button") + ? d.trigger("focus") + : d + .find("input:visible,button:visible") + .first() + .trigger("focus")); + } + ) + .on( + "focus.bs.button.data-api blur.bs.button.data-api", + '[data-toggle^="button"]', + function(b) { + a(b.target) + .closest(".btn") + .toggleClass("focus", /^focus(in)?$/.test(b.type)); + } + ); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var d = a(this), + e = d.data("bs.carousel"), + f = a.extend( + {}, + c.DEFAULTS, + d.data(), + "object" == typeof b && b + ), + g = "string" == typeof b ? b : f.slide; + e || d.data("bs.carousel", (e = new c(this, f))), + "number" == typeof b + ? e.to(b) + : g + ? e[g]() + : f.interval && e.pause().cycle(); + }); + } + var c = function(b, c) { + (this.$element = a(b)), + (this.$indicators = this.$element.find(".carousel-indicators")), + (this.options = c), + (this.paused = null), + (this.sliding = null), + (this.interval = null), + (this.$active = null), + (this.$items = null), + this.options.keyboard && + this.$element.on( + "keydown.bs.carousel", + a.proxy(this.keydown, this) + ), + "hover" == this.options.pause && + !("ontouchstart" in document.documentElement) && + this.$element + .on("mouseenter.bs.carousel", a.proxy(this.pause, this)) + .on( + "mouseleave.bs.carousel", + a.proxy(this.cycle, this) + ); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 600), + (c.DEFAULTS = { + interval: 5e3, + pause: "hover", + wrap: !0, + keyboard: !0 + }), + (c.prototype.keydown = function(a) { + if (!/input|textarea/i.test(a.target.tagName)) { + switch (a.which) { + case 37: + this.prev(); + break; + case 39: + this.next(); + break; + default: + return; + } + a.preventDefault(); + } + }), + (c.prototype.cycle = function(b) { + return ( + b || (this.paused = !1), + this.interval && clearInterval(this.interval), + this.options.interval && + !this.paused && + (this.interval = setInterval( + a.proxy(this.next, this), + this.options.interval + )), + this + ); + }), + (c.prototype.getItemIndex = function(a) { + return ( + (this.$items = a.parent().children(".item")), + this.$items.index(a || this.$active) + ); + }), + (c.prototype.getItemForDirection = function(a, b) { + var c = this.getItemIndex(b), + d = + ("prev" == a && 0 === c) || + ("next" == a && c == this.$items.length - 1); + if (d && !this.options.wrap) return b; + var e = "prev" == a ? -1 : 1, + f = (c + e) % this.$items.length; + return this.$items.eq(f); + }), + (c.prototype.to = function(a) { + var b = this, + c = this.getItemIndex( + (this.$active = this.$element.find(".item.active")) + ); + if (!(a > this.$items.length - 1 || a < 0)) + return this.sliding + ? this.$element.one("slid.bs.carousel", function() { + b.to(a); + }) + : c == a + ? this.pause().cycle() + : this.slide( + a > c ? "next" : "prev", + this.$items.eq(a) + ); + }), + (c.prototype.pause = function(b) { + return ( + b || (this.paused = !0), + this.$element.find(".next, .prev").length && + a.support.transition && + (this.$element.trigger(a.support.transition.end), + this.cycle(!0)), + (this.interval = clearInterval(this.interval)), + this + ); + }), + (c.prototype.next = function() { + if (!this.sliding) return this.slide("next"); + }), + (c.prototype.prev = function() { + if (!this.sliding) return this.slide("prev"); + }), + (c.prototype.slide = function(b, d) { + var e = this.$element.find(".item.active"), + f = d || this.getItemForDirection(b, e), + g = this.interval, + h = "next" == b ? "left" : "right", + i = this; + if (f.hasClass("active")) return (this.sliding = !1); + var j = f[0], + k = a.Event("slide.bs.carousel", { + relatedTarget: j, + direction: h + }); + if ((this.$element.trigger(k), !k.isDefaultPrevented())) { + if ( + ((this.sliding = !0), + g && this.pause(), + this.$indicators.length) + ) { + this.$indicators.find(".active").removeClass("active"); + var l = a( + this.$indicators.children()[this.getItemIndex(f)] + ); + l && l.addClass("active"); + } + var m = a.Event("slid.bs.carousel", { + relatedTarget: j, + direction: h + }); + return ( + a.support.transition && this.$element.hasClass("slide") + ? (f.addClass(b), + f[0].offsetWidth, + e.addClass(h), + f.addClass(h), + e + .one("bsTransitionEnd", function() { + f + .removeClass([b, h].join(" ")) + .addClass("active"), + e.removeClass( + ["active", h].join(" ") + ), + (i.sliding = !1), + setTimeout(function() { + i.$element.trigger(m); + }, 0); + }) + .emulateTransitionEnd(c.TRANSITION_DURATION)) + : (e.removeClass("active"), + f.addClass("active"), + (this.sliding = !1), + this.$element.trigger(m)), + g && this.cycle(), + this + ); + } + }); + var d = a.fn.carousel; + (a.fn.carousel = b), + (a.fn.carousel.Constructor = c), + (a.fn.carousel.noConflict = function() { + return (a.fn.carousel = d), this; + }); + var e = function(c) { + var d, + e = a(this), + f = a( + e.attr("data-target") || + ((d = e.attr("href")) && + d.replace(/.*(?=#[^\s]+$)/, "")) + ); + if (f.hasClass("carousel")) { + var g = a.extend({}, f.data(), e.data()), + h = e.attr("data-slide-to"); + h && (g.interval = !1), + b.call(f, g), + h && f.data("bs.carousel").to(h), + c.preventDefault(); + } + }; + a(document) + .on("click.bs.carousel.data-api", "[data-slide]", e) + .on("click.bs.carousel.data-api", "[data-slide-to]", e), + a(window).on("load", function() { + a('[data-ride="carousel"]').each(function() { + var c = a(this); + b.call(c, c.data()); + }); + }); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + var c, + d = + b.attr("data-target") || + ((c = b.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, "")); + return a(d); + } + function c(b) { + return this.each(function() { + var c = a(this), + e = c.data("bs.collapse"), + f = a.extend( + {}, + d.DEFAULTS, + c.data(), + "object" == typeof b && b + ); + !e && f.toggle && /show|hide/.test(b) && (f.toggle = !1), + e || c.data("bs.collapse", (e = new d(this, f))), + "string" == typeof b && e[b](); + }); + } + var d = function(b, c) { + (this.$element = a(b)), + (this.options = a.extend({}, d.DEFAULTS, c)), + (this.$trigger = a( + '[data-toggle="collapse"][href="#' + + b.id + + '"],[data-toggle="collapse"][data-target="#' + + b.id + + '"]' + )), + (this.transitioning = null), + this.options.parent + ? (this.$parent = this.getParent()) + : this.addAriaAndCollapsedClass( + this.$element, + this.$trigger + ), + this.options.toggle && this.toggle(); + }; + (d.VERSION = "3.3.7"), + (d.TRANSITION_DURATION = 350), + (d.DEFAULTS = { toggle: !0 }), + (d.prototype.dimension = function() { + var a = this.$element.hasClass("width"); + return a ? "width" : "height"; + }), + (d.prototype.show = function() { + if (!this.transitioning && !this.$element.hasClass("in")) { + var b, + e = + this.$parent && + this.$parent + .children(".panel") + .children(".in, .collapsing"); + if ( + !( + e && + e.length && + ((b = e.data("bs.collapse")), b && b.transitioning) + ) + ) { + var f = a.Event("show.bs.collapse"); + if ( + (this.$element.trigger(f), !f.isDefaultPrevented()) + ) { + e && + e.length && + (c.call(e, "hide"), + b || e.data("bs.collapse", null)); + var g = this.dimension(); + this.$element + .removeClass("collapse") + .addClass("collapsing") + [g](0) + .attr("aria-expanded", !0), + this.$trigger + .removeClass("collapsed") + .attr("aria-expanded", !0), + (this.transitioning = 1); + var h = function() { + this.$element + .removeClass("collapsing") + .addClass("collapse in") + [g](""), + (this.transitioning = 0), + this.$element.trigger("shown.bs.collapse"); + }; + if (!a.support.transition) return h.call(this); + var i = a.camelCase(["scroll", g].join("-")); + this.$element + .one("bsTransitionEnd", a.proxy(h, this)) + .emulateTransitionEnd(d.TRANSITION_DURATION) + [g](this.$element[0][i]); + } + } + } + }), + (d.prototype.hide = function() { + if (!this.transitioning && this.$element.hasClass("in")) { + var b = a.Event("hide.bs.collapse"); + if ((this.$element.trigger(b), !b.isDefaultPrevented())) { + var c = this.dimension(); + this.$element[c](this.$element[c]())[0].offsetHeight, + this.$element + .addClass("collapsing") + .removeClass("collapse in") + .attr("aria-expanded", !1), + this.$trigger + .addClass("collapsed") + .attr("aria-expanded", !1), + (this.transitioning = 1); + var e = function() { + (this.transitioning = 0), + this.$element + .removeClass("collapsing") + .addClass("collapse") + .trigger("hidden.bs.collapse"); + }; + return a.support.transition + ? void this.$element[c](0) + .one("bsTransitionEnd", a.proxy(e, this)) + .emulateTransitionEnd(d.TRANSITION_DURATION) + : e.call(this); + } + } + }), + (d.prototype.toggle = function() { + this[this.$element.hasClass("in") ? "hide" : "show"](); + }), + (d.prototype.getParent = function() { + return a(this.options.parent) + .find( + '[data-toggle="collapse"][data-parent="' + + this.options.parent + + '"]' + ) + .each( + a.proxy(function(c, d) { + var e = a(d); + this.addAriaAndCollapsedClass(b(e), e); + }, this) + ) + .end(); + }), + (d.prototype.addAriaAndCollapsedClass = function(a, b) { + var c = a.hasClass("in"); + a.attr("aria-expanded", c), + b.toggleClass("collapsed", !c).attr("aria-expanded", c); + }); + var e = a.fn.collapse; + (a.fn.collapse = c), + (a.fn.collapse.Constructor = d), + (a.fn.collapse.noConflict = function() { + return (a.fn.collapse = e), this; + }), + a(document).on( + "click.bs.collapse.data-api", + '[data-toggle="collapse"]', + function(d) { + var e = a(this); + e.attr("data-target") || d.preventDefault(); + var f = b(e), + g = f.data("bs.collapse"), + h = g ? "toggle" : e.data(); + c.call(f, h); + } + ); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + var c = b.attr("data-target"); + c || + ((c = b.attr("href")), + (c = + c && + /#[A-Za-z]/.test(c) && + c.replace(/.*(?=#[^\s]*$)/, ""))); + var d = c && a(c); + return d && d.length ? d : b.parent(); + } + function c(c) { + (c && 3 === c.which) || + (a(e).remove(), + a(f).each(function() { + var d = a(this), + e = b(d), + f = { relatedTarget: this }; + e.hasClass("open") && + ((c && + "click" == c.type && + /input|textarea/i.test(c.target.tagName) && + a.contains(e[0], c.target)) || + (e.trigger((c = a.Event("hide.bs.dropdown", f))), + c.isDefaultPrevented() || + (d.attr("aria-expanded", "false"), + e + .removeClass("open") + .trigger( + a.Event("hidden.bs.dropdown", f) + )))); + })); + } + function d(b) { + return this.each(function() { + var c = a(this), + d = c.data("bs.dropdown"); + d || c.data("bs.dropdown", (d = new g(this))), + "string" == typeof b && d[b].call(c); + }); + } + var e = ".dropdown-backdrop", + f = '[data-toggle="dropdown"]', + g = function(b) { + a(b).on("click.bs.dropdown", this.toggle); + }; + (g.VERSION = "3.3.7"), + (g.prototype.toggle = function(d) { + var e = a(this); + if (!e.is(".disabled, :disabled")) { + var f = b(e), + g = f.hasClass("open"); + if ((c(), !g)) { + "ontouchstart" in document.documentElement && + !f.closest(".navbar-nav").length && + a(document.createElement("div")) + .addClass("dropdown-backdrop") + .insertAfter(a(this)) + .on("click", c); + var h = { relatedTarget: this }; + if ( + (f.trigger((d = a.Event("show.bs.dropdown", h))), + d.isDefaultPrevented()) + ) + return; + e.trigger("focus").attr("aria-expanded", "true"), + f + .toggleClass("open") + .trigger(a.Event("shown.bs.dropdown", h)); + } + return !1; + } + }), + (g.prototype.keydown = function(c) { + if ( + /(38|40|27|32)/.test(c.which) && + !/input|textarea/i.test(c.target.tagName) + ) { + var d = a(this); + if ( + (c.preventDefault(), + c.stopPropagation(), + !d.is(".disabled, :disabled")) + ) { + var e = b(d), + g = e.hasClass("open"); + if ((!g && 27 != c.which) || (g && 27 == c.which)) + return ( + 27 == c.which && e.find(f).trigger("focus"), + d.trigger("click") + ); + var h = " li:not(.disabled):visible a", + i = e.find(".dropdown-menu" + h); + if (i.length) { + var j = i.index(c.target); + 38 == c.which && j > 0 && j--, + 40 == c.which && j < i.length - 1 && j++, + ~j || (j = 0), + i.eq(j).trigger("focus"); + } + } + } + }); + var h = a.fn.dropdown; + (a.fn.dropdown = d), + (a.fn.dropdown.Constructor = g), + (a.fn.dropdown.noConflict = function() { + return (a.fn.dropdown = h), this; + }), + a(document) + .on("click.bs.dropdown.data-api", c) + .on("click.bs.dropdown.data-api", ".dropdown form", function( + a + ) { + a.stopPropagation(); + }) + .on("click.bs.dropdown.data-api", f, g.prototype.toggle) + .on("keydown.bs.dropdown.data-api", f, g.prototype.keydown) + .on( + "keydown.bs.dropdown.data-api", + ".dropdown-menu", + g.prototype.keydown + ); + })(jQuery), + +(function(a) { + "use strict"; + function b(b, d) { + return this.each(function() { + var e = a(this), + f = e.data("bs.modal"), + g = a.extend( + {}, + c.DEFAULTS, + e.data(), + "object" == typeof b && b + ); + f || e.data("bs.modal", (f = new c(this, g))), + "string" == typeof b ? f[b](d) : g.show && f.show(d); + }); + } + var c = function(b, c) { + (this.options = c), + (this.$body = a(document.body)), + (this.$element = a(b)), + (this.$dialog = this.$element.find(".modal-dialog")), + (this.$backdrop = null), + (this.isShown = null), + (this.originalBodyPad = null), + (this.scrollbarWidth = 0), + (this.ignoreBackdropClick = !1), + this.options.remote && + this.$element.find(".modal-content").load( + this.options.remote, + a.proxy(function() { + this.$element.trigger("loaded.bs.modal"); + }, this) + ); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 300), + (c.BACKDROP_TRANSITION_DURATION = 150), + (c.DEFAULTS = { backdrop: !0, keyboard: !0, show: !0 }), + (c.prototype.toggle = function(a) { + return this.isShown ? this.hide() : this.show(a); + }), + (c.prototype.show = function(b) { + var d = this, + e = a.Event("show.bs.modal", { relatedTarget: b }); + this.$element.trigger(e), + this.isShown || + e.isDefaultPrevented() || + ((this.isShown = !0), + this.checkScrollbar(), + this.setScrollbar(), + this.$body.addClass("modal-open"), + this.escape(), + this.resize(), + this.$element.on( + "click.dismiss.bs.modal", + '[data-dismiss="modal"]', + a.proxy(this.hide, this) + ), + this.$dialog.on( + "mousedown.dismiss.bs.modal", + function() { + d.$element.one( + "mouseup.dismiss.bs.modal", + function(b) { + a(b.target).is(d.$element) && + (d.ignoreBackdropClick = !0); + } + ); + } + ), + this.backdrop(function() { + var e = + a.support.transition && + d.$element.hasClass("fade"); + d.$element.parent().length || + d.$element.appendTo(d.$body), + d.$element.show().scrollTop(0), + d.adjustDialog(), + e && d.$element[0].offsetWidth, + d.$element.addClass("in"), + d.enforceFocus(); + var f = a.Event("shown.bs.modal", { + relatedTarget: b + }); + e + ? d.$dialog + .one("bsTransitionEnd", function() { + d.$element + .trigger("focus") + .trigger(f); + }) + .emulateTransitionEnd( + c.TRANSITION_DURATION + ) + : d.$element.trigger("focus").trigger(f); + })); + }), + (c.prototype.hide = function(b) { + b && b.preventDefault(), + (b = a.Event("hide.bs.modal")), + this.$element.trigger(b), + this.isShown && + !b.isDefaultPrevented() && + ((this.isShown = !1), + this.escape(), + this.resize(), + a(document).off("focusin.bs.modal"), + this.$element + .removeClass("in") + .off("click.dismiss.bs.modal") + .off("mouseup.dismiss.bs.modal"), + this.$dialog.off("mousedown.dismiss.bs.modal"), + a.support.transition && this.$element.hasClass("fade") + ? this.$element + .one( + "bsTransitionEnd", + a.proxy(this.hideModal, this) + ) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : this.hideModal()); + }), + (c.prototype.enforceFocus = function() { + a(document) + .off("focusin.bs.modal") + .on( + "focusin.bs.modal", + a.proxy(function(a) { + document === a.target || + this.$element[0] === a.target || + this.$element.has(a.target).length || + this.$element.trigger("focus"); + }, this) + ); + }), + (c.prototype.escape = function() { + this.isShown && this.options.keyboard + ? this.$element.on( + "keydown.dismiss.bs.modal", + a.proxy(function(a) { + 27 == a.which && this.hide(); + }, this) + ) + : this.isShown || + this.$element.off("keydown.dismiss.bs.modal"); + }), + (c.prototype.resize = function() { + this.isShown + ? a(window).on( + "resize.bs.modal", + a.proxy(this.handleUpdate, this) + ) + : a(window).off("resize.bs.modal"); + }), + (c.prototype.hideModal = function() { + var a = this; + this.$element.hide(), + this.backdrop(function() { + a.$body.removeClass("modal-open"), + a.resetAdjustments(), + a.resetScrollbar(), + a.$element.trigger("hidden.bs.modal"); + }); + }), + (c.prototype.removeBackdrop = function() { + this.$backdrop && this.$backdrop.remove(), + (this.$backdrop = null); + }), + (c.prototype.backdrop = function(b) { + var d = this, + e = this.$element.hasClass("fade") ? "fade" : ""; + if (this.isShown && this.options.backdrop) { + var f = a.support.transition && e; + if ( + ((this.$backdrop = a(document.createElement("div")) + .addClass("modal-backdrop " + e) + .appendTo(this.$body)), + this.$element.on( + "click.dismiss.bs.modal", + a.proxy(function(a) { + return this.ignoreBackdropClick + ? void (this.ignoreBackdropClick = !1) + : void ( + a.target === a.currentTarget && + ("static" == this.options.backdrop + ? this.$element[0].focus() + : this.hide()) + ); + }, this) + ), + f && this.$backdrop[0].offsetWidth, + this.$backdrop.addClass("in"), + !b) + ) + return; + f + ? this.$backdrop + .one("bsTransitionEnd", b) + .emulateTransitionEnd( + c.BACKDROP_TRANSITION_DURATION + ) + : b(); + } else if (!this.isShown && this.$backdrop) { + this.$backdrop.removeClass("in"); + var g = function() { + d.removeBackdrop(), b && b(); + }; + a.support.transition && this.$element.hasClass("fade") + ? this.$backdrop + .one("bsTransitionEnd", g) + .emulateTransitionEnd( + c.BACKDROP_TRANSITION_DURATION + ) + : g(); + } else b && b(); + }), + (c.prototype.handleUpdate = function() { + this.adjustDialog(); + }), + (c.prototype.adjustDialog = function() { + var a = + this.$element[0].scrollHeight > + document.documentElement.clientHeight; + this.$element.css({ + paddingLeft: + !this.bodyIsOverflowing && a ? this.scrollbarWidth : "", + paddingRight: + this.bodyIsOverflowing && !a ? this.scrollbarWidth : "" + }); + }), + (c.prototype.resetAdjustments = function() { + this.$element.css({ paddingLeft: "", paddingRight: "" }); + }), + (c.prototype.checkScrollbar = function() { + var a = window.innerWidth; + if (!a) { + var b = document.documentElement.getBoundingClientRect(); + a = b.right - Math.abs(b.left); + } + (this.bodyIsOverflowing = document.body.clientWidth < a), + (this.scrollbarWidth = this.measureScrollbar()); + }), + (c.prototype.setScrollbar = function() { + var a = parseInt(this.$body.css("padding-right") || 0, 10); + (this.originalBodyPad = document.body.style.paddingRight || ""), + this.bodyIsOverflowing && + this.$body.css( + "padding-right", + a + this.scrollbarWidth + ); + }), + (c.prototype.resetScrollbar = function() { + this.$body.css("padding-right", this.originalBodyPad); + }), + (c.prototype.measureScrollbar = function() { + var a = document.createElement("div"); + (a.className = "modal-scrollbar-measure"), this.$body.append(a); + var b = a.offsetWidth - a.clientWidth; + return this.$body[0].removeChild(a), b; + }); + var d = a.fn.modal; + (a.fn.modal = b), + (a.fn.modal.Constructor = c), + (a.fn.modal.noConflict = function() { + return (a.fn.modal = d), this; + }), + a(document).on( + "click.bs.modal.data-api", + '[data-toggle="modal"]', + function(c) { + var d = a(this), + e = d.attr("href"), + f = a( + d.attr("data-target") || + (e && e.replace(/.*(?=#[^\s]+$)/, "")) + ), + g = f.data("bs.modal") + ? "toggle" + : a.extend( + { remote: !/#/.test(e) && e }, + f.data(), + d.data() + ); + d.is("a") && c.preventDefault(), + f.one("show.bs.modal", function(a) { + a.isDefaultPrevented() || + f.one("hidden.bs.modal", function() { + d.is(":visible") && d.trigger("focus"); + }); + }), + b.call(f, g, this); + } + ); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var d = a(this), + e = d.data("bs.tooltip"), + f = "object" == typeof b && b; + (!e && /destroy|hide/.test(b)) || + (e || d.data("bs.tooltip", (e = new c(this, f))), + "string" == typeof b && e[b]()); + }); + } + var c = function(a, b) { + (this.type = null), + (this.options = null), + (this.enabled = null), + (this.timeout = null), + (this.hoverState = null), + (this.$element = null), + (this.inState = null), + this.init("tooltip", a, b); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 150), + (c.DEFAULTS = { + animation: !0, + placement: "top", + selector: !1, + template: + '', + trigger: "hover focus", + title: "", + delay: 0, + html: !1, + container: !1, + viewport: { selector: "body", padding: 0 } + }), + (c.prototype.init = function(b, c, d) { + if ( + ((this.enabled = !0), + (this.type = b), + (this.$element = a(c)), + (this.options = this.getOptions(d)), + (this.$viewport = + this.options.viewport && + a( + a.isFunction(this.options.viewport) + ? this.options.viewport.call( + this, + this.$element + ) + : this.options.viewport.selector || + this.options.viewport + )), + (this.inState = { click: !1, hover: !1, focus: !1 }), + this.$element[0] instanceof document.constructor && + !this.options.selector) + ) + throw new Error( + "`selector` option must be specified when initializing " + + this.type + + " on the window.document object!" + ); + for ( + var e = this.options.trigger.split(" "), f = e.length; + f--; + + ) { + var g = e[f]; + if ("click" == g) + this.$element.on( + "click." + this.type, + this.options.selector, + a.proxy(this.toggle, this) + ); + else if ("manual" != g) { + var h = "hover" == g ? "mouseenter" : "focusin", + i = "hover" == g ? "mouseleave" : "focusout"; + this.$element.on( + h + "." + this.type, + this.options.selector, + a.proxy(this.enter, this) + ), + this.$element.on( + i + "." + this.type, + this.options.selector, + a.proxy(this.leave, this) + ); + } + } + this.options.selector + ? (this._options = a.extend({}, this.options, { + trigger: "manual", + selector: "" + })) + : this.fixTitle(); + }), + (c.prototype.getDefaults = function() { + return c.DEFAULTS; + }), + (c.prototype.getOptions = function(b) { + return ( + (b = a.extend( + {}, + this.getDefaults(), + this.$element.data(), + b + )), + b.delay && + "number" == typeof b.delay && + (b.delay = { show: b.delay, hide: b.delay }), + b + ); + }), + (c.prototype.getDelegateOptions = function() { + var b = {}, + c = this.getDefaults(); + return ( + this._options && + a.each(this._options, function(a, d) { + c[a] != d && (b[a] = d); + }), + b + ); + }), + (c.prototype.enter = function(b) { + var c = + b instanceof this.constructor + ? b + : a(b.currentTarget).data("bs." + this.type); + return ( + c || + ((c = new this.constructor( + b.currentTarget, + this.getDelegateOptions() + )), + a(b.currentTarget).data("bs." + this.type, c)), + b instanceof a.Event && + (c.inState[ + "focusin" == b.type ? "focus" : "hover" + ] = !0), + c.tip().hasClass("in") || "in" == c.hoverState + ? void (c.hoverState = "in") + : (clearTimeout(c.timeout), + (c.hoverState = "in"), + c.options.delay && c.options.delay.show + ? void (c.timeout = setTimeout(function() { + "in" == c.hoverState && c.show(); + }, c.options.delay.show)) + : c.show()) + ); + }), + (c.prototype.isInStateTrue = function() { + for (var a in this.inState) if (this.inState[a]) return !0; + return !1; + }), + (c.prototype.leave = function(b) { + var c = + b instanceof this.constructor + ? b + : a(b.currentTarget).data("bs." + this.type); + if ( + (c || + ((c = new this.constructor( + b.currentTarget, + this.getDelegateOptions() + )), + a(b.currentTarget).data("bs." + this.type, c)), + b instanceof a.Event && + (c.inState[ + "focusout" == b.type ? "focus" : "hover" + ] = !1), + !c.isInStateTrue()) + ) + return ( + clearTimeout(c.timeout), + (c.hoverState = "out"), + c.options.delay && c.options.delay.hide + ? void (c.timeout = setTimeout(function() { + "out" == c.hoverState && c.hide(); + }, c.options.delay.hide)) + : c.hide() + ); + }), + (c.prototype.show = function() { + var b = a.Event("show.bs." + this.type); + if (this.hasContent() && this.enabled) { + this.$element.trigger(b); + var d = a.contains( + this.$element[0].ownerDocument.documentElement, + this.$element[0] + ); + if (b.isDefaultPrevented() || !d) return; + var e = this, + f = this.tip(), + g = this.getUID(this.type); + this.setContent(), + f.attr("id", g), + this.$element.attr("aria-describedby", g), + this.options.animation && f.addClass("fade"); + var h = + "function" == typeof this.options.placement + ? this.options.placement.call( + this, + f[0], + this.$element[0] + ) + : this.options.placement, + i = /\s?auto?\s?/i, + j = i.test(h); + j && (h = h.replace(i, "") || "top"), + f + .detach() + .css({ top: 0, left: 0, display: "block" }) + .addClass(h) + .data("bs." + this.type, this), + this.options.container + ? f.appendTo(this.options.container) + : f.insertAfter(this.$element), + this.$element.trigger("inserted.bs." + this.type); + var k = this.getPosition(), + l = f[0].offsetWidth, + m = f[0].offsetHeight; + if (j) { + var n = h, + o = this.getPosition(this.$viewport); + (h = + "bottom" == h && k.bottom + m > o.bottom + ? "top" + : "top" == h && k.top - m < o.top + ? "bottom" + : "right" == h && k.right + l > o.width + ? "left" + : "left" == h && k.left - l < o.left + ? "right" + : h), + f.removeClass(n).addClass(h); + } + var p = this.getCalculatedOffset(h, k, l, m); + this.applyPlacement(p, h); + var q = function() { + var a = e.hoverState; + e.$element.trigger("shown.bs." + e.type), + (e.hoverState = null), + "out" == a && e.leave(e); + }; + a.support.transition && this.$tip.hasClass("fade") + ? f + .one("bsTransitionEnd", q) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : q(); + } + }), + (c.prototype.applyPlacement = function(b, c) { + var d = this.tip(), + e = d[0].offsetWidth, + f = d[0].offsetHeight, + g = parseInt(d.css("margin-top"), 10), + h = parseInt(d.css("margin-left"), 10); + isNaN(g) && (g = 0), + isNaN(h) && (h = 0), + (b.top += g), + (b.left += h), + a.offset.setOffset( + d[0], + a.extend( + { + using: function(a) { + d.css({ + top: Math.round(a.top), + left: Math.round(a.left) + }); + } + }, + b + ), + 0 + ), + d.addClass("in"); + var i = d[0].offsetWidth, + j = d[0].offsetHeight; + "top" == c && j != f && (b.top = b.top + f - j); + var k = this.getViewportAdjustedDelta(c, b, i, j); + k.left ? (b.left += k.left) : (b.top += k.top); + var l = /top|bottom/.test(c), + m = l ? 2 * k.left - e + i : 2 * k.top - f + j, + n = l ? "offsetWidth" : "offsetHeight"; + d.offset(b), this.replaceArrow(m, d[0][n], l); + }), + (c.prototype.replaceArrow = function(a, b, c) { + this.arrow() + .css(c ? "left" : "top", 50 * (1 - a / b) + "%") + .css(c ? "top" : "left", ""); + }), + (c.prototype.setContent = function() { + var a = this.tip(), + b = this.getTitle(); + a + .find(".tooltip-inner") + [this.options.html ? "html" : "text"](b), + a.removeClass("fade in top bottom left right"); + }), + (c.prototype.hide = function(b) { + function d() { + "in" != e.hoverState && f.detach(), + e.$element && + e.$element + .removeAttr("aria-describedby") + .trigger("hidden.bs." + e.type), + b && b(); + } + var e = this, + f = a(this.$tip), + g = a.Event("hide.bs." + this.type); + if ((this.$element.trigger(g), !g.isDefaultPrevented())) + return ( + f.removeClass("in"), + a.support.transition && f.hasClass("fade") + ? f + .one("bsTransitionEnd", d) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : d(), + (this.hoverState = null), + this + ); + }), + (c.prototype.fixTitle = function() { + var a = this.$element; + (a.attr("title") || + "string" != typeof a.attr("data-original-title")) && + a + .attr("data-original-title", a.attr("title") || "") + .attr("title", ""); + }), + (c.prototype.hasContent = function() { + return this.getTitle(); + }), + (c.prototype.getPosition = function(b) { + b = b || this.$element; + var c = b[0], + d = "BODY" == c.tagName, + e = c.getBoundingClientRect(); + null == e.width && + (e = a.extend({}, e, { + width: e.right - e.left, + height: e.bottom - e.top + })); + var f = window.SVGElement && c instanceof window.SVGElement, + g = d ? { top: 0, left: 0 } : f ? null : b.offset(), + h = { + scroll: d + ? document.documentElement.scrollTop || + document.body.scrollTop + : b.scrollTop() + }, + i = d + ? { + width: a(window).width(), + height: a(window).height() + } + : null; + return a.extend({}, e, h, i, g); + }), + (c.prototype.getCalculatedOffset = function(a, b, c, d) { + return "bottom" == a + ? { + top: b.top + b.height, + left: b.left + b.width / 2 - c / 2 + } + : "top" == a + ? { top: b.top - d, left: b.left + b.width / 2 - c / 2 } + : "left" == a + ? { top: b.top + b.height / 2 - d / 2, left: b.left - c } + : { + top: b.top + b.height / 2 - d / 2, + left: b.left + b.width + }; + }), + (c.prototype.getViewportAdjustedDelta = function(a, b, c, d) { + var e = { top: 0, left: 0 }; + if (!this.$viewport) return e; + var f = + (this.options.viewport && + this.options.viewport.padding) || + 0, + g = this.getPosition(this.$viewport); + if (/right|left/.test(a)) { + var h = b.top - f - g.scroll, + i = b.top + f - g.scroll + d; + h < g.top + ? (e.top = g.top - h) + : i > g.top + g.height && + (e.top = g.top + g.height - i); + } else { + var j = b.left - f, + k = b.left + f + c; + j < g.left + ? (e.left = g.left - j) + : k > g.right && (e.left = g.left + g.width - k); + } + return e; + }), + (c.prototype.getTitle = function() { + var a, + b = this.$element, + c = this.options; + return (a = + b.attr("data-original-title") || + ("function" == typeof c.title + ? c.title.call(b[0]) + : c.title)); + }), + (c.prototype.getUID = function(a) { + do a += ~~(1e6 * Math.random()); + while (document.getElementById(a)); + return a; + }), + (c.prototype.tip = function() { + if ( + !this.$tip && + ((this.$tip = a(this.options.template)), + 1 != this.$tip.length) + ) + throw new Error( + this.type + + " `template` option must consist of exactly 1 top-level element!" + ); + return this.$tip; + }), + (c.prototype.arrow = function() { + return (this.$arrow = + this.$arrow || this.tip().find(".tooltip-arrow")); + }), + (c.prototype.enable = function() { + this.enabled = !0; + }), + (c.prototype.disable = function() { + this.enabled = !1; + }), + (c.prototype.toggleEnabled = function() { + this.enabled = !this.enabled; + }), + (c.prototype.toggle = function(b) { + var c = this; + b && + ((c = a(b.currentTarget).data("bs." + this.type)), + c || + ((c = new this.constructor( + b.currentTarget, + this.getDelegateOptions() + )), + a(b.currentTarget).data("bs." + this.type, c))), + b + ? ((c.inState.click = !c.inState.click), + c.isInStateTrue() ? c.enter(c) : c.leave(c)) + : c.tip().hasClass("in") + ? c.leave(c) + : c.enter(c); + }), + (c.prototype.destroy = function() { + var a = this; + clearTimeout(this.timeout), + this.hide(function() { + a.$element.off("." + a.type).removeData("bs." + a.type), + a.$tip && a.$tip.detach(), + (a.$tip = null), + (a.$arrow = null), + (a.$viewport = null), + (a.$element = null); + }); + }); + var d = a.fn.tooltip; + (a.fn.tooltip = b), + (a.fn.tooltip.Constructor = c), + (a.fn.tooltip.noConflict = function() { + return (a.fn.tooltip = d), this; + }); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var d = a(this), + e = d.data("bs.popover"), + f = "object" == typeof b && b; + (!e && /destroy|hide/.test(b)) || + (e || d.data("bs.popover", (e = new c(this, f))), + "string" == typeof b && e[b]()); + }); + } + var c = function(a, b) { + this.init("popover", a, b); + }; + if (!a.fn.tooltip) throw new Error("Popover requires tooltip.js"); + (c.VERSION = "3.3.7"), + (c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, { + placement: "right", + trigger: "click", + content: "", + template: + '' + })), + (c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype)), + (c.prototype.constructor = c), + (c.prototype.getDefaults = function() { + return c.DEFAULTS; + }), + (c.prototype.setContent = function() { + var a = this.tip(), + b = this.getTitle(), + c = this.getContent(); + a + .find(".popover-title") + [this.options.html ? "html" : "text"](b), + a + .find(".popover-content") + .children() + .detach() + .end() + [ + this.options.html + ? "string" == typeof c + ? "html" + : "append" + : "text" + ](c), + a.removeClass("fade top bottom left right in"), + a.find(".popover-title").html() || + a.find(".popover-title").hide(); + }), + (c.prototype.hasContent = function() { + return this.getTitle() || this.getContent(); + }), + (c.prototype.getContent = function() { + var a = this.$element, + b = this.options; + return ( + a.attr("data-content") || + ("function" == typeof b.content + ? b.content.call(a[0]) + : b.content) + ); + }), + (c.prototype.arrow = function() { + return (this.$arrow = this.$arrow || this.tip().find(".arrow")); + }); + var d = a.fn.popover; + (a.fn.popover = b), + (a.fn.popover.Constructor = c), + (a.fn.popover.noConflict = function() { + return (a.fn.popover = d), this; + }); + })(jQuery), + +(function(a) { + "use strict"; + function b(c, d) { + (this.$body = a(document.body)), + (this.$scrollElement = a(a(c).is(document.body) ? window : c)), + (this.options = a.extend({}, b.DEFAULTS, d)), + (this.selector = (this.options.target || "") + " .nav li > a"), + (this.offsets = []), + (this.targets = []), + (this.activeTarget = null), + (this.scrollHeight = 0), + this.$scrollElement.on( + "scroll.bs.scrollspy", + a.proxy(this.process, this) + ), + this.refresh(), + this.process(); + } + function c(c) { + return this.each(function() { + var d = a(this), + e = d.data("bs.scrollspy"), + f = "object" == typeof c && c; + e || d.data("bs.scrollspy", (e = new b(this, f))), + "string" == typeof c && e[c](); + }); + } + (b.VERSION = "3.3.7"), + (b.DEFAULTS = { offset: 10 }), + (b.prototype.getScrollHeight = function() { + return ( + this.$scrollElement[0].scrollHeight || + Math.max( + this.$body[0].scrollHeight, + document.documentElement.scrollHeight + ) + ); + }), + (b.prototype.refresh = function() { + var b = this, + c = "offset", + d = 0; + (this.offsets = []), + (this.targets = []), + (this.scrollHeight = this.getScrollHeight()), + a.isWindow(this.$scrollElement[0]) || + ((c = "position"), + (d = this.$scrollElement.scrollTop())), + this.$body + .find(this.selector) + .map(function() { + var b = a(this), + e = b.data("target") || b.attr("href"), + f = /^#./.test(e) && a(e); + return ( + (f && + f.length && + f.is(":visible") && [ + [f[c]().top + d, e] + ]) || + null + ); + }) + .sort(function(a, b) { + return a[0] - b[0]; + }) + .each(function() { + b.offsets.push(this[0]), b.targets.push(this[1]); + }); + }), + (b.prototype.process = function() { + var a, + b = this.$scrollElement.scrollTop() + this.options.offset, + c = this.getScrollHeight(), + d = this.options.offset + c - this.$scrollElement.height(), + e = this.offsets, + f = this.targets, + g = this.activeTarget; + if ((this.scrollHeight != c && this.refresh(), b >= d)) + return g != (a = f[f.length - 1]) && this.activate(a); + if (g && b < e[0]) + return (this.activeTarget = null), this.clear(); + for (a = e.length; a--; ) + g != f[a] && + b >= e[a] && + (void 0 === e[a + 1] || b < e[a + 1]) && + this.activate(f[a]); + }), + (b.prototype.activate = function(b) { + (this.activeTarget = b), this.clear(); + var c = + this.selector + + '[data-target="' + + b + + '"],' + + this.selector + + '[href="' + + b + + '"]', + d = a(c) + .parents("li") + .addClass("active"); + d.parent(".dropdown-menu").length && + (d = d.closest("li.dropdown").addClass("active")), + d.trigger("activate.bs.scrollspy"); + }), + (b.prototype.clear = function() { + a(this.selector) + .parentsUntil(this.options.target, ".active") + .removeClass("active"); + }); + var d = a.fn.scrollspy; + (a.fn.scrollspy = c), + (a.fn.scrollspy.Constructor = b), + (a.fn.scrollspy.noConflict = function() { + return (a.fn.scrollspy = d), this; + }), + a(window).on("load.bs.scrollspy.data-api", function() { + a('[data-spy="scroll"]').each(function() { + var b = a(this); + c.call(b, b.data()); + }); + }); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var d = a(this), + e = d.data("bs.tab"); + e || d.data("bs.tab", (e = new c(this))), + "string" == typeof b && e[b](); + }); + } + var c = function(b) { + this.element = a(b); + }; + (c.VERSION = "3.3.7"), + (c.TRANSITION_DURATION = 150), + (c.prototype.show = function() { + var b = this.element, + c = b.closest("ul:not(.dropdown-menu)"), + d = b.data("target"); + if ( + (d || + ((d = b.attr("href")), + (d = d && d.replace(/.*(?=#[^\s]*$)/, ""))), + !b.parent("li").hasClass("active")) + ) { + var e = c.find(".active:last a"), + f = a.Event("hide.bs.tab", { relatedTarget: b[0] }), + g = a.Event("show.bs.tab", { relatedTarget: e[0] }); + if ( + (e.trigger(f), + b.trigger(g), + !g.isDefaultPrevented() && !f.isDefaultPrevented()) + ) { + var h = a(d); + this.activate(b.closest("li"), c), + this.activate(h, h.parent(), function() { + e.trigger({ + type: "hidden.bs.tab", + relatedTarget: b[0] + }), + b.trigger({ + type: "shown.bs.tab", + relatedTarget: e[0] + }); + }); + } + } + }), + (c.prototype.activate = function(b, d, e) { + function f() { + g + .removeClass("active") + .find("> .dropdown-menu > .active") + .removeClass("active") + .end() + .find('[data-toggle="tab"]') + .attr("aria-expanded", !1), + b + .addClass("active") + .find('[data-toggle="tab"]') + .attr("aria-expanded", !0), + h + ? (b[0].offsetWidth, b.addClass("in")) + : b.removeClass("fade"), + b.parent(".dropdown-menu").length && + b + .closest("li.dropdown") + .addClass("active") + .end() + .find('[data-toggle="tab"]') + .attr("aria-expanded", !0), + e && e(); + } + var g = d.find("> .active"), + h = + e && + a.support.transition && + ((g.length && g.hasClass("fade")) || + !!d.find("> .fade").length); + g.length && h + ? g + .one("bsTransitionEnd", f) + .emulateTransitionEnd(c.TRANSITION_DURATION) + : f(), + g.removeClass("in"); + }); + var d = a.fn.tab; + (a.fn.tab = b), + (a.fn.tab.Constructor = c), + (a.fn.tab.noConflict = function() { + return (a.fn.tab = d), this; + }); + var e = function(c) { + c.preventDefault(), b.call(a(this), "show"); + }; + a(document) + .on("click.bs.tab.data-api", '[data-toggle="tab"]', e) + .on("click.bs.tab.data-api", '[data-toggle="pill"]', e); + })(jQuery), + +(function(a) { + "use strict"; + function b(b) { + return this.each(function() { + var d = a(this), + e = d.data("bs.affix"), + f = "object" == typeof b && b; + e || d.data("bs.affix", (e = new c(this, f))), + "string" == typeof b && e[b](); + }); + } + var c = function(b, d) { + (this.options = a.extend({}, c.DEFAULTS, d)), + (this.$target = a(this.options.target) + .on( + "scroll.bs.affix.data-api", + a.proxy(this.checkPosition, this) + ) + .on( + "click.bs.affix.data-api", + a.proxy(this.checkPositionWithEventLoop, this) + )), + (this.$element = a(b)), + (this.affixed = null), + (this.unpin = null), + (this.pinnedOffset = null), + this.checkPosition(); + }; + (c.VERSION = "3.3.7"), + (c.RESET = "affix affix-top affix-bottom"), + (c.DEFAULTS = { offset: 0, target: window }), + (c.prototype.getState = function(a, b, c, d) { + var e = this.$target.scrollTop(), + f = this.$element.offset(), + g = this.$target.height(); + if (null != c && "top" == this.affixed) return e < c && "top"; + if ("bottom" == this.affixed) + return null != c + ? !(e + this.unpin <= f.top) && "bottom" + : !(e + g <= a - d) && "bottom"; + var h = null == this.affixed, + i = h ? e : f.top, + j = h ? g : b; + return null != c && e <= c + ? "top" + : null != d && i + j >= a - d && "bottom"; + }), + (c.prototype.getPinnedOffset = function() { + if (this.pinnedOffset) return this.pinnedOffset; + this.$element.removeClass(c.RESET).addClass("affix"); + var a = this.$target.scrollTop(), + b = this.$element.offset(); + return (this.pinnedOffset = b.top - a); + }), + (c.prototype.checkPositionWithEventLoop = function() { + setTimeout(a.proxy(this.checkPosition, this), 1); + }), + (c.prototype.checkPosition = function() { + if (this.$element.is(":visible")) { + var b = this.$element.height(), + d = this.options.offset, + e = d.top, + f = d.bottom, + g = Math.max( + a(document).height(), + a(document.body).height() + ); + "object" != typeof d && (f = e = d), + "function" == typeof e && (e = d.top(this.$element)), + "function" == typeof f && (f = d.bottom(this.$element)); + var h = this.getState(g, b, e, f); + if (this.affixed != h) { + null != this.unpin && this.$element.css("top", ""); + var i = "affix" + (h ? "-" + h : ""), + j = a.Event(i + ".bs.affix"); + if ((this.$element.trigger(j), j.isDefaultPrevented())) + return; + (this.affixed = h), + (this.unpin = + "bottom" == h ? this.getPinnedOffset() : null), + this.$element + .removeClass(c.RESET) + .addClass(i) + .trigger( + i.replace("affix", "affixed") + ".bs.affix" + ); + } + "bottom" == h && this.$element.offset({ top: g - b - f }); + } + }); + var d = a.fn.affix; + (a.fn.affix = b), + (a.fn.affix.Constructor = c), + (a.fn.affix.noConflict = function() { + return (a.fn.affix = d), this; + }), + a(window).on("load", function() { + a('[data-spy="affix"]').each(function() { + var c = a(this), + d = c.data(); + (d.offset = d.offset || {}), + null != d.offsetBottom && + (d.offset.bottom = d.offsetBottom), + null != d.offsetTop && (d.offset.top = d.offsetTop), + b.call(c, d); + }); + }); + })(jQuery); diff --git a/docs/api/vendor/diff_match_patch.min.js b/docs/api/vendor/diff_match_patch.min.js index c41b5132..ca985442 100644 --- a/docs/api/vendor/diff_match_patch.min.js +++ b/docs/api/vendor/diff_match_patch.min.js @@ -1,49 +1,1085 @@ -(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32} -diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a, -b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a}; -diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l= -u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]}; -diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)}; -diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;fd?a=a.substring(c-d):c=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null; -var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.lengthd[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]}; -diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}}; -diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_); -return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]= -h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/; -diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;fb)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)}; -diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=//g,f=/\n/g,g=0;g");switch(h){case 1:b[g]=''+j+"";break;case -1:b[g]=''+j+"";break;case 0:b[g]=""+j+""}}return b.join("")}; -diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;cthis.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h}; -diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c=2*this.Patch_Margin&& -e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;cthis.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g); -if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;ie[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0, -c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c}; -diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&& -(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c= this.Diff_Timeout + ? Number.MAX_VALUE + : new Date().getTime() + 1e3 * this.Diff_Timeout); + if (null == a || null == b) throw Error("Null input. (diff_main)"); + if (a == b) return a ? [[0, a]] : []; + "undefined" == typeof c && (c = !0); + var e = c, + f = this.diff_commonPrefix(a, b); + c = a.substring(0, f); + a = a.substring(f); + b = b.substring(f); + var f = this.diff_commonSuffix(a, b), + g = a.substring(a.length - f); + a = a.substring(0, a.length - f); + b = b.substring(0, b.length - f); + a = this.diff_compute_(a, b, e, d); + c && a.unshift([0, c]); + g && a.push([0, g]); + this.diff_cleanupMerge(a); + return a; + }; + diff_match_patch.prototype.diff_compute_ = function(a, b, c, d) { + if (!a) return [[1, b]]; + if (!b) return [[-1, a]]; + var e = a.length > b.length ? a : b, + f = a.length > b.length ? b : a, + g = e.indexOf(f); + return -1 != g + ? ((c = [ + [1, e.substring(0, g)], + [0, f], + [1, e.substring(g + f.length)] + ]), + a.length > b.length && (c[0][0] = c[2][0] = -1), + c) + : 1 == f.length + ? [ + [-1, a], + [1, b] + ] + : (e = this.diff_halfMatch_(a, b)) + ? ((f = e[0]), + (a = e[1]), + (g = e[2]), + (b = e[3]), + (e = e[4]), + (f = this.diff_main(f, g, c, d)), + (c = this.diff_main(a, b, c, d)), + f.concat([[0, e]], c)) + : c && 100 < a.length && 100 < b.length + ? this.diff_lineMode_(a, b, d) + : this.diff_bisect_(a, b, d); + }; + diff_match_patch.prototype.diff_lineMode_ = function(a, b, c) { + var d = this.diff_linesToChars_(a, b); + a = d.chars1; + b = d.chars2; + d = d.lineArray; + a = this.diff_main(a, b, !1, c); + this.diff_charsToLines_(a, d); + this.diff_cleanupSemantic(a); + a.push([0, ""]); + for (var e = (d = b = 0), f = "", g = ""; b < a.length; ) { + switch (a[b][0]) { + case 1: + e++; + g += a[b][1]; + break; + case -1: + d++; + f += a[b][1]; + break; + case 0: + if (1 <= d && 1 <= e) { + a.splice(b - d - e, d + e); + b = b - d - e; + d = this.diff_main(f, g, !1, c); + for (e = d.length - 1; 0 <= e; e--) + a.splice(b, 0, d[e]); + b += d.length; + } + d = e = 0; + g = f = ""; + } + b++; + } + a.pop(); + return a; + }; + diff_match_patch.prototype.diff_bisect_ = function(a, b, c) { + for ( + var d = a.length, + e = b.length, + f = Math.ceil((d + e) / 2), + g = f, + h = 2 * f, + j = Array(h), + i = Array(h), + k = 0; + k < h; + k++ + ) + (j[k] = -1), (i[k] = -1); + j[g + 1] = 0; + i[g + 1] = 0; + for ( + var k = d - e, q = 0 != k % 2, r = 0, t = 0, p = 0, w = 0, v = 0; + v < f && !(new Date().getTime() > c); + v++ + ) { + for (var n = -v + r; n <= v - t; n += 2) { + var l = g + n, + m; + m = + n == -v || (n != v && j[l - 1] < j[l + 1]) + ? j[l + 1] + : j[l - 1] + 1; + for ( + var s = m - n; + m < d && s < e && a.charAt(m) == b.charAt(s); + + ) + m++, s++; + j[l] = m; + if (m > d) t += 2; + else if (s > e) r += 2; + else if ( + q && + ((l = g + k - n), 0 <= l && l < h && -1 != i[l]) + ) { + var u = d - i[l]; + if (m >= u) return this.diff_bisectSplit_(a, b, m, s, c); + } + } + for (n = -v + p; n <= v - w; n += 2) { + l = g + n; + u = + n == -v || (n != v && i[l - 1] < i[l + 1]) + ? i[l + 1] + : i[l - 1] + 1; + for ( + m = u - n; + u < d && + m < e && + a.charAt(d - u - 1) == b.charAt(e - m - 1); + + ) + u++, m++; + i[l] = u; + if (u > d) w += 2; + else if (m > e) p += 2; + else if ( + !q && + ((l = g + k - n), + 0 <= l && + l < h && + -1 != j[l] && + ((m = j[l]), (s = g + m - l), (u = d - u), m >= u)) + ) + return this.diff_bisectSplit_(a, b, m, s, c); + } + } + return [ + [-1, a], + [1, b] + ]; + }; + diff_match_patch.prototype.diff_bisectSplit_ = function(a, b, c, d, e) { + var f = a.substring(0, c), + g = b.substring(0, d); + a = a.substring(c); + b = b.substring(d); + f = this.diff_main(f, g, !1, e); + e = this.diff_main(a, b, !1, e); + return f.concat(e); + }; + diff_match_patch.prototype.diff_linesToChars_ = function(a, b) { + function c(a) { + for (var b = "", c = 0, f = -1, g = d.length; f < a.length - 1; ) { + f = a.indexOf("\n", c); + -1 == f && (f = a.length - 1); + var r = a.substring(c, f + 1), + c = f + 1; + (e.hasOwnProperty + ? e.hasOwnProperty(r) + : void 0 !== e[r]) + ? (b += String.fromCharCode(e[r])) + : ((b += String.fromCharCode(g)), (e[r] = g), (d[g++] = r)); + } + return b; + } + var d = [], + e = {}; + d[0] = ""; + var f = c(a), + g = c(b); + return { chars1: f, chars2: g, lineArray: d }; + }; + diff_match_patch.prototype.diff_charsToLines_ = function(a, b) { + for (var c = 0; c < a.length; c++) { + for (var d = a[c][1], e = [], f = 0; f < d.length; f++) + e[f] = b[d.charCodeAt(f)]; + a[c][1] = e.join(""); + } + }; + diff_match_patch.prototype.diff_commonPrefix = function(a, b) { + if (!a || !b || a.charAt(0) != b.charAt(0)) return 0; + for (var c = 0, d = Math.min(a.length, b.length), e = d, f = 0; c < e; ) + a.substring(f, e) == b.substring(f, e) ? (f = c = e) : (d = e), + (e = Math.floor((d - c) / 2 + c)); + return e; + }; + diff_match_patch.prototype.diff_commonSuffix = function(a, b) { + if (!a || !b || a.charAt(a.length - 1) != b.charAt(b.length - 1)) + return 0; + for (var c = 0, d = Math.min(a.length, b.length), e = d, f = 0; c < e; ) + a.substring(a.length - e, a.length - f) == + b.substring(b.length - e, b.length - f) + ? (f = c = e) + : (d = e), + (e = Math.floor((d - c) / 2 + c)); + return e; + }; + diff_match_patch.prototype.diff_commonOverlap_ = function(a, b) { + var c = a.length, + d = b.length; + if (0 == c || 0 == d) return 0; + c > d ? (a = a.substring(c - d)) : c < d && (b = b.substring(0, c)); + c = Math.min(c, d); + if (a == b) return c; + for (var d = 0, e = 1; ; ) { + var f = a.substring(c - e), + f = b.indexOf(f); + if (-1 == f) return d; + e += f; + if (0 == f || a.substring(c - e) == b.substring(0, e)) (d = e), e++; + } + }; + diff_match_patch.prototype.diff_halfMatch_ = function(a, b) { + function c(a, b, c) { + for ( + var d = a.substring(c, c + Math.floor(a.length / 4)), + e = -1, + g = "", + h, + j, + n, + l; + -1 != (e = b.indexOf(d, e + 1)); + + ) { + var m = f.diff_commonPrefix(a.substring(c), b.substring(e)), + s = f.diff_commonSuffix( + a.substring(0, c), + b.substring(0, e) + ); + g.length < s + m && + ((g = b.substring(e - s, e) + b.substring(e, e + m)), + (h = a.substring(0, c - s)), + (j = a.substring(c + m)), + (n = b.substring(0, e - s)), + (l = b.substring(e + m))); + } + return 2 * g.length >= a.length ? [h, j, n, l, g] : null; + } + if (0 >= this.Diff_Timeout) return null; + var d = a.length > b.length ? a : b, + e = a.length > b.length ? b : a; + if (4 > d.length || 2 * e.length < d.length) return null; + var f = this, + g = c(d, e, Math.ceil(d.length / 4)), + d = c(d, e, Math.ceil(d.length / 2)), + h; + if (!g && !d) return null; + h = d ? (g ? (g[4].length > d[4].length ? g : d) : d) : g; + var j; + a.length > b.length + ? ((g = h[0]), (d = h[1]), (e = h[2]), (j = h[3])) + : ((e = h[0]), (j = h[1]), (g = h[2]), (d = h[3])); + h = h[4]; + return [g, d, e, j, h]; + }; + diff_match_patch.prototype.diff_cleanupSemantic = function(a) { + for ( + var b = !1, + c = [], + d = 0, + e = null, + f = 0, + g = 0, + h = 0, + j = 0, + i = 0; + f < a.length; + + ) + 0 == a[f][0] + ? ((c[d++] = f), (g = j), (h = i), (i = j = 0), (e = a[f][1])) + : (1 == a[f][0] ? (j += a[f][1].length) : (i += a[f][1].length), + e && + e.length <= Math.max(g, h) && + e.length <= Math.max(j, i) && + (a.splice(c[d - 1], 0, [-1, e]), + (a[c[d - 1] + 1][0] = 1), + d--, + d--, + (f = 0 < d ? c[d - 1] : -1), + (i = j = h = g = 0), + (e = null), + (b = !0))), + f++; + b && this.diff_cleanupMerge(a); + this.diff_cleanupSemanticLossless(a); + for (f = 1; f < a.length; ) { + if (-1 == a[f - 1][0] && 1 == a[f][0]) { + b = a[f - 1][1]; + c = a[f][1]; + d = this.diff_commonOverlap_(b, c); + e = this.diff_commonOverlap_(c, b); + if (d >= e) { + if (d >= b.length / 2 || d >= c.length / 2) + a.splice(f, 0, [0, c.substring(0, d)]), + (a[f - 1][1] = b.substring(0, b.length - d)), + (a[f + 1][1] = c.substring(d)), + f++; + } else if (e >= b.length / 2 || e >= c.length / 2) + a.splice(f, 0, [0, b.substring(0, e)]), + (a[f - 1][0] = 1), + (a[f - 1][1] = c.substring(0, c.length - e)), + (a[f + 1][0] = -1), + (a[f + 1][1] = b.substring(e)), + f++; + f++; + } + f++; + } + }; + diff_match_patch.prototype.diff_cleanupSemanticLossless = function(a) { + function b(a, b) { + if (!a || !b) return 6; + var c = a.charAt(a.length - 1), + d = b.charAt(0), + e = c.match(diff_match_patch.nonAlphaNumericRegex_), + f = d.match(diff_match_patch.nonAlphaNumericRegex_), + g = e && c.match(diff_match_patch.whitespaceRegex_), + h = f && d.match(diff_match_patch.whitespaceRegex_), + c = g && c.match(diff_match_patch.linebreakRegex_), + d = h && d.match(diff_match_patch.linebreakRegex_), + i = c && a.match(diff_match_patch.blanklineEndRegex_), + j = d && b.match(diff_match_patch.blanklineStartRegex_); + return i || j + ? 5 + : c || d + ? 4 + : e && !g && h + ? 3 + : g || h + ? 2 + : e || f + ? 1 + : 0; + } + for (var c = 1; c < a.length - 1; ) { + if (0 == a[c - 1][0] && 0 == a[c + 1][0]) { + var d = a[c - 1][1], + e = a[c][1], + f = a[c + 1][1], + g = this.diff_commonSuffix(d, e); + if (g) + var h = e.substring(e.length - g), + d = d.substring(0, d.length - g), + e = h + e.substring(0, e.length - g), + f = h + f; + for ( + var g = d, h = e, j = f, i = b(d, e) + b(e, f); + e.charAt(0) === f.charAt(0); + + ) { + var d = d + e.charAt(0), + e = e.substring(1) + f.charAt(0), + f = f.substring(1), + k = b(d, e) + b(e, f); + k >= i && ((i = k), (g = d), (h = e), (j = f)); + } + a[c - 1][1] != g && + (g ? (a[c - 1][1] = g) : (a.splice(c - 1, 1), c--), + (a[c][1] = h), + j ? (a[c + 1][1] = j) : (a.splice(c + 1, 1), c--)); + } + c++; + } + }; + diff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/; + diff_match_patch.whitespaceRegex_ = /\s/; + diff_match_patch.linebreakRegex_ = /[\r\n]/; + diff_match_patch.blanklineEndRegex_ = /\n\r?\n$/; + diff_match_patch.blanklineStartRegex_ = /^\r?\n\r?\n/; + diff_match_patch.prototype.diff_cleanupEfficiency = function(a) { + for ( + var b = !1, + c = [], + d = 0, + e = null, + f = 0, + g = !1, + h = !1, + j = !1, + i = !1; + f < a.length; + + ) { + if (0 == a[f][0]) + a[f][1].length < this.Diff_EditCost && (j || i) + ? ((c[d++] = f), (g = j), (h = i), (e = a[f][1])) + : ((d = 0), (e = null)), + (j = i = !1); + else if ( + (-1 == a[f][0] ? (i = !0) : (j = !0), + e && + ((g && h && j && i) || + (e.length < this.Diff_EditCost / 2 && + 3 == g + h + j + i))) + ) + a.splice(c[d - 1], 0, [-1, e]), + (a[c[d - 1] + 1][0] = 1), + d--, + (e = null), + g && h + ? ((j = i = !0), (d = 0)) + : (d--, (f = 0 < d ? c[d - 1] : -1), (j = i = !1)), + (b = !0); + f++; + } + b && this.diff_cleanupMerge(a); + }; + diff_match_patch.prototype.diff_cleanupMerge = function(a) { + a.push([0, ""]); + for (var b = 0, c = 0, d = 0, e = "", f = "", g; b < a.length; ) + switch (a[b][0]) { + case 1: + d++; + f += a[b][1]; + b++; + break; + case -1: + c++; + e += a[b][1]; + b++; + break; + case 0: + 1 < c + d + ? (0 !== c && + 0 !== d && + ((g = this.diff_commonPrefix(f, e)), + 0 !== g && + (0 < b - c - d && 0 == a[b - c - d - 1][0] + ? (a[b - c - d - 1][1] += f.substring( + 0, + g + )) + : (a.splice(0, 0, [0, f.substring(0, g)]), + b++), + (f = f.substring(g)), + (e = e.substring(g))), + (g = this.diff_commonSuffix(f, e)), + 0 !== g && + ((a[b][1] = + f.substring(f.length - g) + a[b][1]), + (f = f.substring(0, f.length - g)), + (e = e.substring(0, e.length - g)))), + 0 === c + ? a.splice(b - d, c + d, [1, f]) + : 0 === d + ? a.splice(b - c, c + d, [-1, e]) + : a.splice(b - c - d, c + d, [-1, e], [1, f]), + (b = b - c - d + (c ? 1 : 0) + (d ? 1 : 0) + 1)) + : 0 !== b && 0 == a[b - 1][0] + ? ((a[b - 1][1] += a[b][1]), a.splice(b, 1)) + : b++, + (c = d = 0), + (f = e = ""); + } + "" === a[a.length - 1][1] && a.pop(); + c = !1; + for (b = 1; b < a.length - 1; ) + 0 == a[b - 1][0] && + 0 == a[b + 1][0] && + (a[b][1].substring(a[b][1].length - a[b - 1][1].length) == + a[b - 1][1] + ? ((a[b][1] = + a[b - 1][1] + + a[b][1].substring( + 0, + a[b][1].length - a[b - 1][1].length + )), + (a[b + 1][1] = a[b - 1][1] + a[b + 1][1]), + a.splice(b - 1, 1), + (c = !0)) + : a[b][1].substring(0, a[b + 1][1].length) == a[b + 1][1] && + ((a[b - 1][1] += a[b + 1][1]), + (a[b][1] = + a[b][1].substring(a[b + 1][1].length) + a[b + 1][1]), + a.splice(b + 1, 1), + (c = !0))), + b++; + c && this.diff_cleanupMerge(a); + }; + diff_match_patch.prototype.diff_xIndex = function(a, b) { + var c = 0, + d = 0, + e = 0, + f = 0, + g; + for (g = 0; g < a.length; g++) { + 1 !== a[g][0] && (c += a[g][1].length); + -1 !== a[g][0] && (d += a[g][1].length); + if (c > b) break; + e = c; + f = d; + } + return a.length != g && -1 === a[g][0] ? f : f + (b - e); + }; + diff_match_patch.prototype.diff_prettyHtml = function(a) { + for ( + var b = [], c = /&/g, d = //g, f = /\n/g, g = 0; + g < a.length; + g++ + ) { + var h = a[g][0], + j = a[g][1], + j = j + .replace(c, "&") + .replace(d, "<") + .replace(e, ">") + .replace(f, "¶
"); + switch (h) { + case 1: + b[g] = '' + j + ""; + break; + case -1: + b[g] = '' + j + ""; + break; + case 0: + b[g] = "" + j + ""; + } + } + return b.join(""); + }; + diff_match_patch.prototype.diff_text1 = function(a) { + for (var b = [], c = 0; c < a.length; c++) + 1 !== a[c][0] && (b[c] = a[c][1]); + return b.join(""); + }; + diff_match_patch.prototype.diff_text2 = function(a) { + for (var b = [], c = 0; c < a.length; c++) + -1 !== a[c][0] && (b[c] = a[c][1]); + return b.join(""); + }; + diff_match_patch.prototype.diff_levenshtein = function(a) { + for (var b = 0, c = 0, d = 0, e = 0; e < a.length; e++) { + var f = a[e][0], + g = a[e][1]; + switch (f) { + case 1: + c += g.length; + break; + case -1: + d += g.length; + break; + case 0: + (b += Math.max(c, d)), (d = c = 0); + } + } + return (b += Math.max(c, d)); + }; + diff_match_patch.prototype.diff_toDelta = function(a) { + for (var b = [], c = 0; c < a.length; c++) + switch (a[c][0]) { + case 1: + b[c] = "+" + encodeURI(a[c][1]); + break; + case -1: + b[c] = "-" + a[c][1].length; + break; + case 0: + b[c] = "=" + a[c][1].length; + } + return b.join("\t").replace(/%20/g, " "); + }; + diff_match_patch.prototype.diff_fromDelta = function(a, b) { + for ( + var c = [], d = 0, e = 0, f = b.split(/\t/g), g = 0; + g < f.length; + g++ + ) { + var h = f[g].substring(1); + switch (f[g].charAt(0)) { + case "+": + try { + c[d++] = [1, decodeURI(h)]; + } catch (j) { + throw Error("Illegal escape in diff_fromDelta: " + h); + } + break; + case "-": + case "=": + var i = parseInt(h, 10); + if (isNaN(i) || 0 > i) + throw Error("Invalid number in diff_fromDelta: " + h); + h = a.substring(e, (e += i)); + "=" == f[g].charAt(0) + ? (c[d++] = [0, h]) + : (c[d++] = [-1, h]); + break; + default: + if (f[g]) + throw Error( + "Invalid diff operation in diff_fromDelta: " + f[g] + ); + } + } + if (e != a.length) + throw Error( + "Delta length (" + + e + + ") does not equal source text length (" + + a.length + + ")." + ); + return c; + }; + diff_match_patch.prototype.match_main = function(a, b, c) { + if (null == a || null == b || null == c) + throw Error("Null input. (match_main)"); + c = Math.max(0, Math.min(c, a.length)); + return a == b + ? 0 + : a.length + ? a.substring(c, c + b.length) == b + ? c + : this.match_bitap_(a, b, c) + : -1; + }; + diff_match_patch.prototype.match_bitap_ = function(a, b, c) { + function d(a, d) { + var e = a / b.length, + g = Math.abs(c - d); + return !f.Match_Distance ? (g ? 1 : e) : e + g / f.Match_Distance; + } + if (b.length > this.Match_MaxBits) + throw Error("Pattern too long for this browser."); + var e = this.match_alphabet_(b), + f = this, + g = this.Match_Threshold, + h = a.indexOf(b, c); + -1 != h && + ((g = Math.min(d(0, h), g)), + (h = a.lastIndexOf(b, c + b.length)), + -1 != h && (g = Math.min(d(0, h), g))); + for ( + var j = 1 << (b.length - 1), + h = -1, + i, + k, + q = b.length + a.length, + r, + t = 0; + t < b.length; + t++ + ) { + i = 0; + for (k = q; i < k; ) + d(t, c + k) <= g ? (i = k) : (q = k), + (k = Math.floor((q - i) / 2 + i)); + q = k; + i = Math.max(1, c - k + 1); + var p = Math.min(c + k, a.length) + b.length; + k = Array(p + 2); + for (k[p + 1] = (1 << t) - 1; p >= i; p--) { + var w = e[a.charAt(p - 1)]; + k[p] = + 0 === t + ? ((k[p + 1] << 1) | 1) & w + : (((k[p + 1] << 1) | 1) & w) | + (((r[p + 1] | r[p]) << 1) | 1) | + r[p + 1]; + if (k[p] & j && ((w = d(t, p - 1)), w <= g)) + if (((g = w), (h = p - 1), h > c)) + i = Math.max(1, 2 * c - h); + else break; + } + if (d(t + 1, c) > g) break; + r = k; + } + return h; + }; + diff_match_patch.prototype.match_alphabet_ = function(a) { + for (var b = {}, c = 0; c < a.length; c++) b[a.charAt(c)] = 0; + for (c = 0; c < a.length; c++) + b[a.charAt(c)] |= 1 << (a.length - c - 1); + return b; + }; + diff_match_patch.prototype.patch_addContext_ = function(a, b) { + if (0 != b.length) { + for ( + var c = b.substring(a.start2, a.start2 + a.length1), d = 0; + b.indexOf(c) != b.lastIndexOf(c) && + c.length < + this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin; + + ) + (d += this.Patch_Margin), + (c = b.substring(a.start2 - d, a.start2 + a.length1 + d)); + d += this.Patch_Margin; + (c = b.substring(a.start2 - d, a.start2)) && + a.diffs.unshift([0, c]); + (d = b.substring(a.start2 + a.length1, a.start2 + a.length1 + d)) && + a.diffs.push([0, d]); + a.start1 -= c.length; + a.start2 -= c.length; + a.length1 += c.length + d.length; + a.length2 += c.length + d.length; + } + }; + diff_match_patch.prototype.patch_make = function(a, b, c) { + var d; + if ( + "string" == typeof a && + "string" == typeof b && + "undefined" == typeof c + ) + (d = a), + (b = this.diff_main(d, b, !0)), + 2 < b.length && + (this.diff_cleanupSemantic(b), + this.diff_cleanupEfficiency(b)); + else if ( + a && + "object" == typeof a && + "undefined" == typeof b && + "undefined" == typeof c + ) + (b = a), (d = this.diff_text1(b)); + else if ( + "string" == typeof a && + b && + "object" == typeof b && + "undefined" == typeof c + ) + d = a; + else if ( + "string" == typeof a && + "string" == typeof b && + c && + "object" == typeof c + ) + (d = a), (b = c); + else throw Error("Unknown call format to patch_make."); + if (0 === b.length) return []; + c = []; + a = new diff_match_patch.patch_obj(); + for (var e = 0, f = 0, g = 0, h = d, j = 0; j < b.length; j++) { + var i = b[j][0], + k = b[j][1]; + !e && 0 !== i && ((a.start1 = f), (a.start2 = g)); + switch (i) { + case 1: + a.diffs[e++] = b[j]; + a.length2 += k.length; + d = d.substring(0, g) + k + d.substring(g); + break; + case -1: + a.length1 += k.length; + a.diffs[e++] = b[j]; + d = d.substring(0, g) + d.substring(g + k.length); + break; + case 0: + k.length <= 2 * this.Patch_Margin && e && b.length != j + 1 + ? ((a.diffs[e++] = b[j]), + (a.length1 += k.length), + (a.length2 += k.length)) + : k.length >= 2 * this.Patch_Margin && + e && + (this.patch_addContext_(a, h), + c.push(a), + (a = new diff_match_patch.patch_obj()), + (e = 0), + (h = d), + (f = g)); + } + 1 !== i && (f += k.length); + -1 !== i && (g += k.length); + } + e && (this.patch_addContext_(a, h), c.push(a)); + return c; + }; + diff_match_patch.prototype.patch_deepCopy = function(a) { + for (var b = [], c = 0; c < a.length; c++) { + var d = a[c], + e = new diff_match_patch.patch_obj(); + e.diffs = []; + for (var f = 0; f < d.diffs.length; f++) + e.diffs[f] = d.diffs[f].slice(); + e.start1 = d.start1; + e.start2 = d.start2; + e.length1 = d.length1; + e.length2 = d.length2; + b[c] = e; + } + return b; + }; + diff_match_patch.prototype.patch_apply = function(a, b) { + if (0 == a.length) return [b, []]; + a = this.patch_deepCopy(a); + var c = this.patch_addPadding(a); + b = c + b + c; + this.patch_splitMax(a); + for (var d = 0, e = [], f = 0; f < a.length; f++) { + var g = a[f].start2 + d, + h = this.diff_text1(a[f].diffs), + j, + i = -1; + if (h.length > this.Match_MaxBits) { + if ( + ((j = this.match_main( + b, + h.substring(0, this.Match_MaxBits), + g + )), + -1 != j && + ((i = this.match_main( + b, + h.substring(h.length - this.Match_MaxBits), + g + h.length - this.Match_MaxBits + )), + -1 == i || j >= i)) + ) + j = -1; + } else j = this.match_main(b, h, g); + if (-1 == j) (e[f] = !1), (d -= a[f].length2 - a[f].length1); + else if ( + ((e[f] = !0), + (d = j - g), + (g = + -1 == i + ? b.substring(j, j + h.length) + : b.substring(j, i + this.Match_MaxBits)), + h == g) + ) + b = + b.substring(0, j) + + this.diff_text2(a[f].diffs) + + b.substring(j + h.length); + else if ( + ((g = this.diff_main(h, g, !1)), + h.length > this.Match_MaxBits && + this.diff_levenshtein(g) / h.length > + this.Patch_DeleteThreshold) + ) + e[f] = !1; + else { + this.diff_cleanupSemanticLossless(g); + for (var h = 0, k, i = 0; i < a[f].diffs.length; i++) { + var q = a[f].diffs[i]; + 0 !== q[0] && (k = this.diff_xIndex(g, h)); + 1 === q[0] + ? (b = + b.substring(0, j + k) + q[1] + b.substring(j + k)) + : -1 === q[0] && + (b = + b.substring(0, j + k) + + b.substring( + j + this.diff_xIndex(g, h + q[1].length) + )); + -1 !== q[0] && (h += q[1].length); + } + } + } + b = b.substring(c.length, b.length - c.length); + return [b, e]; + }; + diff_match_patch.prototype.patch_addPadding = function(a) { + for (var b = this.Patch_Margin, c = "", d = 1; d <= b; d++) + c += String.fromCharCode(d); + for (d = 0; d < a.length; d++) (a[d].start1 += b), (a[d].start2 += b); + var d = a[0], + e = d.diffs; + if (0 == e.length || 0 != e[0][0]) + e.unshift([0, c]), + (d.start1 -= b), + (d.start2 -= b), + (d.length1 += b), + (d.length2 += b); + else if (b > e[0][1].length) { + var f = b - e[0][1].length; + e[0][1] = c.substring(e[0][1].length) + e[0][1]; + d.start1 -= f; + d.start2 -= f; + d.length1 += f; + d.length2 += f; + } + d = a[a.length - 1]; + e = d.diffs; + 0 == e.length || 0 != e[e.length - 1][0] + ? (e.push([0, c]), (d.length1 += b), (d.length2 += b)) + : b > e[e.length - 1][1].length && + ((f = b - e[e.length - 1][1].length), + (e[e.length - 1][1] += c.substring(0, f)), + (d.length1 += f), + (d.length2 += f)); + return c; + }; + diff_match_patch.prototype.patch_splitMax = function(a) { + for (var b = this.Match_MaxBits, c = 0; c < a.length; c++) + if (!(a[c].length1 <= b)) { + var d = a[c]; + a.splice(c--, 1); + for ( + var e = d.start1, f = d.start2, g = ""; + 0 !== d.diffs.length; + + ) { + var h = new diff_match_patch.patch_obj(), + j = !0; + h.start1 = e - g.length; + h.start2 = f - g.length; + "" !== g && + ((h.length1 = h.length2 = g.length), + h.diffs.push([0, g])); + for ( + ; + 0 !== d.diffs.length && + h.length1 < b - this.Patch_Margin; + + ) { + var g = d.diffs[0][0], + i = d.diffs[0][1]; + 1 === g + ? ((h.length2 += i.length), + (f += i.length), + h.diffs.push(d.diffs.shift()), + (j = !1)) + : -1 === g && + 1 == h.diffs.length && + 0 == h.diffs[0][0] && + i.length > 2 * b + ? ((h.length1 += i.length), + (e += i.length), + (j = !1), + h.diffs.push([g, i]), + d.diffs.shift()) + : ((i = i.substring( + 0, + b - h.length1 - this.Patch_Margin + )), + (h.length1 += i.length), + (e += i.length), + 0 === g + ? ((h.length2 += i.length), (f += i.length)) + : (j = !1), + h.diffs.push([g, i]), + i == d.diffs[0][1] + ? d.diffs.shift() + : (d.diffs[0][1] = d.diffs[0][1].substring( + i.length + ))); + } + g = this.diff_text2(h.diffs); + g = g.substring(g.length - this.Patch_Margin); + i = this.diff_text1(d.diffs).substring( + 0, + this.Patch_Margin + ); + "" !== i && + ((h.length1 += i.length), + (h.length2 += i.length), + 0 !== h.diffs.length && + 0 === h.diffs[h.diffs.length - 1][0] + ? (h.diffs[h.diffs.length - 1][1] += i) + : h.diffs.push([0, i])); + j || a.splice(++c, 0, h); + } + } + }; + diff_match_patch.prototype.patch_toText = function(a) { + for (var b = [], c = 0; c < a.length; c++) b[c] = a[c]; + return b.join(""); + }; + diff_match_patch.prototype.patch_fromText = function(a) { + var b = []; + if (!a) return b; + a = a.split("\n"); + for ( + var c = 0, d = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/; + c < a.length; + + ) { + var e = a[c].match(d); + if (!e) throw Error("Invalid patch string: " + a[c]); + var f = new diff_match_patch.patch_obj(); + b.push(f); + f.start1 = parseInt(e[1], 10); + "" === e[2] + ? (f.start1--, (f.length1 = 1)) + : "0" == e[2] + ? (f.length1 = 0) + : (f.start1--, (f.length1 = parseInt(e[2], 10))); + f.start2 = parseInt(e[3], 10); + "" === e[4] + ? (f.start2--, (f.length2 = 1)) + : "0" == e[4] + ? (f.length2 = 0) + : (f.start2--, (f.length2 = parseInt(e[4], 10))); + for (c++; c < a.length; ) { + e = a[c].charAt(0); + try { + var g = decodeURI(a[c].substring(1)); + } catch (h) { + throw Error("Illegal escape in patch_fromText: " + g); + } + if ("-" == e) f.diffs.push([-1, g]); + else if ("+" == e) f.diffs.push([1, g]); + else if (" " == e) f.diffs.push([0, g]); + else if ("@" == e) break; + else if ("" !== e) + throw Error('Invalid patch mode "' + e + '" in: ' + g); + c++; + } + } + return b; + }; + diff_match_patch.patch_obj = function() { + this.diffs = []; + this.start2 = this.start1 = null; + this.length2 = this.length1 = 0; + }; + diff_match_patch.patch_obj.prototype.toString = function() { + var a, b; + a = + 0 === this.length1 + ? this.start1 + ",0" + : 1 == this.length1 + ? this.start1 + 1 + : this.start1 + 1 + "," + this.length1; + b = + 0 === this.length2 + ? this.start2 + ",0" + : 1 == this.length2 + ? this.start2 + 1 + : this.start2 + 1 + "," + this.length2; + a = ["@@ -" + a + " +" + b + " @@\n"]; + var c; + for (b = 0; b < this.diffs.length; b++) { + switch (this.diffs[b][0]) { + case 1: + c = "+"; + break; + case -1: + c = "-"; + break; + case 0: + c = " "; + } + a[b + 1] = c + encodeURI(this.diffs[b][1]) + "\n"; + } + return a.join("").replace(/%20/g, " "); + }; + this.diff_match_patch = diff_match_patch; + this.DIFF_DELETE = -1; + this.DIFF_INSERT = 1; + this.DIFF_EQUAL = 0; +})(); diff --git a/docs/api/vendor/handlebars.min.js b/docs/api/vendor/handlebars.min.js index 4e2aa8fe..332ea46e 100644 --- a/docs/api/vendor/handlebars.min.js +++ b/docs/api/vendor/handlebars.min.js @@ -24,6 +24,5309 @@ THE SOFTWARE. @license */ -!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(21),i=e(h),j=c(22),k=c(27),l=c(28),m=e(l),n=c(25),o=e(n),p=c(20),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(18),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(19),p=e(o),q=c(20),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(7),j=c(15),k=c(17),l=e(k),m="4.0.5";b.VERSION=m;var n=7;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;bc;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return a||0===a?p(a)&&0===a.length?!0:!1:!0}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===n.call(a):!1};b.isArray=p},function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,f){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!f,k&&(j.contextPath=k+b)),i+=d(a[b],{data:j,blockParams:e.blockParams([a[b],b],[k+b,null])})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0,k=void 0;if(b.data&&b.ids&&(k=e.appendContextPath(b.data.contextPath,b.ids[0])+"."),e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var l=a.length;l>h;h++)h in a&&c(h,h,h===a.length-1);else{var m=void 0;for(var n in a)a.hasOwnProperty(n)&&(void 0!==m&&c(m,h-1),m=n,h++);void 0!==m&&c(m,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;c>f;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=r.COMPILER_REVISION;if(b!==c){if(c>b){var d=r.REVISION_CHANGES[c],e=r.REVISION_CHANGES[b];throw new q["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new q["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=o.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;i>h&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new q["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(e,b,e.helpers,e.partials,g,i,h)}var f=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=f.data;d._setup(f),!f.partial&&a.useData&&(g=j(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=f.depths?b!==f.depths[0]?[b].concat(f.depths):f.depths:[b]),(c=k(a.main,c,e,f.depths||[],g,i))(b,f)}if(!b)throw new q["default"]("No environment passed to template");if(!a||!a.main)throw new q["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e={strict:function(a,b){if(!(b in a))throw new q["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:o.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=o.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){c.partial?(e.helpers=c.helpers,e.partials=c.partials,e.decorators=c.decorators):(e.helpers=e.merge(c.helpers,b.helpers),a.usePartial&&(e.partials=e.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(e.decorators=e.merge(c.decorators,b.decorators)))},d._child=function(b,c,d,g){if(a.useBlockParams&&!d)throw new q["default"]("must pass block params");if(a.useDepths&&!g)throw new q["default"]("must pass parent depths");return f(e,b,a[b],c,0,d,g)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return g&&b!==g[0]&&(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var d=void 0;if(c.fn&&c.fn!==i&&(c.data=r.createFrame(c.data),d=c.data["partial-block"]=c.fn,d.partials&&(c.partials=o.extend({},c.partials,d.partials))),void 0===a&&d&&(a=d),void 0===a)throw new q["default"]("The partial "+c.name+" could not be found");return a instanceof Function?a(b,c):void 0}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?r.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),o.extend(b,g)}return b}var l=c(3)["default"],m=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var n=c(5),o=l(n),p=c(6),q=m(p),r=c(4)},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return a;h["default"].yy=n,n.locInfo=function(a){return new n.SourceLocation(b&&b.srcName,a)};var c=new j["default"](b);return c.accept(h["default"].parse(a))}var e=c(1)["default"],f=c(3)["default"];b.__esModule=!0,b.parse=d;var g=c(23),h=e(g),i=c(24),j=e(i),k=c(26),l=f(k),m=c(5);b.parser=h["default"];var n={};m.extend(n,l)},function(a,b){"use strict";var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[f[h]];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16], -48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;gb[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(b.yytext=b.yytext.substr(5,b.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b.__esModule=!0,b["default"]=c},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(25),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;j>i;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;c>b;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g="",h=0,i=b.length;i>h;h++){var j=b[h].part,k=b[h].original!==j;if(d+=(b[h].separator||"")+j,k||".."!==j&&"."!==j&&"this"!==j)e.push(j);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===j&&(f++,g+="../")}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new k["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(l.isArray(a)&&l.isArray(b)&&a.length===b.length){for(var c=0;cc;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)d in c&&(b.knownHelpers[d]=c[d]);return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new k["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;c>d;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new k["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new k["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,n["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=n["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");d>c;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:o.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=n["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&n["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||n["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;c>b;b++){var d=this.options.blockParams[b],e=d&&l.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;g>f;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("container.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}var g=c(1)["default"];b.__esModule=!0;var h=c(4),i=c(6),j=g(i),k=c(5),l=c(29),m=g(l);e.prototype={nameLookup:function(a,b){return e.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"[",JSON.stringify(b),"]"]},depthedLookup:function(a){return[this.aliasable("container.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=h.COMPILER_REVISION,b=h.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return k.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;i>h;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new j["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var k=this.createFunctionContext(d);if(this.isChild)return k;var l={compiler:this.compilerInfo(),main:k};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;i>h;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new m["default"](this.options.srcName),this.decorators=new m["default"](this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,a));for(var h=b.length;h>c;c++)this.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e), -d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"SubExpression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;g>f;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);null==h?(this.context.programs.push(""),h=this.context.programs.length,d.index=h,d.name="program"+h,this.context.programs[h]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[h]=e.decorators,this.context.environments[h]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams):(d.index=h,d.name="program"+h,this.useDepths=this.useDepths||d.useDepths,this.useBlockParams=this.useBlockParams||d.useBlockParams)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new j["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new j["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : {}");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;d>c;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(f.isArray(a)){for(var d=[],e=0,g=a.length;g>e;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}b.__esModule=!0;var f=c(5),g=void 0;try{}catch(h){}g||(g=function(a,b,c,d){this.src="",d&&this.add(d)},g.prototype={add:function(a){f.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){f.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;c>b;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new g(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof g?a:(a=d(a,this,b),new g(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e])}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;e>c;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])}); \ No newline at end of file +!(function(a, b) { + "object" == typeof exports && "object" == typeof module + ? (module.exports = b()) + : "function" == typeof define && define.amd + ? define([], b) + : "object" == typeof exports + ? (exports.Handlebars = b()) + : (a.Handlebars = b()); +})(this, function() { + return (function(a) { + function b(d) { + if (c[d]) return c[d].exports; + var e = (c[d] = { exports: {}, id: d, loaded: !1 }); + return ( + a[d].call(e.exports, e, e.exports, b), + (e.loaded = !0), + e.exports + ); + } + var c = {}; + return (b.m = a), (b.c = c), (b.p = ""), b(0); + })([ + function(a, b, c) { + "use strict"; + function d() { + var a = r(); + return ( + (a.compile = function(b, c) { + return k.compile(b, c, a); + }), + (a.precompile = function(b, c) { + return k.precompile(b, c, a); + }), + (a.AST = i["default"]), + (a.Compiler = k.Compiler), + (a.JavaScriptCompiler = m["default"]), + (a.Parser = j.parser), + (a.parse = j.parse), + a + ); + } + var e = c(1)["default"]; + b.__esModule = !0; + var f = c(2), + g = e(f), + h = c(21), + i = e(h), + j = c(22), + k = c(27), + l = c(28), + m = e(l), + n = c(25), + o = e(n), + p = c(20), + q = e(p), + r = g["default"].create, + s = d(); + (s.create = d), + q["default"](s), + (s.Visitor = o["default"]), + (s["default"] = s), + (b["default"] = s), + (a.exports = b["default"]); + }, + function(a, b) { + "use strict"; + (b["default"] = function(a) { + return a && a.__esModule ? a : { default: a }; + }), + (b.__esModule = !0); + }, + function(a, b, c) { + "use strict"; + function d() { + var a = new h.HandlebarsEnvironment(); + return ( + n.extend(a, h), + (a.SafeString = j["default"]), + (a.Exception = l["default"]), + (a.Utils = n), + (a.escapeExpression = n.escapeExpression), + (a.VM = p), + (a.template = function(b) { + return p.template(b, a); + }), + a + ); + } + var e = c(3)["default"], + f = c(1)["default"]; + b.__esModule = !0; + var g = c(4), + h = e(g), + i = c(18), + j = f(i), + k = c(6), + l = f(k), + m = c(5), + n = e(m), + o = c(19), + p = e(o), + q = c(20), + r = f(q), + s = d(); + (s.create = d), + r["default"](s), + (s["default"] = s), + (b["default"] = s), + (a.exports = b["default"]); + }, + function(a, b) { + "use strict"; + (b["default"] = function(a) { + if (a && a.__esModule) return a; + var b = {}; + if (null != a) + for (var c in a) + Object.prototype.hasOwnProperty.call(a, c) && + (b[c] = a[c]); + return (b["default"] = a), b; + }), + (b.__esModule = !0); + }, + function(a, b, c) { + "use strict"; + function d(a, b, c) { + (this.helpers = a || {}), + (this.partials = b || {}), + (this.decorators = c || {}), + i.registerDefaultHelpers(this), + j.registerDefaultDecorators(this); + } + var e = c(1)["default"]; + (b.__esModule = !0), (b.HandlebarsEnvironment = d); + var f = c(5), + g = c(6), + h = e(g), + i = c(7), + j = c(15), + k = c(17), + l = e(k), + m = "4.0.5"; + b.VERSION = m; + var n = 7; + b.COMPILER_REVISION = n; + var o = { + 1: "<= 1.0.rc.2", + 2: "== 1.0.0-rc.3", + 3: "== 1.0.0-rc.4", + 4: "== 1.x.x", + 5: "== 2.0.0-alpha.x", + 6: ">= 2.0.0-beta.1", + 7: ">= 4.0.0" + }; + b.REVISION_CHANGES = o; + var p = "[object Object]"; + d.prototype = { + constructor: d, + logger: l["default"], + log: l["default"].log, + registerHelper: function(a, b) { + if (f.toString.call(a) === p) { + if (b) + throw new h["default"]( + "Arg not supported with multiple helpers" + ); + f.extend(this.helpers, a); + } else this.helpers[a] = b; + }, + unregisterHelper: function(a) { + delete this.helpers[a]; + }, + registerPartial: function(a, b) { + if (f.toString.call(a) === p) f.extend(this.partials, a); + else { + if ("undefined" == typeof b) + throw new h["default"]( + 'Attempting to register a partial called "' + + a + + '" as undefined' + ); + this.partials[a] = b; + } + }, + unregisterPartial: function(a) { + delete this.partials[a]; + }, + registerDecorator: function(a, b) { + if (f.toString.call(a) === p) { + if (b) + throw new h["default"]( + "Arg not supported with multiple decorators" + ); + f.extend(this.decorators, a); + } else this.decorators[a] = b; + }, + unregisterDecorator: function(a) { + delete this.decorators[a]; + } + }; + var q = l["default"].log; + (b.log = q), + (b.createFrame = f.createFrame), + (b.logger = l["default"]); + }, + function(a, b) { + "use strict"; + function c(a) { + return k[a]; + } + function d(a) { + for (var b = 1; b < arguments.length; b++) + for (var c in arguments[b]) + Object.prototype.hasOwnProperty.call(arguments[b], c) && + (a[c] = arguments[b][c]); + return a; + } + function e(a, b) { + for (var c = 0, d = a.length; d > c; c++) + if (a[c] === b) return c; + return -1; + } + function f(a) { + if ("string" != typeof a) { + if (a && a.toHTML) return a.toHTML(); + if (null == a) return ""; + if (!a) return a + ""; + a = "" + a; + } + return m.test(a) ? a.replace(l, c) : a; + } + function g(a) { + return a || 0 === a ? (p(a) && 0 === a.length ? !0 : !1) : !0; + } + function h(a) { + var b = d({}, a); + return (b._parent = a), b; + } + function i(a, b) { + return (a.path = b), a; + } + function j(a, b) { + return (a ? a + "." : "") + b; + } + (b.__esModule = !0), + (b.extend = d), + (b.indexOf = e), + (b.escapeExpression = f), + (b.isEmpty = g), + (b.createFrame = h), + (b.blockParams = i), + (b.appendContextPath = j); + var k = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`", + "=": "=" + }, + l = /[&<>"'`=]/g, + m = /[&<>"'`=]/, + n = Object.prototype.toString; + b.toString = n; + var o = function(a) { + return "function" == typeof a; + }; + o(/x/) && + (b.isFunction = o = function(a) { + return ( + "function" == typeof a && + "[object Function]" === n.call(a) + ); + }), + (b.isFunction = o); + var p = + Array.isArray || + function(a) { + return a && "object" == typeof a + ? "[object Array]" === n.call(a) + : !1; + }; + b.isArray = p; + }, + function(a, b) { + "use strict"; + function c(a, b) { + var e = b && b.loc, + f = void 0, + g = void 0; + e && + ((f = e.start.line), + (g = e.start.column), + (a += " - " + f + ":" + g)); + for ( + var h = Error.prototype.constructor.call(this, a), i = 0; + i < d.length; + i++ + ) + this[d[i]] = h[d[i]]; + Error.captureStackTrace && Error.captureStackTrace(this, c), + e && ((this.lineNumber = f), (this.column = g)); + } + b.__esModule = !0; + var d = [ + "description", + "fileName", + "lineNumber", + "message", + "name", + "number", + "stack" + ]; + (c.prototype = new Error()), + (b["default"] = c), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d(a) { + g["default"](a), + i["default"](a), + k["default"](a), + m["default"](a), + o["default"](a), + q["default"](a), + s["default"](a); + } + var e = c(1)["default"]; + (b.__esModule = !0), (b.registerDefaultHelpers = d); + var f = c(8), + g = e(f), + h = c(9), + i = e(h), + j = c(10), + k = e(j), + l = c(11), + m = e(l), + n = c(12), + o = e(n), + p = c(13), + q = e(p), + r = c(14), + s = e(r); + }, + function(a, b, c) { + "use strict"; + b.__esModule = !0; + var d = c(5); + (b["default"] = function(a) { + a.registerHelper("blockHelperMissing", function(b, c) { + var e = c.inverse, + f = c.fn; + if (b === !0) return f(this); + if (b === !1 || null == b) return e(this); + if (d.isArray(b)) + return b.length > 0 + ? (c.ids && (c.ids = [c.name]), + a.helpers.each(b, c)) + : e(this); + if (c.data && c.ids) { + var g = d.createFrame(c.data); + (g.contextPath = d.appendContextPath( + c.data.contextPath, + c.name + )), + (c = { data: g }); + } + return f(b, c); + }); + }), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + var d = c(1)["default"]; + b.__esModule = !0; + var e = c(5), + f = c(6), + g = d(f); + (b["default"] = function(a) { + a.registerHelper("each", function(a, b) { + function c(b, c, f) { + j && + ((j.key = b), + (j.index = c), + (j.first = 0 === c), + (j.last = !!f), + k && (j.contextPath = k + b)), + (i += d(a[b], { + data: j, + blockParams: e.blockParams( + [a[b], b], + [k + b, null] + ) + })); + } + if (!b) + throw new g["default"]("Must pass iterator to #each"); + var d = b.fn, + f = b.inverse, + h = 0, + i = "", + j = void 0, + k = void 0; + if ( + (b.data && + b.ids && + (k = + e.appendContextPath( + b.data.contextPath, + b.ids[0] + ) + "."), + e.isFunction(a) && (a = a.call(this)), + b.data && (j = e.createFrame(b.data)), + a && "object" == typeof a) + ) + if (e.isArray(a)) + for (var l = a.length; l > h; h++) + h in a && c(h, h, h === a.length - 1); + else { + var m = void 0; + for (var n in a) + a.hasOwnProperty(n) && + (void 0 !== m && c(m, h - 1), (m = n), h++); + void 0 !== m && c(m, h - 1, !0); + } + return 0 === h && (i = f(this)), i; + }); + }), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + var d = c(1)["default"]; + b.__esModule = !0; + var e = c(6), + f = d(e); + (b["default"] = function(a) { + a.registerHelper("helperMissing", function() { + if (1 !== arguments.length) + throw new f["default"]( + 'Missing helper: "' + + arguments[arguments.length - 1].name + + '"' + ); + }); + }), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + b.__esModule = !0; + var d = c(5); + (b["default"] = function(a) { + a.registerHelper("if", function(a, b) { + return ( + d.isFunction(a) && (a = a.call(this)), + (!b.hash.includeZero && !a) || d.isEmpty(a) + ? b.inverse(this) + : b.fn(this) + ); + }), + a.registerHelper("unless", function(b, c) { + return a.helpers["if"].call(this, b, { + fn: c.inverse, + inverse: c.fn, + hash: c.hash + }); + }); + }), + (a.exports = b["default"]); + }, + function(a, b) { + "use strict"; + (b.__esModule = !0), + (b["default"] = function(a) { + a.registerHelper("log", function() { + for ( + var b = [void 0], + c = arguments[arguments.length - 1], + d = 0; + d < arguments.length - 1; + d++ + ) + b.push(arguments[d]); + var e = 1; + null != c.hash.level + ? (e = c.hash.level) + : c.data && + null != c.data.level && + (e = c.data.level), + (b[0] = e), + a.log.apply(a, b); + }); + }), + (a.exports = b["default"]); + }, + function(a, b) { + "use strict"; + (b.__esModule = !0), + (b["default"] = function(a) { + a.registerHelper("lookup", function(a, b) { + return a && a[b]; + }); + }), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + b.__esModule = !0; + var d = c(5); + (b["default"] = function(a) { + a.registerHelper("with", function(a, b) { + d.isFunction(a) && (a = a.call(this)); + var c = b.fn; + if (d.isEmpty(a)) return b.inverse(this); + var e = b.data; + return ( + b.data && + b.ids && + ((e = d.createFrame(b.data)), + (e.contextPath = d.appendContextPath( + b.data.contextPath, + b.ids[0] + ))), + c(a, { + data: e, + blockParams: d.blockParams( + [a], + [e && e.contextPath] + ) + }) + ); + }); + }), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d(a) { + g["default"](a); + } + var e = c(1)["default"]; + (b.__esModule = !0), (b.registerDefaultDecorators = d); + var f = c(16), + g = e(f); + }, + function(a, b, c) { + "use strict"; + b.__esModule = !0; + var d = c(5); + (b["default"] = function(a) { + a.registerDecorator("inline", function(a, b, c, e) { + var f = a; + return ( + b.partials || + ((b.partials = {}), + (f = function(e, f) { + var g = c.partials; + c.partials = d.extend({}, g, b.partials); + var h = a(e, f); + return (c.partials = g), h; + })), + (b.partials[e.args[0]] = e.fn), + f + ); + }); + }), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + b.__esModule = !0; + var d = c(5), + e = { + methodMap: ["debug", "info", "warn", "error"], + level: "info", + lookupLevel: function(a) { + if ("string" == typeof a) { + var b = d.indexOf(e.methodMap, a.toLowerCase()); + a = b >= 0 ? b : parseInt(a, 10); + } + return a; + }, + log: function(a) { + if ( + ((a = e.lookupLevel(a)), + "undefined" != typeof console && + e.lookupLevel(e.level) <= a) + ) { + var b = e.methodMap[a]; + console[b] || (b = "log"); + for ( + var c = arguments.length, + d = Array(c > 1 ? c - 1 : 0), + f = 1; + c > f; + f++ + ) + d[f - 1] = arguments[f]; + console[b].apply(console, d); + } + } + }; + (b["default"] = e), (a.exports = b["default"]); + }, + function(a, b) { + "use strict"; + function c(a) { + this.string = a; + } + (b.__esModule = !0), + (c.prototype.toString = c.prototype.toHTML = function() { + return "" + this.string; + }), + (b["default"] = c), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d(a) { + var b = (a && a[0]) || 1, + c = r.COMPILER_REVISION; + if (b !== c) { + if (c > b) { + var d = r.REVISION_CHANGES[c], + e = r.REVISION_CHANGES[b]; + throw new q["default"]( + "Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + + d + + ") or downgrade your runtime to an older version (" + + e + + ")." + ); + } + throw new q["default"]( + "Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + + a[1] + + ")." + ); + } + } + function e(a, b) { + function c(c, d, e) { + e.hash && + ((d = o.extend({}, d, e.hash)), + e.ids && (e.ids[0] = !0)), + (c = b.VM.resolvePartial.call(this, c, d, e)); + var f = b.VM.invokePartial.call(this, c, d, e); + if ( + (null == f && + b.compile && + ((e.partials[e.name] = b.compile( + c, + a.compilerOptions, + b + )), + (f = e.partials[e.name](d, e))), + null != f) + ) { + if (e.indent) { + for ( + var g = f.split("\n"), h = 0, i = g.length; + i > h && (g[h] || h + 1 !== i); + h++ + ) + g[h] = e.indent + g[h]; + f = g.join("\n"); + } + return f; + } + throw new q["default"]( + "The partial " + + e.name + + " could not be compiled when running in runtime-only mode" + ); + } + function d(b) { + function c(b) { + return ( + "" + a.main(e, b, e.helpers, e.partials, g, i, h) + ); + } + var f = + arguments.length <= 1 || void 0 === arguments[1] + ? {} + : arguments[1], + g = f.data; + d._setup(f), !f.partial && a.useData && (g = j(b, g)); + var h = void 0, + i = a.useBlockParams ? [] : void 0; + return ( + a.useDepths && + (h = f.depths + ? b !== f.depths[0] + ? [b].concat(f.depths) + : f.depths + : [b]), + (c = k(a.main, c, e, f.depths || [], g, i))(b, f) + ); + } + if (!b) + throw new q["default"]("No environment passed to template"); + if (!a || !a.main) + throw new q["default"]( + "Unknown template object: " + typeof a + ); + (a.main.decorator = a.main_d), b.VM.checkRevision(a.compiler); + var e = { + strict: function(a, b) { + if (!(b in a)) + throw new q["default"]( + '"' + b + '" not defined in ' + a + ); + return a[b]; + }, + lookup: function(a, b) { + for (var c = a.length, d = 0; c > d; d++) + if (a[d] && null != a[d][b]) return a[d][b]; + }, + lambda: function(a, b) { + return "function" == typeof a ? a.call(b) : a; + }, + escapeExpression: o.escapeExpression, + invokePartial: c, + fn: function(b) { + var c = a[b]; + return (c.decorator = a[b + "_d"]), c; + }, + programs: [], + program: function(a, b, c, d, e) { + var g = this.programs[a], + h = this.fn(a); + return ( + b || e || d || c + ? (g = f(this, a, h, b, c, d, e)) + : g || (g = this.programs[a] = f(this, a, h)), + g + ); + }, + data: function(a, b) { + for (; a && b--; ) a = a._parent; + return a; + }, + merge: function(a, b) { + var c = a || b; + return a && b && a !== b && (c = o.extend({}, b, a)), c; + }, + noop: b.VM.noop, + compilerInfo: a.compiler + }; + return ( + (d.isTop = !0), + (d._setup = function(c) { + c.partial + ? ((e.helpers = c.helpers), + (e.partials = c.partials), + (e.decorators = c.decorators)) + : ((e.helpers = e.merge(c.helpers, b.helpers)), + a.usePartial && + (e.partials = e.merge( + c.partials, + b.partials + )), + (a.usePartial || a.useDecorators) && + (e.decorators = e.merge( + c.decorators, + b.decorators + ))); + }), + (d._child = function(b, c, d, g) { + if (a.useBlockParams && !d) + throw new q["default"]("must pass block params"); + if (a.useDepths && !g) + throw new q["default"]("must pass parent depths"); + return f(e, b, a[b], c, 0, d, g); + }), + d + ); + } + function f(a, b, c, d, e, f, g) { + function h(b) { + var e = + arguments.length <= 1 || void 0 === arguments[1] + ? {} + : arguments[1], + h = g; + return ( + g && b !== g[0] && (h = [b].concat(g)), + c( + a, + b, + a.helpers, + a.partials, + e.data || d, + f && [e.blockParams].concat(f), + h + ) + ); + } + return ( + (h = k(c, h, a, g, d, f)), + (h.program = b), + (h.depth = g ? g.length : 0), + (h.blockParams = e || 0), + h + ); + } + function g(a, b, c) { + return ( + a + ? a.call || + c.name || + ((c.name = a), (a = c.partials[a])) + : (a = + "@partial-block" === c.name + ? c.data["partial-block"] + : c.partials[c.name]), + a + ); + } + function h(a, b, c) { + (c.partial = !0), + c.ids && + (c.data.contextPath = c.ids[0] || c.data.contextPath); + var d = void 0; + if ( + (c.fn && + c.fn !== i && + ((c.data = r.createFrame(c.data)), + (d = c.data["partial-block"] = c.fn), + d.partials && + (c.partials = o.extend( + {}, + c.partials, + d.partials + ))), + void 0 === a && d && (a = d), + void 0 === a) + ) + throw new q["default"]( + "The partial " + c.name + " could not be found" + ); + return a instanceof Function ? a(b, c) : void 0; + } + function i() { + return ""; + } + function j(a, b) { + return ( + (b && "root" in b) || + ((b = b ? r.createFrame(b) : {}), (b.root = a)), + b + ); + } + function k(a, b, c, d, e, f) { + if (a.decorator) { + var g = {}; + (b = a.decorator(b, g, c, d && d[0], e, f, d)), + o.extend(b, g); + } + return b; + } + var l = c(3)["default"], + m = c(1)["default"]; + (b.__esModule = !0), + (b.checkRevision = d), + (b.template = e), + (b.wrapProgram = f), + (b.resolvePartial = g), + (b.invokePartial = h), + (b.noop = i); + var n = c(5), + o = l(n), + p = c(6), + q = m(p), + r = c(4); + }, + function(a, b) { + (function(c) { + "use strict"; + (b.__esModule = !0), + (b["default"] = function(a) { + var b = "undefined" != typeof c ? c : window, + d = b.Handlebars; + a.noConflict = function() { + return b.Handlebars === a && (b.Handlebars = d), a; + }; + }), + (a.exports = b["default"]); + }.call( + b, + (function() { + return this; + })() + )); + }, + function(a, b) { + "use strict"; + b.__esModule = !0; + var c = { + helpers: { + helperExpression: function(a) { + return ( + "SubExpression" === a.type || + (("MustacheStatement" === a.type || + "BlockStatement" === a.type) && + !!((a.params && a.params.length) || a.hash)) + ); + }, + scopedId: function(a) { + return /^\.|this\b/.test(a.original); + }, + simpleId: function(a) { + return ( + 1 === a.parts.length && + !c.helpers.scopedId(a) && + !a.depth + ); + } + } + }; + (b["default"] = c), (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d(a, b) { + if ("Program" === a.type) return a; + (h["default"].yy = n), + (n.locInfo = function(a) { + return new n.SourceLocation(b && b.srcName, a); + }); + var c = new j["default"](b); + return c.accept(h["default"].parse(a)); + } + var e = c(1)["default"], + f = c(3)["default"]; + (b.__esModule = !0), (b.parse = d); + var g = c(23), + h = e(g), + i = c(24), + j = e(i), + k = c(26), + l = f(k), + m = c(5); + b.parser = h["default"]; + var n = {}; + m.extend(n, l); + }, + function(a, b) { + "use strict"; + var c = (function() { + function a() { + this.yy = {}; + } + var b = { + trace: function() {}, + yy: {}, + symbols_: { + error: 2, + root: 3, + program: 4, + EOF: 5, + program_repetition0: 6, + statement: 7, + mustache: 8, + block: 9, + rawBlock: 10, + partial: 11, + partialBlock: 12, + content: 13, + COMMENT: 14, + CONTENT: 15, + openRawBlock: 16, + rawBlock_repetition_plus0: 17, + END_RAW_BLOCK: 18, + OPEN_RAW_BLOCK: 19, + helperName: 20, + openRawBlock_repetition0: 21, + openRawBlock_option0: 22, + CLOSE_RAW_BLOCK: 23, + openBlock: 24, + block_option0: 25, + closeBlock: 26, + openInverse: 27, + block_option1: 28, + OPEN_BLOCK: 29, + openBlock_repetition0: 30, + openBlock_option0: 31, + openBlock_option1: 32, + CLOSE: 33, + OPEN_INVERSE: 34, + openInverse_repetition0: 35, + openInverse_option0: 36, + openInverse_option1: 37, + openInverseChain: 38, + OPEN_INVERSE_CHAIN: 39, + openInverseChain_repetition0: 40, + openInverseChain_option0: 41, + openInverseChain_option1: 42, + inverseAndProgram: 43, + INVERSE: 44, + inverseChain: 45, + inverseChain_option0: 46, + OPEN_ENDBLOCK: 47, + OPEN: 48, + mustache_repetition0: 49, + mustache_option0: 50, + OPEN_UNESCAPED: 51, + mustache_repetition1: 52, + mustache_option1: 53, + CLOSE_UNESCAPED: 54, + OPEN_PARTIAL: 55, + partialName: 56, + partial_repetition0: 57, + partial_option0: 58, + openPartialBlock: 59, + OPEN_PARTIAL_BLOCK: 60, + openPartialBlock_repetition0: 61, + openPartialBlock_option0: 62, + param: 63, + sexpr: 64, + OPEN_SEXPR: 65, + sexpr_repetition0: 66, + sexpr_option0: 67, + CLOSE_SEXPR: 68, + hash: 69, + hash_repetition_plus0: 70, + hashSegment: 71, + ID: 72, + EQUALS: 73, + blockParams: 74, + OPEN_BLOCK_PARAMS: 75, + blockParams_repetition_plus0: 76, + CLOSE_BLOCK_PARAMS: 77, + path: 78, + dataName: 79, + STRING: 80, + NUMBER: 81, + BOOLEAN: 82, + UNDEFINED: 83, + NULL: 84, + DATA: 85, + pathSegments: 86, + SEP: 87, + $accept: 0, + $end: 1 + }, + terminals_: { + 2: "error", + 5: "EOF", + 14: "COMMENT", + 15: "CONTENT", + 18: "END_RAW_BLOCK", + 19: "OPEN_RAW_BLOCK", + 23: "CLOSE_RAW_BLOCK", + 29: "OPEN_BLOCK", + 33: "CLOSE", + 34: "OPEN_INVERSE", + 39: "OPEN_INVERSE_CHAIN", + 44: "INVERSE", + 47: "OPEN_ENDBLOCK", + 48: "OPEN", + 51: "OPEN_UNESCAPED", + 54: "CLOSE_UNESCAPED", + 55: "OPEN_PARTIAL", + 60: "OPEN_PARTIAL_BLOCK", + 65: "OPEN_SEXPR", + 68: "CLOSE_SEXPR", + 72: "ID", + 73: "EQUALS", + 75: "OPEN_BLOCK_PARAMS", + 77: "CLOSE_BLOCK_PARAMS", + 80: "STRING", + 81: "NUMBER", + 82: "BOOLEAN", + 83: "UNDEFINED", + 84: "NULL", + 85: "DATA", + 87: "SEP" + }, + productions_: [ + 0, + [3, 2], + [4, 1], + [7, 1], + [7, 1], + [7, 1], + [7, 1], + [7, 1], + [7, 1], + [7, 1], + [13, 1], + [10, 3], + [16, 5], + [9, 4], + [9, 4], + [24, 6], + [27, 6], + [38, 6], + [43, 2], + [45, 3], + [45, 1], + [26, 3], + [8, 5], + [8, 5], + [11, 5], + [12, 3], + [59, 5], + [63, 1], + [63, 1], + [64, 5], + [69, 1], + [71, 3], + [74, 3], + [20, 1], + [20, 1], + [20, 1], + [20, 1], + [20, 1], + [20, 1], + [20, 1], + [56, 1], + [56, 1], + [79, 2], + [78, 1], + [86, 3], + [86, 1], + [6, 0], + [6, 2], + [17, 1], + [17, 2], + [21, 0], + [21, 2], + [22, 0], + [22, 1], + [25, 0], + [25, 1], + [28, 0], + [28, 1], + [30, 0], + [30, 2], + [31, 0], + [31, 1], + [32, 0], + [32, 1], + [35, 0], + [35, 2], + [36, 0], + [36, 1], + [37, 0], + [37, 1], + [40, 0], + [40, 2], + [41, 0], + [41, 1], + [42, 0], + [42, 1], + [46, 0], + [46, 1], + [49, 0], + [49, 2], + [50, 0], + [50, 1], + [52, 0], + [52, 2], + [53, 0], + [53, 1], + [57, 0], + [57, 2], + [58, 0], + [58, 1], + [61, 0], + [61, 2], + [62, 0], + [62, 1], + [66, 0], + [66, 2], + [67, 0], + [67, 1], + [70, 1], + [70, 2], + [76, 1], + [76, 2] + ], + performAction: function(a, b, c, d, e, f, g) { + var h = f.length - 1; + switch (e) { + case 1: + return f[h - 1]; + case 2: + this.$ = d.prepareProgram(f[h]); + break; + case 3: + this.$ = f[h]; + break; + case 4: + this.$ = f[h]; + break; + case 5: + this.$ = f[h]; + break; + case 6: + this.$ = f[h]; + break; + case 7: + this.$ = f[h]; + break; + case 8: + this.$ = f[h]; + break; + case 9: + this.$ = { + type: "CommentStatement", + value: d.stripComment(f[h]), + strip: d.stripFlags(f[h], f[h]), + loc: d.locInfo(this._$) + }; + break; + case 10: + this.$ = { + type: "ContentStatement", + original: f[h], + value: f[h], + loc: d.locInfo(this._$) + }; + break; + case 11: + this.$ = d.prepareRawBlock( + f[h - 2], + f[h - 1], + f[h], + this._$ + ); + break; + case 12: + this.$ = { + path: f[h - 3], + params: f[h - 2], + hash: f[h - 1] + }; + break; + case 13: + this.$ = d.prepareBlock( + f[h - 3], + f[h - 2], + f[h - 1], + f[h], + !1, + this._$ + ); + break; + case 14: + this.$ = d.prepareBlock( + f[h - 3], + f[h - 2], + f[h - 1], + f[h], + !0, + this._$ + ); + break; + case 15: + this.$ = { + open: f[h - 5], + path: f[h - 4], + params: f[h - 3], + hash: f[h - 2], + blockParams: f[h - 1], + strip: d.stripFlags(f[h - 5], f[h]) + }; + break; + case 16: + this.$ = { + path: f[h - 4], + params: f[h - 3], + hash: f[h - 2], + blockParams: f[h - 1], + strip: d.stripFlags(f[h - 5], f[h]) + }; + break; + case 17: + this.$ = { + path: f[h - 4], + params: f[h - 3], + hash: f[h - 2], + blockParams: f[h - 1], + strip: d.stripFlags(f[h - 5], f[h]) + }; + break; + case 18: + this.$ = { + strip: d.stripFlags(f[h - 1], f[h - 1]), + program: f[h] + }; + break; + case 19: + var i = d.prepareBlock( + f[h - 2], + f[h - 1], + f[h], + f[h], + !1, + this._$ + ), + j = d.prepareProgram([i], f[h - 1].loc); + (j.chained = !0), + (this.$ = { + strip: f[h - 2].strip, + program: j, + chain: !0 + }); + break; + case 20: + this.$ = f[h]; + break; + case 21: + this.$ = { + path: f[h - 1], + strip: d.stripFlags(f[h - 2], f[h]) + }; + break; + case 22: + this.$ = d.prepareMustache( + f[h - 3], + f[h - 2], + f[h - 1], + f[h - 4], + d.stripFlags(f[h - 4], f[h]), + this._$ + ); + break; + case 23: + this.$ = d.prepareMustache( + f[h - 3], + f[h - 2], + f[h - 1], + f[h - 4], + d.stripFlags(f[h - 4], f[h]), + this._$ + ); + break; + case 24: + this.$ = { + type: "PartialStatement", + name: f[h - 3], + params: f[h - 2], + hash: f[h - 1], + indent: "", + strip: d.stripFlags(f[h - 4], f[h]), + loc: d.locInfo(this._$) + }; + break; + case 25: + this.$ = d.preparePartialBlock( + f[h - 2], + f[h - 1], + f[h], + this._$ + ); + break; + case 26: + this.$ = { + path: f[h - 3], + params: f[h - 2], + hash: f[h - 1], + strip: d.stripFlags(f[h - 4], f[h]) + }; + break; + case 27: + this.$ = f[h]; + break; + case 28: + this.$ = f[h]; + break; + case 29: + this.$ = { + type: "SubExpression", + path: f[h - 3], + params: f[h - 2], + hash: f[h - 1], + loc: d.locInfo(this._$) + }; + break; + case 30: + this.$ = { + type: "Hash", + pairs: f[h], + loc: d.locInfo(this._$) + }; + break; + case 31: + this.$ = { + type: "HashPair", + key: d.id(f[h - 2]), + value: f[h], + loc: d.locInfo(this._$) + }; + break; + case 32: + this.$ = d.id(f[h - 1]); + break; + case 33: + this.$ = f[h]; + break; + case 34: + this.$ = f[h]; + break; + case 35: + this.$ = { + type: "StringLiteral", + value: f[h], + original: f[h], + loc: d.locInfo(this._$) + }; + break; + case 36: + this.$ = { + type: "NumberLiteral", + value: Number(f[h]), + original: Number(f[h]), + loc: d.locInfo(this._$) + }; + break; + case 37: + this.$ = { + type: "BooleanLiteral", + value: "true" === f[h], + original: "true" === f[h], + loc: d.locInfo(this._$) + }; + break; + case 38: + this.$ = { + type: "UndefinedLiteral", + original: void 0, + value: void 0, + loc: d.locInfo(this._$) + }; + break; + case 39: + this.$ = { + type: "NullLiteral", + original: null, + value: null, + loc: d.locInfo(this._$) + }; + break; + case 40: + this.$ = f[h]; + break; + case 41: + this.$ = f[h]; + break; + case 42: + this.$ = d.preparePath(!0, f[h], this._$); + break; + case 43: + this.$ = d.preparePath(!1, f[h], this._$); + break; + case 44: + f[h - 2].push({ + part: d.id(f[h]), + original: f[h], + separator: f[h - 1] + }), + (this.$ = f[h - 2]); + break; + case 45: + this.$ = [ + { part: d.id(f[h]), original: f[h] } + ]; + break; + case 46: + this.$ = []; + break; + case 47: + f[h - 1].push(f[h]); + break; + case 48: + this.$ = [f[h]]; + break; + case 49: + f[h - 1].push(f[h]); + break; + case 50: + this.$ = []; + break; + case 51: + f[h - 1].push(f[h]); + break; + case 58: + this.$ = []; + break; + case 59: + f[h - 1].push(f[h]); + break; + case 64: + this.$ = []; + break; + case 65: + f[h - 1].push(f[h]); + break; + case 70: + this.$ = []; + break; + case 71: + f[h - 1].push(f[h]); + break; + case 78: + this.$ = []; + break; + case 79: + f[h - 1].push(f[h]); + break; + case 82: + this.$ = []; + break; + case 83: + f[h - 1].push(f[h]); + break; + case 86: + this.$ = []; + break; + case 87: + f[h - 1].push(f[h]); + break; + case 90: + this.$ = []; + break; + case 91: + f[h - 1].push(f[h]); + break; + case 94: + this.$ = []; + break; + case 95: + f[h - 1].push(f[h]); + break; + case 98: + this.$ = [f[h]]; + break; + case 99: + f[h - 1].push(f[h]); + break; + case 100: + this.$ = [f[h]]; + break; + case 101: + f[h - 1].push(f[h]); + } + }, + table: [ + { + 3: 1, + 4: 2, + 5: [2, 46], + 6: 3, + 14: [2, 46], + 15: [2, 46], + 19: [2, 46], + 29: [2, 46], + 34: [2, 46], + 48: [2, 46], + 51: [2, 46], + 55: [2, 46], + 60: [2, 46] + }, + { 1: [3] }, + { 5: [1, 4] }, + { + 5: [2, 2], + 7: 5, + 8: 6, + 9: 7, + 10: 8, + 11: 9, + 12: 10, + 13: 11, + 14: [1, 12], + 15: [1, 20], + 16: 17, + 19: [1, 23], + 24: 15, + 27: 16, + 29: [1, 21], + 34: [1, 22], + 39: [2, 2], + 44: [2, 2], + 47: [2, 2], + 48: [1, 13], + 51: [1, 14], + 55: [1, 18], + 59: 19, + 60: [1, 24] + }, + { 1: [2, 1] }, + { + 5: [2, 47], + 14: [2, 47], + 15: [2, 47], + 19: [2, 47], + 29: [2, 47], + 34: [2, 47], + 39: [2, 47], + 44: [2, 47], + 47: [2, 47], + 48: [2, 47], + 51: [2, 47], + 55: [2, 47], + 60: [2, 47] + }, + { + 5: [2, 3], + 14: [2, 3], + 15: [2, 3], + 19: [2, 3], + 29: [2, 3], + 34: [2, 3], + 39: [2, 3], + 44: [2, 3], + 47: [2, 3], + 48: [2, 3], + 51: [2, 3], + 55: [2, 3], + 60: [2, 3] + }, + { + 5: [2, 4], + 14: [2, 4], + 15: [2, 4], + 19: [2, 4], + 29: [2, 4], + 34: [2, 4], + 39: [2, 4], + 44: [2, 4], + 47: [2, 4], + 48: [2, 4], + 51: [2, 4], + 55: [2, 4], + 60: [2, 4] + }, + { + 5: [2, 5], + 14: [2, 5], + 15: [2, 5], + 19: [2, 5], + 29: [2, 5], + 34: [2, 5], + 39: [2, 5], + 44: [2, 5], + 47: [2, 5], + 48: [2, 5], + 51: [2, 5], + 55: [2, 5], + 60: [2, 5] + }, + { + 5: [2, 6], + 14: [2, 6], + 15: [2, 6], + 19: [2, 6], + 29: [2, 6], + 34: [2, 6], + 39: [2, 6], + 44: [2, 6], + 47: [2, 6], + 48: [2, 6], + 51: [2, 6], + 55: [2, 6], + 60: [2, 6] + }, + { + 5: [2, 7], + 14: [2, 7], + 15: [2, 7], + 19: [2, 7], + 29: [2, 7], + 34: [2, 7], + 39: [2, 7], + 44: [2, 7], + 47: [2, 7], + 48: [2, 7], + 51: [2, 7], + 55: [2, 7], + 60: [2, 7] + }, + { + 5: [2, 8], + 14: [2, 8], + 15: [2, 8], + 19: [2, 8], + 29: [2, 8], + 34: [2, 8], + 39: [2, 8], + 44: [2, 8], + 47: [2, 8], + 48: [2, 8], + 51: [2, 8], + 55: [2, 8], + 60: [2, 8] + }, + { + 5: [2, 9], + 14: [2, 9], + 15: [2, 9], + 19: [2, 9], + 29: [2, 9], + 34: [2, 9], + 39: [2, 9], + 44: [2, 9], + 47: [2, 9], + 48: [2, 9], + 51: [2, 9], + 55: [2, 9], + 60: [2, 9] + }, + { + 20: 25, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 36, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 4: 37, + 6: 3, + 14: [2, 46], + 15: [2, 46], + 19: [2, 46], + 29: [2, 46], + 34: [2, 46], + 39: [2, 46], + 44: [2, 46], + 47: [2, 46], + 48: [2, 46], + 51: [2, 46], + 55: [2, 46], + 60: [2, 46] + }, + { + 4: 38, + 6: 3, + 14: [2, 46], + 15: [2, 46], + 19: [2, 46], + 29: [2, 46], + 34: [2, 46], + 44: [2, 46], + 47: [2, 46], + 48: [2, 46], + 51: [2, 46], + 55: [2, 46], + 60: [2, 46] + }, + { 13: 40, 15: [1, 20], 17: 39 }, + { + 20: 42, + 56: 41, + 64: 43, + 65: [1, 44], + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 4: 45, + 6: 3, + 14: [2, 46], + 15: [2, 46], + 19: [2, 46], + 29: [2, 46], + 34: [2, 46], + 47: [2, 46], + 48: [2, 46], + 51: [2, 46], + 55: [2, 46], + 60: [2, 46] + }, + { + 5: [2, 10], + 14: [2, 10], + 15: [2, 10], + 18: [2, 10], + 19: [2, 10], + 29: [2, 10], + 34: [2, 10], + 39: [2, 10], + 44: [2, 10], + 47: [2, 10], + 48: [2, 10], + 51: [2, 10], + 55: [2, 10], + 60: [2, 10] + }, + { + 20: 46, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 47, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 48, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 42, + 56: 49, + 64: 43, + 65: [1, 44], + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 33: [2, 78], + 49: 50, + 65: [2, 78], + 72: [2, 78], + 80: [2, 78], + 81: [2, 78], + 82: [2, 78], + 83: [2, 78], + 84: [2, 78], + 85: [2, 78] + }, + { + 23: [2, 33], + 33: [2, 33], + 54: [2, 33], + 65: [2, 33], + 68: [2, 33], + 72: [2, 33], + 75: [2, 33], + 80: [2, 33], + 81: [2, 33], + 82: [2, 33], + 83: [2, 33], + 84: [2, 33], + 85: [2, 33] + }, + { + 23: [2, 34], + 33: [2, 34], + 54: [2, 34], + 65: [2, 34], + 68: [2, 34], + 72: [2, 34], + 75: [2, 34], + 80: [2, 34], + 81: [2, 34], + 82: [2, 34], + 83: [2, 34], + 84: [2, 34], + 85: [2, 34] + }, + { + 23: [2, 35], + 33: [2, 35], + 54: [2, 35], + 65: [2, 35], + 68: [2, 35], + 72: [2, 35], + 75: [2, 35], + 80: [2, 35], + 81: [2, 35], + 82: [2, 35], + 83: [2, 35], + 84: [2, 35], + 85: [2, 35] + }, + { + 23: [2, 36], + 33: [2, 36], + 54: [2, 36], + 65: [2, 36], + 68: [2, 36], + 72: [2, 36], + 75: [2, 36], + 80: [2, 36], + 81: [2, 36], + 82: [2, 36], + 83: [2, 36], + 84: [2, 36], + 85: [2, 36] + }, + { + 23: [2, 37], + 33: [2, 37], + 54: [2, 37], + 65: [2, 37], + 68: [2, 37], + 72: [2, 37], + 75: [2, 37], + 80: [2, 37], + 81: [2, 37], + 82: [2, 37], + 83: [2, 37], + 84: [2, 37], + 85: [2, 37] + }, + { + 23: [2, 38], + 33: [2, 38], + 54: [2, 38], + 65: [2, 38], + 68: [2, 38], + 72: [2, 38], + 75: [2, 38], + 80: [2, 38], + 81: [2, 38], + 82: [2, 38], + 83: [2, 38], + 84: [2, 38], + 85: [2, 38] + }, + { + 23: [2, 39], + 33: [2, 39], + 54: [2, 39], + 65: [2, 39], + 68: [2, 39], + 72: [2, 39], + 75: [2, 39], + 80: [2, 39], + 81: [2, 39], + 82: [2, 39], + 83: [2, 39], + 84: [2, 39], + 85: [2, 39] + }, + { + 23: [2, 43], + 33: [2, 43], + 54: [2, 43], + 65: [2, 43], + 68: [2, 43], + 72: [2, 43], + 75: [2, 43], + 80: [2, 43], + 81: [2, 43], + 82: [2, 43], + 83: [2, 43], + 84: [2, 43], + 85: [2, 43], + 87: [1, 51] + }, + { 72: [1, 35], 86: 52 }, + { + 23: [2, 45], + 33: [2, 45], + 54: [2, 45], + 65: [2, 45], + 68: [2, 45], + 72: [2, 45], + 75: [2, 45], + 80: [2, 45], + 81: [2, 45], + 82: [2, 45], + 83: [2, 45], + 84: [2, 45], + 85: [2, 45], + 87: [2, 45] + }, + { + 52: 53, + 54: [2, 82], + 65: [2, 82], + 72: [2, 82], + 80: [2, 82], + 81: [2, 82], + 82: [2, 82], + 83: [2, 82], + 84: [2, 82], + 85: [2, 82] + }, + { + 25: 54, + 38: 56, + 39: [1, 58], + 43: 57, + 44: [1, 59], + 45: 55, + 47: [2, 54] + }, + { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, + { 13: 63, 15: [1, 20], 18: [1, 62] }, + { 15: [2, 48], 18: [2, 48] }, + { + 33: [2, 86], + 57: 64, + 65: [2, 86], + 72: [2, 86], + 80: [2, 86], + 81: [2, 86], + 82: [2, 86], + 83: [2, 86], + 84: [2, 86], + 85: [2, 86] + }, + { + 33: [2, 40], + 65: [2, 40], + 72: [2, 40], + 80: [2, 40], + 81: [2, 40], + 82: [2, 40], + 83: [2, 40], + 84: [2, 40], + 85: [2, 40] + }, + { + 33: [2, 41], + 65: [2, 41], + 72: [2, 41], + 80: [2, 41], + 81: [2, 41], + 82: [2, 41], + 83: [2, 41], + 84: [2, 41], + 85: [2, 41] + }, + { + 20: 65, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { 26: 66, 47: [1, 67] }, + { + 30: 68, + 33: [2, 58], + 65: [2, 58], + 72: [2, 58], + 75: [2, 58], + 80: [2, 58], + 81: [2, 58], + 82: [2, 58], + 83: [2, 58], + 84: [2, 58], + 85: [2, 58] + }, + { + 33: [2, 64], + 35: 69, + 65: [2, 64], + 72: [2, 64], + 75: [2, 64], + 80: [2, 64], + 81: [2, 64], + 82: [2, 64], + 83: [2, 64], + 84: [2, 64], + 85: [2, 64] + }, + { + 21: 70, + 23: [2, 50], + 65: [2, 50], + 72: [2, 50], + 80: [2, 50], + 81: [2, 50], + 82: [2, 50], + 83: [2, 50], + 84: [2, 50], + 85: [2, 50] + }, + { + 33: [2, 90], + 61: 71, + 65: [2, 90], + 72: [2, 90], + 80: [2, 90], + 81: [2, 90], + 82: [2, 90], + 83: [2, 90], + 84: [2, 90], + 85: [2, 90] + }, + { + 20: 75, + 33: [2, 80], + 50: 72, + 63: 73, + 64: 76, + 65: [1, 44], + 69: 74, + 70: 77, + 71: 78, + 72: [1, 79], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { 72: [1, 80] }, + { + 23: [2, 42], + 33: [2, 42], + 54: [2, 42], + 65: [2, 42], + 68: [2, 42], + 72: [2, 42], + 75: [2, 42], + 80: [2, 42], + 81: [2, 42], + 82: [2, 42], + 83: [2, 42], + 84: [2, 42], + 85: [2, 42], + 87: [1, 51] + }, + { + 20: 75, + 53: 81, + 54: [2, 84], + 63: 82, + 64: 76, + 65: [1, 44], + 69: 83, + 70: 77, + 71: 78, + 72: [1, 79], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { 26: 84, 47: [1, 67] }, + { 47: [2, 55] }, + { + 4: 85, + 6: 3, + 14: [2, 46], + 15: [2, 46], + 19: [2, 46], + 29: [2, 46], + 34: [2, 46], + 39: [2, 46], + 44: [2, 46], + 47: [2, 46], + 48: [2, 46], + 51: [2, 46], + 55: [2, 46], + 60: [2, 46] + }, + { 47: [2, 20] }, + { + 20: 86, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 4: 87, + 6: 3, + 14: [2, 46], + 15: [2, 46], + 19: [2, 46], + 29: [2, 46], + 34: [2, 46], + 47: [2, 46], + 48: [2, 46], + 51: [2, 46], + 55: [2, 46], + 60: [2, 46] + }, + { 26: 88, 47: [1, 67] }, + { 47: [2, 57] }, + { + 5: [2, 11], + 14: [2, 11], + 15: [2, 11], + 19: [2, 11], + 29: [2, 11], + 34: [2, 11], + 39: [2, 11], + 44: [2, 11], + 47: [2, 11], + 48: [2, 11], + 51: [2, 11], + 55: [2, 11], + 60: [2, 11] + }, + { 15: [2, 49], 18: [2, 49] }, + { + 20: 75, + 33: [2, 88], + 58: 89, + 63: 90, + 64: 76, + 65: [1, 44], + 69: 91, + 70: 77, + 71: 78, + 72: [1, 79], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 65: [2, 94], + 66: 92, + 68: [2, 94], + 72: [2, 94], + 80: [2, 94], + 81: [2, 94], + 82: [2, 94], + 83: [2, 94], + 84: [2, 94], + 85: [2, 94] + }, + { + 5: [2, 25], + 14: [2, 25], + 15: [2, 25], + 19: [2, 25], + 29: [2, 25], + 34: [2, 25], + 39: [2, 25], + 44: [2, 25], + 47: [2, 25], + 48: [2, 25], + 51: [2, 25], + 55: [2, 25], + 60: [2, 25] + }, + { + 20: 93, + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 75, + 31: 94, + 33: [2, 60], + 63: 95, + 64: 76, + 65: [1, 44], + 69: 96, + 70: 77, + 71: 78, + 72: [1, 79], + 75: [2, 60], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 75, + 33: [2, 66], + 36: 97, + 63: 98, + 64: 76, + 65: [1, 44], + 69: 99, + 70: 77, + 71: 78, + 72: [1, 79], + 75: [2, 66], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 75, + 22: 100, + 23: [2, 52], + 63: 101, + 64: 76, + 65: [1, 44], + 69: 102, + 70: 77, + 71: 78, + 72: [1, 79], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 20: 75, + 33: [2, 92], + 62: 103, + 63: 104, + 64: 76, + 65: [1, 44], + 69: 105, + 70: 77, + 71: 78, + 72: [1, 79], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { 33: [1, 106] }, + { + 33: [2, 79], + 65: [2, 79], + 72: [2, 79], + 80: [2, 79], + 81: [2, 79], + 82: [2, 79], + 83: [2, 79], + 84: [2, 79], + 85: [2, 79] + }, + { 33: [2, 81] }, + { + 23: [2, 27], + 33: [2, 27], + 54: [2, 27], + 65: [2, 27], + 68: [2, 27], + 72: [2, 27], + 75: [2, 27], + 80: [2, 27], + 81: [2, 27], + 82: [2, 27], + 83: [2, 27], + 84: [2, 27], + 85: [2, 27] + }, + { + 23: [2, 28], + 33: [2, 28], + 54: [2, 28], + 65: [2, 28], + 68: [2, 28], + 72: [2, 28], + 75: [2, 28], + 80: [2, 28], + 81: [2, 28], + 82: [2, 28], + 83: [2, 28], + 84: [2, 28], + 85: [2, 28] + }, + { + 23: [2, 30], + 33: [2, 30], + 54: [2, 30], + 68: [2, 30], + 71: 107, + 72: [1, 108], + 75: [2, 30] + }, + { + 23: [2, 98], + 33: [2, 98], + 54: [2, 98], + 68: [2, 98], + 72: [2, 98], + 75: [2, 98] + }, + { + 23: [2, 45], + 33: [2, 45], + 54: [2, 45], + 65: [2, 45], + 68: [2, 45], + 72: [2, 45], + 73: [1, 109], + 75: [2, 45], + 80: [2, 45], + 81: [2, 45], + 82: [2, 45], + 83: [2, 45], + 84: [2, 45], + 85: [2, 45], + 87: [2, 45] + }, + { + 23: [2, 44], + 33: [2, 44], + 54: [2, 44], + 65: [2, 44], + 68: [2, 44], + 72: [2, 44], + 75: [2, 44], + 80: [2, 44], + 81: [2, 44], + 82: [2, 44], + 83: [2, 44], + 84: [2, 44], + 85: [2, 44], + 87: [2, 44] + }, + { 54: [1, 110] }, + { + 54: [2, 83], + 65: [2, 83], + 72: [2, 83], + 80: [2, 83], + 81: [2, 83], + 82: [2, 83], + 83: [2, 83], + 84: [2, 83], + 85: [2, 83] + }, + { 54: [2, 85] }, + { + 5: [2, 13], + 14: [2, 13], + 15: [2, 13], + 19: [2, 13], + 29: [2, 13], + 34: [2, 13], + 39: [2, 13], + 44: [2, 13], + 47: [2, 13], + 48: [2, 13], + 51: [2, 13], + 55: [2, 13], + 60: [2, 13] + }, + { + 38: 56, + 39: [1, 58], + 43: 57, + 44: [1, 59], + 45: 112, + 46: 111, + 47: [2, 76] + }, + { + 33: [2, 70], + 40: 113, + 65: [2, 70], + 72: [2, 70], + 75: [2, 70], + 80: [2, 70], + 81: [2, 70], + 82: [2, 70], + 83: [2, 70], + 84: [2, 70], + 85: [2, 70] + }, + { 47: [2, 18] }, + { + 5: [2, 14], + 14: [2, 14], + 15: [2, 14], + 19: [2, 14], + 29: [2, 14], + 34: [2, 14], + 39: [2, 14], + 44: [2, 14], + 47: [2, 14], + 48: [2, 14], + 51: [2, 14], + 55: [2, 14], + 60: [2, 14] + }, + { 33: [1, 114] }, + { + 33: [2, 87], + 65: [2, 87], + 72: [2, 87], + 80: [2, 87], + 81: [2, 87], + 82: [2, 87], + 83: [2, 87], + 84: [2, 87], + 85: [2, 87] + }, + { 33: [2, 89] }, + { + 20: 75, + 63: 116, + 64: 76, + 65: [1, 44], + 67: 115, + 68: [2, 96], + 69: 117, + 70: 77, + 71: 78, + 72: [1, 79], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { 33: [1, 118] }, + { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, + { + 33: [2, 59], + 65: [2, 59], + 72: [2, 59], + 75: [2, 59], + 80: [2, 59], + 81: [2, 59], + 82: [2, 59], + 83: [2, 59], + 84: [2, 59], + 85: [2, 59] + }, + { 33: [2, 61], 75: [2, 61] }, + { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, + { + 33: [2, 65], + 65: [2, 65], + 72: [2, 65], + 75: [2, 65], + 80: [2, 65], + 81: [2, 65], + 82: [2, 65], + 83: [2, 65], + 84: [2, 65], + 85: [2, 65] + }, + { 33: [2, 67], 75: [2, 67] }, + { 23: [1, 124] }, + { + 23: [2, 51], + 65: [2, 51], + 72: [2, 51], + 80: [2, 51], + 81: [2, 51], + 82: [2, 51], + 83: [2, 51], + 84: [2, 51], + 85: [2, 51] + }, + { 23: [2, 53] }, + { 33: [1, 125] }, + { + 33: [2, 91], + 65: [2, 91], + 72: [2, 91], + 80: [2, 91], + 81: [2, 91], + 82: [2, 91], + 83: [2, 91], + 84: [2, 91], + 85: [2, 91] + }, + { 33: [2, 93] }, + { + 5: [2, 22], + 14: [2, 22], + 15: [2, 22], + 19: [2, 22], + 29: [2, 22], + 34: [2, 22], + 39: [2, 22], + 44: [2, 22], + 47: [2, 22], + 48: [2, 22], + 51: [2, 22], + 55: [2, 22], + 60: [2, 22] + }, + { + 23: [2, 99], + 33: [2, 99], + 54: [2, 99], + 68: [2, 99], + 72: [2, 99], + 75: [2, 99] + }, + { 73: [1, 109] }, + { + 20: 75, + 63: 126, + 64: 76, + 65: [1, 44], + 72: [1, 35], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 5: [2, 23], + 14: [2, 23], + 15: [2, 23], + 19: [2, 23], + 29: [2, 23], + 34: [2, 23], + 39: [2, 23], + 44: [2, 23], + 47: [2, 23], + 48: [2, 23], + 51: [2, 23], + 55: [2, 23], + 60: [2, 23] + }, + { 47: [2, 19] }, + { 47: [2, 77] }, + { + 20: 75, + 33: [2, 72], + 41: 127, + 63: 128, + 64: 76, + 65: [1, 44], + 69: 129, + 70: 77, + 71: 78, + 72: [1, 79], + 75: [2, 72], + 78: 26, + 79: 27, + 80: [1, 28], + 81: [1, 29], + 82: [1, 30], + 83: [1, 31], + 84: [1, 32], + 85: [1, 34], + 86: 33 + }, + { + 5: [2, 24], + 14: [2, 24], + 15: [2, 24], + 19: [2, 24], + 29: [2, 24], + 34: [2, 24], + 39: [2, 24], + 44: [2, 24], + 47: [2, 24], + 48: [2, 24], + 51: [2, 24], + 55: [2, 24], + 60: [2, 24] + }, + { 68: [1, 130] }, + { + 65: [2, 95], + 68: [2, 95], + 72: [2, 95], + 80: [2, 95], + 81: [2, 95], + 82: [2, 95], + 83: [2, 95], + 84: [2, 95], + 85: [2, 95] + }, + { 68: [2, 97] }, + { + 5: [2, 21], + 14: [2, 21], + 15: [2, 21], + 19: [2, 21], + 29: [2, 21], + 34: [2, 21], + 39: [2, 21], + 44: [2, 21], + 47: [2, 21], + 48: [2, 21], + 51: [2, 21], + 55: [2, 21], + 60: [2, 21] + }, + { 33: [1, 131] }, + { 33: [2, 63] }, + { 72: [1, 133], 76: 132 }, + { 33: [1, 134] }, + { 33: [2, 69] }, + { 15: [2, 12] }, + { + 14: [2, 26], + 15: [2, 26], + 19: [2, 26], + 29: [2, 26], + 34: [2, 26], + 47: [2, 26], + 48: [2, 26], + 51: [2, 26], + 55: [2, 26], + 60: [2, 26] + }, + { + 23: [2, 31], + 33: [2, 31], + 54: [2, 31], + 68: [2, 31], + 72: [2, 31], + 75: [2, 31] + }, + { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, + { + 33: [2, 71], + 65: [2, 71], + 72: [2, 71], + 75: [2, 71], + 80: [2, 71], + 81: [2, 71], + 82: [2, 71], + 83: [2, 71], + 84: [2, 71], + 85: [2, 71] + }, + { 33: [2, 73], 75: [2, 73] }, + { + 23: [2, 29], + 33: [2, 29], + 54: [2, 29], + 65: [2, 29], + 68: [2, 29], + 72: [2, 29], + 75: [2, 29], + 80: [2, 29], + 81: [2, 29], + 82: [2, 29], + 83: [2, 29], + 84: [2, 29], + 85: [2, 29] + }, + { + 14: [2, 15], + 15: [2, 15], + 19: [2, 15], + 29: [2, 15], + 34: [2, 15], + 39: [2, 15], + 44: [2, 15], + 47: [2, 15], + 48: [2, 15], + 51: [2, 15], + 55: [2, 15], + 60: [2, 15] + }, + { 72: [1, 138], 77: [1, 137] }, + { 72: [2, 100], 77: [2, 100] }, + { + 14: [2, 16], + 15: [2, 16], + 19: [2, 16], + 29: [2, 16], + 34: [2, 16], + 44: [2, 16], + 47: [2, 16], + 48: [2, 16], + 51: [2, 16], + 55: [2, 16], + 60: [2, 16] + }, + { 33: [1, 139] }, + { 33: [2, 75] }, + { 33: [2, 32] }, + { 72: [2, 101], 77: [2, 101] }, + { + 14: [2, 17], + 15: [2, 17], + 19: [2, 17], + 29: [2, 17], + 34: [2, 17], + 39: [2, 17], + 44: [2, 17], + 47: [2, 17], + 48: [2, 17], + 51: [2, 17], + 55: [2, 17], + 60: [2, 17] + } + ], + defaultActions: { + 4: [2, 1], + 55: [2, 55], + 57: [2, 20], + 61: [2, 57], + 74: [2, 81], + 83: [2, 85], + 87: [2, 18], + 91: [2, 89], + 102: [2, 53], + 105: [2, 93], + 111: [2, 19], + 112: [2, 77], + 117: [2, 97], + 120: [2, 63], + 123: [2, 69], + 124: [2, 12], + 136: [2, 75], + 137: [2, 32] + }, + parseError: function(a, b) { + throw new Error(a); + }, + parse: function(a) { + function b() { + var a; + return ( + (a = c.lexer.lex() || 1), + "number" != typeof a && + (a = c.symbols_[a] || a), + a + ); + } + var c = this, + d = [0], + e = [null], + f = [], + g = this.table, + h = "", + i = 0, + j = 0, + k = 0; + this.lexer.setInput(a), + (this.lexer.yy = this.yy), + (this.yy.lexer = this.lexer), + (this.yy.parser = this), + "undefined" == typeof this.lexer.yylloc && + (this.lexer.yylloc = {}); + var l = this.lexer.yylloc; + f.push(l); + var m = + this.lexer.options && this.lexer.options.ranges; + "function" == typeof this.yy.parseError && + (this.parseError = this.yy.parseError); + for (var n, o, p, q, r, s, t, u, v, w = {}; ; ) { + if ( + ((p = d[d.length - 1]), + this.defaultActions[p] + ? (q = this.defaultActions[p]) + : ((null === n || + "undefined" == typeof n) && + (n = b()), + (q = g[p] && g[p][n])), + "undefined" == typeof q || + !q.length || + !q[0]) + ) { + var x = ""; + if (!k) { + v = []; + for (s in g[p]) + this.terminals_[s] && + s > 2 && + v.push( + "'" + + this.terminals_[s] + + "'" + ); + (x = this.lexer.showPosition + ? "Parse error on line " + + (i + 1) + + ":\n" + + this.lexer.showPosition() + + "\nExpecting " + + v.join(", ") + + ", got '" + + (this.terminals_[n] || n) + + "'" + : "Parse error on line " + + (i + 1) + + ": Unexpected " + + (1 == n + ? "end of input" + : "'" + + (this.terminals_[n] || n) + + "'")), + this.parseError(x, { + text: this.lexer.match, + token: this.terminals_[n] || n, + line: this.lexer.yylineno, + loc: l, + expected: v + }); + } + } + if (q[0] instanceof Array && q.length > 1) + throw new Error( + "Parse Error: multiple actions possible at state: " + + p + + ", token: " + + n + ); + switch (q[0]) { + case 1: + d.push(n), + e.push(this.lexer.yytext), + f.push(this.lexer.yylloc), + d.push(q[1]), + (n = null), + o + ? ((n = o), (o = null)) + : ((j = this.lexer.yyleng), + (h = this.lexer.yytext), + (i = this.lexer.yylineno), + (l = this.lexer.yylloc), + k > 0 && k--); + break; + case 2: + if ( + ((t = this.productions_[q[1]][1]), + (w.$ = e[e.length - t]), + (w._$ = { + first_line: + f[f.length - (t || 1)] + .first_line, + last_line: + f[f.length - 1].last_line, + first_column: + f[f.length - (t || 1)] + .first_column, + last_column: + f[f.length - 1].last_column + }), + m && + (w._$.range = [ + f[f.length - (t || 1)] + .range[0], + f[f.length - 1].range[1] + ]), + (r = this.performAction.call( + w, + h, + j, + i, + this.yy, + q[1], + e, + f + )), + "undefined" != typeof r) + ) + return r; + t && + ((d = d.slice(0, -1 * t * 2)), + (e = e.slice(0, -1 * t)), + (f = f.slice(0, -1 * t))), + d.push(this.productions_[q[1]][0]), + e.push(w.$), + f.push(w._$), + (u = + g[d[d.length - 2]][ + d[d.length - 1] + ]), + d.push(u); + break; + case 3: + return !0; + } + } + return !0; + } + }, + c = (function() { + var a = { + EOF: 1, + parseError: function(a, b) { + if (!this.yy.parser) throw new Error(a); + this.yy.parser.parseError(a, b); + }, + setInput: function(a) { + return ( + (this._input = a), + (this._more = this._less = this.done = !1), + (this.yylineno = this.yyleng = 0), + (this.yytext = this.matched = this.match = + ""), + (this.conditionStack = ["INITIAL"]), + (this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }), + this.options.ranges && + (this.yylloc.range = [0, 0]), + (this.offset = 0), + this + ); + }, + input: function() { + var a = this._input[0]; + (this.yytext += a), + this.yyleng++, + this.offset++, + (this.match += a), + (this.matched += a); + var b = a.match(/(?:\r\n?|\n).*/g); + return ( + b + ? (this.yylineno++, + this.yylloc.last_line++) + : this.yylloc.last_column++, + this.options.ranges && + this.yylloc.range[1]++, + (this._input = this._input.slice(1)), + a + ); + }, + unput: function(a) { + var b = a.length, + c = a.split(/(?:\r\n?|\n)/g); + (this._input = a + this._input), + (this.yytext = this.yytext.substr( + 0, + this.yytext.length - b - 1 + )), + (this.offset -= b); + var d = this.match.split(/(?:\r\n?|\n)/g); + (this.match = this.match.substr( + 0, + this.match.length - 1 + )), + (this.matched = this.matched.substr( + 0, + this.matched.length - 1 + )), + c.length - 1 && + (this.yylineno -= c.length - 1); + var e = this.yylloc.range; + return ( + (this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: c + ? (c.length === d.length + ? this.yylloc.first_column + : 0) + + d[d.length - c.length].length - + c[0].length + : this.yylloc.first_column - b + }), + this.options.ranges && + (this.yylloc.range = [ + e[0], + e[0] + this.yyleng - b + ]), + this + ); + }, + more: function() { + return (this._more = !0), this; + }, + less: function(a) { + this.unput(this.match.slice(a)); + }, + pastInput: function() { + var a = this.matched.substr( + 0, + this.matched.length - this.match.length + ); + return ( + (a.length > 20 ? "..." : "") + + a.substr(-20).replace(/\n/g, "") + ); + }, + upcomingInput: function() { + var a = this.match; + return ( + a.length < 20 && + (a += this._input.substr( + 0, + 20 - a.length + )), + ( + a.substr(0, 20) + + (a.length > 20 ? "..." : "") + ).replace(/\n/g, "") + ); + }, + showPosition: function() { + var a = this.pastInput(), + b = new Array(a.length + 1).join("-"); + return ( + a + this.upcomingInput() + "\n" + b + "^" + ); + }, + next: function() { + if (this.done) return this.EOF; + this._input || (this.done = !0); + var a, b, c, d, e; + this._more || + ((this.yytext = ""), (this.match = "")); + for ( + var f = this._currentRules(), g = 0; + g < f.length && + ((c = this._input.match(this.rules[f[g]])), + !c || + (b && !(c[0].length > b[0].length)) || + ((b = c), (d = g), this.options.flex)); + g++ + ); + return b + ? ((e = b[0].match(/(?:\r\n?|\n).*/g)), + e && (this.yylineno += e.length), + (this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: e + ? e[e.length - 1].length - + e[e.length - 1].match( + /\r?\n?/ + )[0].length + : this.yylloc.last_column + + b[0].length + }), + (this.yytext += b[0]), + (this.match += b[0]), + (this.matches = b), + (this.yyleng = this.yytext.length), + this.options.ranges && + (this.yylloc.range = [ + this.offset, + (this.offset += this.yyleng) + ]), + (this._more = !1), + (this._input = this._input.slice( + b[0].length + )), + (this.matched += b[0]), + (a = this.performAction.call( + this, + this.yy, + this, + f[d], + this.conditionStack[ + this.conditionStack.length - 1 + ] + )), + this.done && + this._input && + (this.done = !1), + a ? a : void 0) + : "" === this._input + ? this.EOF + : this.parseError( + "Lexical error on line " + + (this.yylineno + 1) + + ". Unrecognized text.\n" + + this.showPosition(), + { + text: "", + token: null, + line: this.yylineno + } + ); + }, + lex: function() { + var a = this.next(); + return "undefined" != typeof a ? a : this.lex(); + }, + begin: function(a) { + this.conditionStack.push(a); + }, + popState: function() { + return this.conditionStack.pop(); + }, + _currentRules: function() { + return this.conditions[ + this.conditionStack[ + this.conditionStack.length - 1 + ] + ].rules; + }, + topState: function() { + return this.conditionStack[ + this.conditionStack.length - 2 + ]; + }, + pushState: function(a) { + this.begin(a); + } + }; + return ( + (a.options = {}), + (a.performAction = function(a, b, c, d) { + function e(a, c) { + return (b.yytext = b.yytext.substr( + a, + b.yyleng - c + )); + } + switch (c) { + case 0: + if ( + ("\\\\" === b.yytext.slice(-2) + ? (e(0, 1), this.begin("mu")) + : "\\" === b.yytext.slice(-1) + ? (e(0, 1), this.begin("emu")) + : this.begin("mu"), + b.yytext) + ) + return 15; + break; + case 1: + return 15; + case 2: + return this.popState(), 15; + case 3: + return this.begin("raw"), 15; + case 4: + return ( + this.popState(), + "raw" === + this.conditionStack[ + this.conditionStack.length - 1 + ] + ? 15 + : ((b.yytext = b.yytext.substr( + 5, + b.yyleng - 9 + )), + "END_RAW_BLOCK") + ); + case 5: + return 15; + case 6: + return this.popState(), 14; + case 7: + return 65; + case 8: + return 68; + case 9: + return 19; + case 10: + return ( + this.popState(), + this.begin("raw"), + 23 + ); + case 11: + return 55; + case 12: + return 60; + case 13: + return 29; + case 14: + return 47; + case 15: + return this.popState(), 44; + case 16: + return this.popState(), 44; + case 17: + return 34; + case 18: + return 39; + case 19: + return 51; + case 20: + return 48; + case 21: + this.unput(b.yytext), + this.popState(), + this.begin("com"); + break; + case 22: + return this.popState(), 14; + case 23: + return 48; + case 24: + return 73; + case 25: + return 72; + case 26: + return 72; + case 27: + return 87; + case 28: + break; + case 29: + return this.popState(), 54; + case 30: + return this.popState(), 33; + case 31: + return ( + (b.yytext = e(1, 2).replace( + /\\"/g, + '"' + )), + 80 + ); + case 32: + return ( + (b.yytext = e(1, 2).replace( + /\\'/g, + "'" + )), + 80 + ); + case 33: + return 85; + case 34: + return 82; + case 35: + return 82; + case 36: + return 83; + case 37: + return 84; + case 38: + return 81; + case 39: + return 75; + case 40: + return 77; + case 41: + return 72; + case 42: + return ( + (b.yytext = b.yytext.replace( + /\\([\\\]])/g, + "$1" + )), + 72 + ); + case 43: + return "INVALID"; + case 44: + return 5; + } + }), + (a.rules = [ + /^(?:[^\x00]*?(?=(\{\{)))/, + /^(?:[^\x00]+)/, + /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, + /^(?:\{\{\{\{(?=[^\/]))/, + /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, + /^(?:[^\x00]*?(?=(\{\{\{\{)))/, + /^(?:[\s\S]*?--(~)?\}\})/, + /^(?:\()/, + /^(?:\))/, + /^(?:\{\{\{\{)/, + /^(?:\}\}\}\})/, + /^(?:\{\{(~)?>)/, + /^(?:\{\{(~)?#>)/, + /^(?:\{\{(~)?#\*?)/, + /^(?:\{\{(~)?\/)/, + /^(?:\{\{(~)?\^\s*(~)?\}\})/, + /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, + /^(?:\{\{(~)?\^)/, + /^(?:\{\{(~)?\s*else\b)/, + /^(?:\{\{(~)?\{)/, + /^(?:\{\{(~)?&)/, + /^(?:\{\{(~)?!--)/, + /^(?:\{\{(~)?![\s\S]*?\}\})/, + /^(?:\{\{(~)?\*?)/, + /^(?:=)/, + /^(?:\.\.)/, + /^(?:\.(?=([=~}\s\/.)|])))/, + /^(?:[\/.])/, + /^(?:\s+)/, + /^(?:\}(~)?\}\})/, + /^(?:(~)?\}\})/, + /^(?:"(\\["]|[^"])*")/, + /^(?:'(\\[']|[^'])*')/, + /^(?:@)/, + /^(?:true(?=([~}\s)])))/, + /^(?:false(?=([~}\s)])))/, + /^(?:undefined(?=([~}\s)])))/, + /^(?:null(?=([~}\s)])))/, + /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, + /^(?:as\s+\|)/, + /^(?:\|)/, + /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, + /^(?:\[(\\\]|[^\]])*\])/, + /^(?:.)/, + /^(?:$)/ + ]), + (a.conditions = { + mu: { + rules: [ + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44 + ], + inclusive: !1 + }, + emu: { rules: [2], inclusive: !1 }, + com: { rules: [6], inclusive: !1 }, + raw: { rules: [3, 4, 5], inclusive: !1 }, + INITIAL: { rules: [0, 1, 44], inclusive: !0 } + }), + a + ); + })(); + return ( + (b.lexer = c), (a.prototype = b), (b.Parser = a), new a() + ); + })(); + (b.__esModule = !0), (b["default"] = c); + }, + function(a, b, c) { + "use strict"; + function d() { + var a = + arguments.length <= 0 || void 0 === arguments[0] + ? {} + : arguments[0]; + this.options = a; + } + function e(a, b, c) { + void 0 === b && (b = a.length); + var d = a[b - 1], + e = a[b - 2]; + return d + ? "ContentStatement" === d.type + ? (e || !c ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test( + d.original + ) + : void 0 + : c; + } + function f(a, b, c) { + void 0 === b && (b = -1); + var d = a[b + 1], + e = a[b + 2]; + return d + ? "ContentStatement" === d.type + ? (e || !c ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test( + d.original + ) + : void 0 + : c; + } + function g(a, b, c) { + var d = a[null == b ? 0 : b + 1]; + if ( + d && + "ContentStatement" === d.type && + (c || !d.rightStripped) + ) { + var e = d.value; + (d.value = d.value.replace( + c ? /^\s+/ : /^[ \t]*\r?\n?/, + "" + )), + (d.rightStripped = d.value !== e); + } + } + function h(a, b, c) { + var d = a[null == b ? a.length - 1 : b - 1]; + if ( + d && + "ContentStatement" === d.type && + (c || !d.leftStripped) + ) { + var e = d.value; + return ( + (d.value = d.value.replace(c ? /\s+$/ : /[ \t]+$/, "")), + (d.leftStripped = d.value !== e), + d.leftStripped + ); + } + } + var i = c(1)["default"]; + b.__esModule = !0; + var j = c(25), + k = i(j); + (d.prototype = new k["default"]()), + (d.prototype.Program = function(a) { + var b = !this.options.ignoreStandalone, + c = !this.isRootSeen; + this.isRootSeen = !0; + for (var d = a.body, i = 0, j = d.length; j > i; i++) { + var k = d[i], + l = this.accept(k); + if (l) { + var m = e(d, i, c), + n = f(d, i, c), + o = l.openStandalone && m, + p = l.closeStandalone && n, + q = l.inlineStandalone && m && n; + l.close && g(d, i, !0), + l.open && h(d, i, !0), + b && + q && + (g(d, i), + h(d, i) && + "PartialStatement" === k.type && + (k.indent = /([ \t]+$)/.exec( + d[i - 1].original + )[1])), + b && + o && + (g((k.program || k.inverse).body), h(d, i)), + b && + p && + (g(d, i), h((k.inverse || k.program).body)); + } + } + return a; + }), + (d.prototype.BlockStatement = d.prototype.DecoratorBlock = d.prototype.PartialBlockStatement = function( + a + ) { + this.accept(a.program), this.accept(a.inverse); + var b = a.program || a.inverse, + c = a.program && a.inverse, + d = c, + i = c; + if (c && c.chained) + for (d = c.body[0].program; i.chained; ) + i = i.body[i.body.length - 1].program; + var j = { + open: a.openStrip.open, + close: a.closeStrip.close, + openStandalone: f(b.body), + closeStandalone: e((d || b).body) + }; + if ((a.openStrip.close && g(b.body, null, !0), c)) { + var k = a.inverseStrip; + k.open && h(b.body, null, !0), + k.close && g(d.body, null, !0), + a.closeStrip.open && h(i.body, null, !0), + !this.options.ignoreStandalone && + e(b.body) && + f(d.body) && + (h(b.body), g(d.body)); + } else a.closeStrip.open && h(b.body, null, !0); + return j; + }), + (d.prototype.Decorator = d.prototype.MustacheStatement = function( + a + ) { + return a.strip; + }), + (d.prototype.PartialStatement = d.prototype.CommentStatement = function( + a + ) { + var b = a.strip || {}; + return { + inlineStandalone: !0, + open: b.open, + close: b.close + }; + }), + (b["default"] = d), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d() { + this.parents = []; + } + function e(a) { + this.acceptRequired(a, "path"), + this.acceptArray(a.params), + this.acceptKey(a, "hash"); + } + function f(a) { + e.call(this, a), + this.acceptKey(a, "program"), + this.acceptKey(a, "inverse"); + } + function g(a) { + this.acceptRequired(a, "name"), + this.acceptArray(a.params), + this.acceptKey(a, "hash"); + } + var h = c(1)["default"]; + b.__esModule = !0; + var i = c(6), + j = h(i); + (d.prototype = { + constructor: d, + mutating: !1, + acceptKey: function(a, b) { + var c = this.accept(a[b]); + if (this.mutating) { + if (c && !d.prototype[c.type]) + throw new j["default"]( + 'Unexpected node type "' + + c.type + + '" found when accepting ' + + b + + " on " + + a.type + ); + a[b] = c; + } + }, + acceptRequired: function(a, b) { + if ((this.acceptKey(a, b), !a[b])) + throw new j["default"](a.type + " requires " + b); + }, + acceptArray: function(a) { + for (var b = 0, c = a.length; c > b; b++) + this.acceptKey(a, b), + a[b] || (a.splice(b, 1), b--, c--); + }, + accept: function(a) { + if (a) { + if (!this[a.type]) + throw new j["default"]( + "Unknown type: " + a.type, + a + ); + this.current && this.parents.unshift(this.current), + (this.current = a); + var b = this[a.type](a); + return ( + (this.current = this.parents.shift()), + !this.mutating || b ? b : b !== !1 ? a : void 0 + ); + } + }, + Program: function(a) { + this.acceptArray(a.body); + }, + MustacheStatement: e, + Decorator: e, + BlockStatement: f, + DecoratorBlock: f, + PartialStatement: g, + PartialBlockStatement: function(a) { + g.call(this, a), this.acceptKey(a, "program"); + }, + ContentStatement: function() {}, + CommentStatement: function() {}, + SubExpression: e, + PathExpression: function() {}, + StringLiteral: function() {}, + NumberLiteral: function() {}, + BooleanLiteral: function() {}, + UndefinedLiteral: function() {}, + NullLiteral: function() {}, + Hash: function(a) { + this.acceptArray(a.pairs); + }, + HashPair: function(a) { + this.acceptRequired(a, "value"); + } + }), + (b["default"] = d), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d(a, b) { + if ( + ((b = b.path ? b.path.original : b), a.path.original !== b) + ) { + var c = { loc: a.path.loc }; + throw new q["default"]( + a.path.original + " doesn't match " + b, + c + ); + } + } + function e(a, b) { + (this.source = a), + (this.start = { + line: b.first_line, + column: b.first_column + }), + (this.end = { line: b.last_line, column: b.last_column }); + } + function f(a) { + return /^\[.*\]$/.test(a) ? a.substr(1, a.length - 2) : a; + } + function g(a, b) { + return { + open: "~" === a.charAt(2), + close: "~" === b.charAt(b.length - 3) + }; + } + function h(a) { + return a + .replace(/^\{\{~?\!-?-?/, "") + .replace(/-?-?~?\}\}$/, ""); + } + function i(a, b, c) { + c = this.locInfo(c); + for ( + var d = a ? "@" : "", + e = [], + f = 0, + g = "", + h = 0, + i = b.length; + i > h; + h++ + ) { + var j = b[h].part, + k = b[h].original !== j; + if ( + ((d += (b[h].separator || "") + j), + k || (".." !== j && "." !== j && "this" !== j)) + ) + e.push(j); + else { + if (e.length > 0) + throw new q["default"]("Invalid path: " + d, { + loc: c + }); + ".." === j && (f++, (g += "../")); + } + } + return { + type: "PathExpression", + data: a, + depth: f, + parts: e, + original: d, + loc: c + }; + } + function j(a, b, c, d, e, f) { + var g = d.charAt(3) || d.charAt(2), + h = "{" !== g && "&" !== g, + i = /\*/.test(d); + return { + type: i ? "Decorator" : "MustacheStatement", + path: a, + params: b, + hash: c, + escaped: h, + strip: e, + loc: this.locInfo(f) + }; + } + function k(a, b, c, e) { + d(a, c), (e = this.locInfo(e)); + var f = { type: "Program", body: b, strip: {}, loc: e }; + return { + type: "BlockStatement", + path: a.path, + params: a.params, + hash: a.hash, + program: f, + openStrip: {}, + inverseStrip: {}, + closeStrip: {}, + loc: e + }; + } + function l(a, b, c, e, f, g) { + e && e.path && d(a, e); + var h = /\*/.test(a.open); + b.blockParams = a.blockParams; + var i = void 0, + j = void 0; + if (c) { + if (h) + throw new q["default"]( + "Unexpected inverse block on decorator", + c + ); + c.chain && (c.program.body[0].closeStrip = e.strip), + (j = c.strip), + (i = c.program); + } + return ( + f && ((f = i), (i = b), (b = f)), + { + type: h ? "DecoratorBlock" : "BlockStatement", + path: a.path, + params: a.params, + hash: a.hash, + program: b, + inverse: i, + openStrip: a.strip, + inverseStrip: j, + closeStrip: e && e.strip, + loc: this.locInfo(g) + } + ); + } + function m(a, b) { + if (!b && a.length) { + var c = a[0].loc, + d = a[a.length - 1].loc; + c && + d && + (b = { + source: c.source, + start: { + line: c.start.line, + column: c.start.column + }, + end: { line: d.end.line, column: d.end.column } + }); + } + return { type: "Program", body: a, strip: {}, loc: b }; + } + function n(a, b, c, e) { + return ( + d(a, c), + { + type: "PartialBlockStatement", + name: a.path, + params: a.params, + hash: a.hash, + program: b, + openStrip: a.strip, + closeStrip: c && c.strip, + loc: this.locInfo(e) + } + ); + } + var o = c(1)["default"]; + (b.__esModule = !0), + (b.SourceLocation = e), + (b.id = f), + (b.stripFlags = g), + (b.stripComment = h), + (b.preparePath = i), + (b.prepareMustache = j), + (b.prepareRawBlock = k), + (b.prepareBlock = l), + (b.prepareProgram = m), + (b.preparePartialBlock = n); + var p = c(6), + q = o(p); + }, + function(a, b, c) { + "use strict"; + function d() {} + function e(a, b, c) { + if (null == a || ("string" != typeof a && "Program" !== a.type)) + throw new k["default"]( + "You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + + a + ); + (b = b || {}), + "data" in b || (b.data = !0), + b.compat && (b.useDepths = !0); + var d = c.parse(a, b), + e = new c.Compiler().compile(d, b); + return new c.JavaScriptCompiler().compile(e, b); + } + function f(a, b, c) { + function d() { + var d = c.parse(a, b), + e = new c.Compiler().compile(d, b), + f = new c.JavaScriptCompiler().compile( + e, + b, + void 0, + !0 + ); + return c.template(f); + } + function e(a, b) { + return f || (f = d()), f.call(this, a, b); + } + if ( + (void 0 === b && (b = {}), + null == a || ("string" != typeof a && "Program" !== a.type)) + ) + throw new k["default"]( + "You must pass a string or Handlebars AST to Handlebars.compile. You passed " + + a + ); + "data" in b || (b.data = !0), b.compat && (b.useDepths = !0); + var f = void 0; + return ( + (e._setup = function(a) { + return f || (f = d()), f._setup(a); + }), + (e._child = function(a, b, c, e) { + return f || (f = d()), f._child(a, b, c, e); + }), + e + ); + } + function g(a, b) { + if (a === b) return !0; + if (l.isArray(a) && l.isArray(b) && a.length === b.length) { + for (var c = 0; c < a.length; c++) + if (!g(a[c], b[c])) return !1; + return !0; + } + } + function h(a) { + if (!a.path.parts) { + var b = a.path; + a.path = { + type: "PathExpression", + data: !1, + depth: 0, + parts: [b.original + ""], + original: b.original + "", + loc: b.loc + }; + } + } + var i = c(1)["default"]; + (b.__esModule = !0), + (b.Compiler = d), + (b.precompile = e), + (b.compile = f); + var j = c(6), + k = i(j), + l = c(5), + m = c(21), + n = i(m), + o = [].slice; + d.prototype = { + compiler: d, + equals: function(a) { + var b = this.opcodes.length; + if (a.opcodes.length !== b) return !1; + for (var c = 0; b > c; c++) { + var d = this.opcodes[c], + e = a.opcodes[c]; + if (d.opcode !== e.opcode || !g(d.args, e.args)) + return !1; + } + b = this.children.length; + for (var c = 0; b > c; c++) + if (!this.children[c].equals(a.children[c])) return !1; + return !0; + }, + guid: 0, + compile: function(a, b) { + (this.sourceNode = []), + (this.opcodes = []), + (this.children = []), + (this.options = b), + (this.stringParams = b.stringParams), + (this.trackIds = b.trackIds), + (b.blockParams = b.blockParams || []); + var c = b.knownHelpers; + if ( + ((b.knownHelpers = { + helperMissing: !0, + blockHelperMissing: !0, + each: !0, + if: !0, + unless: !0, + with: !0, + log: !0, + lookup: !0 + }), + c) + ) + for (var d in c) d in c && (b.knownHelpers[d] = c[d]); + return this.accept(a); + }, + compileProgram: function(a) { + var b = new this.compiler(), + c = b.compile(a, this.options), + d = this.guid++; + return ( + (this.usePartial = this.usePartial || c.usePartial), + (this.children[d] = c), + (this.useDepths = this.useDepths || c.useDepths), + d + ); + }, + accept: function(a) { + if (!this[a.type]) + throw new k["default"]("Unknown type: " + a.type, a); + this.sourceNode.unshift(a); + var b = this[a.type](a); + return this.sourceNode.shift(), b; + }, + Program: function(a) { + this.options.blockParams.unshift(a.blockParams); + for (var b = a.body, c = b.length, d = 0; c > d; d++) + this.accept(b[d]); + return ( + this.options.blockParams.shift(), + (this.isSimple = 1 === c), + (this.blockParams = a.blockParams + ? a.blockParams.length + : 0), + this + ); + }, + BlockStatement: function(a) { + h(a); + var b = a.program, + c = a.inverse; + (b = b && this.compileProgram(b)), + (c = c && this.compileProgram(c)); + var d = this.classifySexpr(a); + "helper" === d + ? this.helperSexpr(a, b, c) + : "simple" === d + ? (this.simpleSexpr(a), + this.opcode("pushProgram", b), + this.opcode("pushProgram", c), + this.opcode("emptyHash"), + this.opcode("blockValue", a.path.original)) + : (this.ambiguousSexpr(a, b, c), + this.opcode("pushProgram", b), + this.opcode("pushProgram", c), + this.opcode("emptyHash"), + this.opcode("ambiguousBlockValue")), + this.opcode("append"); + }, + DecoratorBlock: function(a) { + var b = a.program && this.compileProgram(a.program), + c = this.setupFullMustacheParams(a, b, void 0), + d = a.path; + (this.useDecorators = !0), + this.opcode("registerDecorator", c.length, d.original); + }, + PartialStatement: function(a) { + this.usePartial = !0; + var b = a.program; + b && (b = this.compileProgram(a.program)); + var c = a.params; + if (c.length > 1) + throw new k["default"]( + "Unsupported number of partial arguments: " + + c.length, + a + ); + c.length || + (this.options.explicitPartialContext + ? this.opcode("pushLiteral", "undefined") + : c.push({ + type: "PathExpression", + parts: [], + depth: 0 + })); + var d = a.name.original, + e = "SubExpression" === a.name.type; + e && this.accept(a.name), + this.setupFullMustacheParams(a, b, void 0, !0); + var f = a.indent || ""; + this.options.preventIndent && + f && + (this.opcode("appendContent", f), (f = "")), + this.opcode("invokePartial", e, d, f), + this.opcode("append"); + }, + PartialBlockStatement: function(a) { + this.PartialStatement(a); + }, + MustacheStatement: function(a) { + this.SubExpression(a), + a.escaped && !this.options.noEscape + ? this.opcode("appendEscaped") + : this.opcode("append"); + }, + Decorator: function(a) { + this.DecoratorBlock(a); + }, + ContentStatement: function(a) { + a.value && this.opcode("appendContent", a.value); + }, + CommentStatement: function() {}, + SubExpression: function(a) { + h(a); + var b = this.classifySexpr(a); + "simple" === b + ? this.simpleSexpr(a) + : "helper" === b + ? this.helperSexpr(a) + : this.ambiguousSexpr(a); + }, + ambiguousSexpr: function(a, b, c) { + var d = a.path, + e = d.parts[0], + f = null != b || null != c; + this.opcode("getContext", d.depth), + this.opcode("pushProgram", b), + this.opcode("pushProgram", c), + (d.strict = !0), + this.accept(d), + this.opcode("invokeAmbiguous", e, f); + }, + simpleSexpr: function(a) { + var b = a.path; + (b.strict = !0), + this.accept(b), + this.opcode("resolvePossibleLambda"); + }, + helperSexpr: function(a, b, c) { + var d = this.setupFullMustacheParams(a, b, c), + e = a.path, + f = e.parts[0]; + if (this.options.knownHelpers[f]) + this.opcode("invokeKnownHelper", d.length, f); + else { + if (this.options.knownHelpersOnly) + throw new k["default"]( + "You specified knownHelpersOnly, but used the unknown helper " + + f, + a + ); + (e.strict = !0), + (e.falsy = !0), + this.accept(e), + this.opcode( + "invokeHelper", + d.length, + e.original, + n["default"].helpers.simpleId(e) + ); + } + }, + PathExpression: function(a) { + this.addDepth(a.depth), this.opcode("getContext", a.depth); + var b = a.parts[0], + c = n["default"].helpers.scopedId(a), + d = !a.depth && !c && this.blockParamIndex(b); + d + ? this.opcode("lookupBlockParam", d, a.parts) + : b + ? a.data + ? ((this.options.data = !0), + this.opcode( + "lookupData", + a.depth, + a.parts, + a.strict + )) + : this.opcode( + "lookupOnContext", + a.parts, + a.falsy, + a.strict, + c + ) + : this.opcode("pushContext"); + }, + StringLiteral: function(a) { + this.opcode("pushString", a.value); + }, + NumberLiteral: function(a) { + this.opcode("pushLiteral", a.value); + }, + BooleanLiteral: function(a) { + this.opcode("pushLiteral", a.value); + }, + UndefinedLiteral: function() { + this.opcode("pushLiteral", "undefined"); + }, + NullLiteral: function() { + this.opcode("pushLiteral", "null"); + }, + Hash: function(a) { + var b = a.pairs, + c = 0, + d = b.length; + for (this.opcode("pushHash"); d > c; c++) + this.pushParam(b[c].value); + for (; c--; ) this.opcode("assignToHash", b[c].key); + this.opcode("popHash"); + }, + opcode: function(a) { + this.opcodes.push({ + opcode: a, + args: o.call(arguments, 1), + loc: this.sourceNode[0].loc + }); + }, + addDepth: function(a) { + a && (this.useDepths = !0); + }, + classifySexpr: function(a) { + var b = n["default"].helpers.simpleId(a.path), + c = b && !!this.blockParamIndex(a.path.parts[0]), + d = !c && n["default"].helpers.helperExpression(a), + e = !c && (d || b); + if (e && !d) { + var f = a.path.parts[0], + g = this.options; + g.knownHelpers[f] + ? (d = !0) + : g.knownHelpersOnly && (e = !1); + } + return d ? "helper" : e ? "ambiguous" : "simple"; + }, + pushParams: function(a) { + for (var b = 0, c = a.length; c > b; b++) + this.pushParam(a[b]); + }, + pushParam: function(a) { + var b = null != a.value ? a.value : a.original || ""; + if (this.stringParams) + b.replace && + (b = b + .replace(/^(\.?\.\/)*/g, "") + .replace(/\//g, ".")), + a.depth && this.addDepth(a.depth), + this.opcode("getContext", a.depth || 0), + this.opcode("pushStringParam", b, a.type), + "SubExpression" === a.type && this.accept(a); + else { + if (this.trackIds) { + var c = void 0; + if ( + (!a.parts || + n["default"].helpers.scopedId(a) || + a.depth || + (c = this.blockParamIndex(a.parts[0])), + c) + ) { + var d = a.parts.slice(1).join("."); + this.opcode("pushId", "BlockParam", c, d); + } else + (b = a.original || b), + b.replace && + (b = b + .replace(/^this(?:\.|$)/, "") + .replace(/^\.\//, "") + .replace(/^\.$/, "")), + this.opcode("pushId", a.type, b); + } + this.accept(a); + } + }, + setupFullMustacheParams: function(a, b, c, d) { + var e = a.params; + return ( + this.pushParams(e), + this.opcode("pushProgram", b), + this.opcode("pushProgram", c), + a.hash + ? this.accept(a.hash) + : this.opcode("emptyHash", d), + e + ); + }, + blockParamIndex: function(a) { + for ( + var b = 0, c = this.options.blockParams.length; + c > b; + b++ + ) { + var d = this.options.blockParams[b], + e = d && l.indexOf(d, a); + if (d && e >= 0) return [b, e]; + } + } + }; + }, + function(a, b, c) { + "use strict"; + function d(a) { + this.value = a; + } + function e() {} + function f(a, b, c, d) { + var e = b.popStack(), + f = 0, + g = c.length; + for (a && g--; g > f; f++) e = b.nameLookup(e, c[f], d); + return a + ? [ + b.aliasable("container.strict"), + "(", + e, + ", ", + b.quotedString(c[f]), + ")" + ] + : e; + } + var g = c(1)["default"]; + b.__esModule = !0; + var h = c(4), + i = c(6), + j = g(i), + k = c(5), + l = c(29), + m = g(l); + (e.prototype = { + nameLookup: function(a, b) { + return e.isValidJavaScriptVariableName(b) + ? [a, ".", b] + : [a, "[", JSON.stringify(b), "]"]; + }, + depthedLookup: function(a) { + return [ + this.aliasable("container.lookup"), + '(depths, "', + a, + '")' + ]; + }, + compilerInfo: function() { + var a = h.COMPILER_REVISION, + b = h.REVISION_CHANGES[a]; + return [a, b]; + }, + appendToBuffer: function(a, b, c) { + return ( + k.isArray(a) || (a = [a]), + (a = this.source.wrap(a, b)), + this.environment.isSimple + ? ["return ", a, ";"] + : c + ? ["buffer += ", a, ";"] + : ((a.appendToBuffer = !0), a) + ); + }, + initializeBuffer: function() { + return this.quotedString(""); + }, + compile: function(a, b, c, d) { + (this.environment = a), + (this.options = b), + (this.stringParams = this.options.stringParams), + (this.trackIds = this.options.trackIds), + (this.precompile = !d), + (this.name = this.environment.name), + (this.isChild = !!c), + (this.context = c || { + decorators: [], + programs: [], + environments: [] + }), + this.preamble(), + (this.stackSlot = 0), + (this.stackVars = []), + (this.aliases = {}), + (this.registers = { list: [] }), + (this.hashes = []), + (this.compileStack = []), + (this.inlineStack = []), + (this.blockParams = []), + this.compileChildren(a, b), + (this.useDepths = + this.useDepths || + a.useDepths || + a.useDecorators || + this.options.compat), + (this.useBlockParams = + this.useBlockParams || a.useBlockParams); + var e = a.opcodes, + f = void 0, + g = void 0, + h = void 0, + i = void 0; + for (h = 0, i = e.length; i > h; h++) + (f = e[h]), + (this.source.currentLocation = f.loc), + (g = g || f.loc), + this[f.opcode].apply(this, f.args); + if ( + ((this.source.currentLocation = g), + this.pushSource(""), + this.stackSlot || + this.inlineStack.length || + this.compileStack.length) + ) + throw new j["default"]( + "Compile completed with content left on stack" + ); + this.decorators.isEmpty() + ? (this.decorators = void 0) + : ((this.useDecorators = !0), + this.decorators.prepend( + "var decorators = container.decorators;\n" + ), + this.decorators.push("return fn;"), + d + ? (this.decorators = Function.apply(this, [ + "fn", + "props", + "container", + "depth0", + "data", + "blockParams", + "depths", + this.decorators.merge() + ])) + : (this.decorators.prepend( + "function(fn, props, container, depth0, data, blockParams, depths) {\n" + ), + this.decorators.push("}\n"), + (this.decorators = this.decorators.merge()))); + var k = this.createFunctionContext(d); + if (this.isChild) return k; + var l = { compiler: this.compilerInfo(), main: k }; + this.decorators && + ((l.main_d = this.decorators), (l.useDecorators = !0)); + var m = this.context, + n = m.programs, + o = m.decorators; + for (h = 0, i = n.length; i > h; h++) + n[h] && + ((l[h] = n[h]), + o[h] && + ((l[h + "_d"] = o[h]), (l.useDecorators = !0))); + return ( + this.environment.usePartial && (l.usePartial = !0), + this.options.data && (l.useData = !0), + this.useDepths && (l.useDepths = !0), + this.useBlockParams && (l.useBlockParams = !0), + this.options.compat && (l.compat = !0), + d + ? (l.compilerOptions = this.options) + : ((l.compiler = JSON.stringify(l.compiler)), + (this.source.currentLocation = { + start: { line: 1, column: 0 } + }), + (l = this.objectLiteral(l)), + b.srcName + ? ((l = l.toStringWithSourceMap({ + file: b.destName + })), + (l.map = l.map && l.map.toString())) + : (l = l.toString())), + l + ); + }, + preamble: function() { + (this.lastContext = 0), + (this.source = new m["default"](this.options.srcName)), + (this.decorators = new m["default"]( + this.options.srcName + )); + }, + createFunctionContext: function(a) { + var b = "", + c = this.stackVars.concat(this.registers.list); + c.length > 0 && (b += ", " + c.join(", ")); + var d = 0; + for (var e in this.aliases) { + var f = this.aliases[e]; + this.aliases.hasOwnProperty(e) && + f.children && + f.referenceCount > 1 && + ((b += ", alias" + ++d + "=" + e), + (f.children[0] = "alias" + d)); + } + var g = [ + "container", + "depth0", + "helpers", + "partials", + "data" + ]; + (this.useBlockParams || this.useDepths) && + g.push("blockParams"), + this.useDepths && g.push("depths"); + var h = this.mergeSource(b); + return a + ? (g.push(h), Function.apply(this, g)) + : this.source.wrap([ + "function(", + g.join(","), + ") {\n ", + h, + "}" + ]); + }, + mergeSource: function(a) { + var b = this.environment.isSimple, + c = !this.forceBuffer, + d = void 0, + e = void 0, + f = void 0, + g = void 0; + return ( + this.source.each(function(a) { + a.appendToBuffer + ? (f ? a.prepend(" + ") : (f = a), (g = a)) + : (f && + (e ? f.prepend("buffer += ") : (d = !0), + g.add(";"), + (f = g = void 0)), + (e = !0), + b || (c = !1)); + }), + c + ? f + ? (f.prepend("return "), g.add(";")) + : e || this.source.push('return "";') + : ((a += + ", buffer = " + + (d ? "" : this.initializeBuffer())), + f + ? (f.prepend("return buffer + "), g.add(";")) + : this.source.push("return buffer;")), + a && + this.source.prepend( + "var " + a.substring(2) + (d ? "" : ";\n") + ), + this.source.merge() + ); + }, + blockValue: function(a) { + var b = this.aliasable("helpers.blockHelperMissing"), + c = [this.contextName(0)]; + this.setupHelperArgs(a, 0, c); + var d = this.popStack(); + c.splice(1, 0, d), + this.push(this.source.functionCall(b, "call", c)); + }, + ambiguousBlockValue: function() { + var a = this.aliasable("helpers.blockHelperMissing"), + b = [this.contextName(0)]; + this.setupHelperArgs("", 0, b, !0), this.flushInline(); + var c = this.topStack(); + b.splice(1, 0, c), + this.pushSource([ + "if (!", + this.lastHelper, + ") { ", + c, + " = ", + this.source.functionCall(a, "call", b), + "}" + ]); + }, + appendContent: function(a) { + this.pendingContent + ? (a = this.pendingContent + a) + : (this.pendingLocation = this.source.currentLocation), + (this.pendingContent = a); + }, + append: function() { + if (this.isInline()) + this.replaceStack(function(a) { + return [" != null ? ", a, ' : ""']; + }), + this.pushSource( + this.appendToBuffer(this.popStack()) + ); + else { + var a = this.popStack(); + this.pushSource([ + "if (", + a, + " != null) { ", + this.appendToBuffer(a, void 0, !0), + " }" + ]), + this.environment.isSimple && + this.pushSource([ + "else { ", + this.appendToBuffer("''", void 0, !0), + " }" + ]); + } + }, + appendEscaped: function() { + this.pushSource( + this.appendToBuffer([ + this.aliasable("container.escapeExpression"), + "(", + this.popStack(), + ")" + ]) + ); + }, + getContext: function(a) { + this.lastContext = a; + }, + pushContext: function() { + this.pushStackLiteral(this.contextName(this.lastContext)); + }, + lookupOnContext: function(a, b, c, d) { + var e = 0; + d || !this.options.compat || this.lastContext + ? this.pushContext() + : this.push(this.depthedLookup(a[e++])), + this.resolvePath("context", a, e, b, c); + }, + lookupBlockParam: function(a, b) { + (this.useBlockParams = !0), + this.push(["blockParams[", a[0], "][", a[1], "]"]), + this.resolvePath("context", b, 1); + }, + lookupData: function(a, b, c) { + a + ? this.pushStackLiteral( + "container.data(data, " + a + ")" + ) + : this.pushStackLiteral("data"), + this.resolvePath("data", b, 0, !0, c); + }, + resolvePath: function(a, b, c, d, e) { + var g = this; + if (this.options.strict || this.options.assumeObjects) + return void this.push( + f(this.options.strict && e, this, b, a) + ); + for (var h = b.length; h > c; c++) + this.replaceStack(function(e) { + var f = g.nameLookup(e, b[c], a); + return d + ? [" && ", f] + : [" != null ? ", f, " : ", e]; + }); + }, + resolvePossibleLambda: function() { + this.push([ + this.aliasable("container.lambda"), + "(", + this.popStack(), + ", ", + this.contextName(0), + ")" + ]); + }, + pushStringParam: function(a, b) { + this.pushContext(), + this.pushString(b), + "SubExpression" !== b && + ("string" == typeof a + ? this.pushString(a) + : this.pushStackLiteral(a)); + }, + emptyHash: function(a) { + this.trackIds && this.push("{}"), + this.stringParams && (this.push("{}"), this.push("{}")), + this.pushStackLiteral(a ? "undefined" : "{}"); + }, + pushHash: function() { + this.hash && this.hashes.push(this.hash), + (this.hash = { + values: [], + types: [], + contexts: [], + ids: [] + }); + }, + popHash: function() { + var a = this.hash; + (this.hash = this.hashes.pop()), + this.trackIds && this.push(this.objectLiteral(a.ids)), + this.stringParams && + (this.push(this.objectLiteral(a.contexts)), + this.push(this.objectLiteral(a.types))), + this.push(this.objectLiteral(a.values)); + }, + pushString: function(a) { + this.pushStackLiteral(this.quotedString(a)); + }, + pushLiteral: function(a) { + this.pushStackLiteral(a); + }, + pushProgram: function(a) { + null != a + ? this.pushStackLiteral(this.programExpression(a)) + : this.pushStackLiteral(null); + }, + registerDecorator: function(a, b) { + var c = this.nameLookup("decorators", b, "decorator"), + d = this.setupHelperArgs(b, a); + this.decorators.push([ + "fn = ", + this.decorators.functionCall(c, "", [ + "fn", + "props", + "container", + d + ]), + " || fn;" + ]); + }, + invokeHelper: function(a, b, c) { + var d = this.popStack(), + e = this.setupHelper(a, b), + f = c ? [e.name, " || "] : "", + g = ["("].concat(f, d); + this.options.strict || + g.push(" || ", this.aliasable("helpers.helperMissing")), + g.push(")"), + this.push( + this.source.functionCall(g, "call", e.callParams) + ); + }, + invokeKnownHelper: function(a, b) { + var c = this.setupHelper(a, b); + this.push( + this.source.functionCall(c.name, "call", c.callParams) + ); + }, + invokeAmbiguous: function(a, b) { + this.useRegister("helper"); + var c = this.popStack(); + this.emptyHash(); + var d = this.setupHelper(0, a, b), + e = (this.lastHelper = this.nameLookup( + "helpers", + a, + "helper" + )), + f = ["(", "(helper = ", e, " || ", c, ")"]; + this.options.strict || + ((f[0] = "(helper = "), + f.push( + " != null ? helper : ", + this.aliasable("helpers.helperMissing") + )), + this.push([ + "(", + f, + d.paramsInit ? ["),(", d.paramsInit] : [], + "),", + "(typeof helper === ", + this.aliasable('"function"'), + " ? ", + this.source.functionCall( + "helper", + "call", + d.callParams + ), + " : helper))" + ]); + }, + invokePartial: function(a, b, c) { + var d = [], + e = this.setupParams(b, 1, d); + a && ((b = this.popStack()), delete e.name), + c && (e.indent = JSON.stringify(c)), + (e.helpers = "helpers"), + (e.partials = "partials"), + (e.decorators = "container.decorators"), + a + ? d.unshift(b) + : d.unshift( + this.nameLookup("partials", b, "partial") + ), + this.options.compat && (e.depths = "depths"), + (e = this.objectLiteral(e)), + d.push(e), + this.push( + this.source.functionCall( + "container.invokePartial", + "", + d + ) + ); + }, + assignToHash: function(a) { + var b = this.popStack(), + c = void 0, + d = void 0, + e = void 0; + this.trackIds && (e = this.popStack()), + this.stringParams && + ((d = this.popStack()), (c = this.popStack())); + var f = this.hash; + c && (f.contexts[a] = c), + d && (f.types[a] = d), + e && (f.ids[a] = e), + (f.values[a] = b); + }, + pushId: function(a, b, c) { + "BlockParam" === a + ? this.pushStackLiteral( + "blockParams[" + + b[0] + + "].path[" + + b[1] + + "]" + + (c ? " + " + JSON.stringify("." + c) : "") + ) + : "PathExpression" === a + ? this.pushString(b) + : "SubExpression" === a + ? this.pushStackLiteral("true") + : this.pushStackLiteral("null"); + }, + compiler: e, + compileChildren: function(a, b) { + for ( + var c = a.children, + d = void 0, + e = void 0, + f = 0, + g = c.length; + g > f; + f++ + ) { + (d = c[f]), (e = new this.compiler()); + var h = this.matchExistingProgram(d); + null == h + ? (this.context.programs.push(""), + (h = this.context.programs.length), + (d.index = h), + (d.name = "program" + h), + (this.context.programs[h] = e.compile( + d, + b, + this.context, + !this.precompile + )), + (this.context.decorators[h] = e.decorators), + (this.context.environments[h] = d), + (this.useDepths = this.useDepths || e.useDepths), + (this.useBlockParams = + this.useBlockParams || e.useBlockParams)) + : ((d.index = h), + (d.name = "program" + h), + (this.useDepths = this.useDepths || d.useDepths), + (this.useBlockParams = + this.useBlockParams || d.useBlockParams)); + } + }, + matchExistingProgram: function(a) { + for ( + var b = 0, c = this.context.environments.length; + c > b; + b++ + ) { + var d = this.context.environments[b]; + if (d && d.equals(a)) return b; + } + }, + programExpression: function(a) { + var b = this.environment.children[a], + c = [b.index, "data", b.blockParams]; + return ( + (this.useBlockParams || this.useDepths) && + c.push("blockParams"), + this.useDepths && c.push("depths"), + "container.program(" + c.join(", ") + ")" + ); + }, + useRegister: function(a) { + this.registers[a] || + ((this.registers[a] = !0), this.registers.list.push(a)); + }, + push: function(a) { + return ( + a instanceof d || (a = this.source.wrap(a)), + this.inlineStack.push(a), + a + ); + }, + pushStackLiteral: function(a) { + this.push(new d(a)); + }, + pushSource: function(a) { + this.pendingContent && + (this.source.push( + this.appendToBuffer( + this.source.quotedString(this.pendingContent), + this.pendingLocation + ) + ), + (this.pendingContent = void 0)), + a && this.source.push(a); + }, + replaceStack: function(a) { + var b = ["("], + c = void 0, + e = void 0, + f = void 0; + if (!this.isInline()) + throw new j["default"]("replaceStack on non-inline"); + var g = this.popStack(!0); + if (g instanceof d) + (c = [g.value]), (b = ["(", c]), (f = !0); + else { + e = !0; + var h = this.incrStack(); + (b = ["((", this.push(h), " = ", g, ")"]), + (c = this.topStack()); + } + var i = a.call(this, c); + f || this.popStack(), + e && this.stackSlot--, + this.push(b.concat(i, ")")); + }, + incrStack: function() { + return ( + this.stackSlot++, + this.stackSlot > this.stackVars.length && + this.stackVars.push("stack" + this.stackSlot), + this.topStackName() + ); + }, + topStackName: function() { + return "stack" + this.stackSlot; + }, + flushInline: function() { + var a = this.inlineStack; + this.inlineStack = []; + for (var b = 0, c = a.length; c > b; b++) { + var e = a[b]; + if (e instanceof d) this.compileStack.push(e); + else { + var f = this.incrStack(); + this.pushSource([f, " = ", e, ";"]), + this.compileStack.push(f); + } + } + }, + isInline: function() { + return this.inlineStack.length; + }, + popStack: function(a) { + var b = this.isInline(), + c = (b ? this.inlineStack : this.compileStack).pop(); + if (!a && c instanceof d) return c.value; + if (!b) { + if (!this.stackSlot) + throw new j["default"]("Invalid stack pop"); + this.stackSlot--; + } + return c; + }, + topStack: function() { + var a = this.isInline() + ? this.inlineStack + : this.compileStack, + b = a[a.length - 1]; + return b instanceof d ? b.value : b; + }, + contextName: function(a) { + return this.useDepths && a + ? "depths[" + a + "]" + : "depth" + a; + }, + quotedString: function(a) { + return this.source.quotedString(a); + }, + objectLiteral: function(a) { + return this.source.objectLiteral(a); + }, + aliasable: function(a) { + var b = this.aliases[a]; + return b + ? (b.referenceCount++, b) + : ((b = this.aliases[a] = this.source.wrap(a)), + (b.aliasable = !0), + (b.referenceCount = 1), + b); + }, + setupHelper: function(a, b, c) { + var d = [], + e = this.setupHelperArgs(b, a, d, c), + f = this.nameLookup("helpers", b, "helper"), + g = this.aliasable( + this.contextName(0) + + " != null ? " + + this.contextName(0) + + " : {}" + ); + return { + params: d, + paramsInit: e, + name: f, + callParams: [g].concat(d) + }; + }, + setupParams: function(a, b, c) { + var d = {}, + e = [], + f = [], + g = [], + h = !c, + i = void 0; + h && (c = []), + (d.name = this.quotedString(a)), + (d.hash = this.popStack()), + this.trackIds && (d.hashIds = this.popStack()), + this.stringParams && + ((d.hashTypes = this.popStack()), + (d.hashContexts = this.popStack())); + var j = this.popStack(), + k = this.popStack(); + (k || j) && + ((d.fn = k || "container.noop"), + (d.inverse = j || "container.noop")); + for (var l = b; l--; ) + (i = this.popStack()), + (c[l] = i), + this.trackIds && (g[l] = this.popStack()), + this.stringParams && + ((f[l] = this.popStack()), + (e[l] = this.popStack())); + return ( + h && (d.args = this.source.generateArray(c)), + this.trackIds && (d.ids = this.source.generateArray(g)), + this.stringParams && + ((d.types = this.source.generateArray(f)), + (d.contexts = this.source.generateArray(e))), + this.options.data && (d.data = "data"), + this.useBlockParams && (d.blockParams = "blockParams"), + d + ); + }, + setupHelperArgs: function(a, b, c, d) { + var e = this.setupParams(a, b, c); + return ( + (e = this.objectLiteral(e)), + d + ? (this.useRegister("options"), + c.push("options"), + ["options=", e]) + : c + ? (c.push(e), "") + : e + ); + } + }), + (function() { + for ( + var a = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split( + " " + ), + b = (e.RESERVED_WORDS = {}), + c = 0, + d = a.length; + d > c; + c++ + ) + b[a[c]] = !0; + })(), + (e.isValidJavaScriptVariableName = function(a) { + return ( + !e.RESERVED_WORDS[a] && + /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a) + ); + }), + (b["default"] = e), + (a.exports = b["default"]); + }, + function(a, b, c) { + "use strict"; + function d(a, b, c) { + if (f.isArray(a)) { + for (var d = [], e = 0, g = a.length; g > e; e++) + d.push(b.wrap(a[e], c)); + return d; + } + return "boolean" == typeof a || "number" == typeof a + ? a + "" + : a; + } + function e(a) { + (this.srcFile = a), (this.source = []); + } + b.__esModule = !0; + var f = c(5), + g = void 0; + try { + } catch (h) {} + g || + ((g = function(a, b, c, d) { + (this.src = ""), d && this.add(d); + }), + (g.prototype = { + add: function(a) { + f.isArray(a) && (a = a.join("")), (this.src += a); + }, + prepend: function(a) { + f.isArray(a) && (a = a.join("")), + (this.src = a + this.src); + }, + toStringWithSourceMap: function() { + return { code: this.toString() }; + }, + toString: function() { + return this.src; + } + })), + (e.prototype = { + isEmpty: function() { + return !this.source.length; + }, + prepend: function(a, b) { + this.source.unshift(this.wrap(a, b)); + }, + push: function(a, b) { + this.source.push(this.wrap(a, b)); + }, + merge: function() { + var a = this.empty(); + return ( + this.each(function(b) { + a.add([" ", b, "\n"]); + }), + a + ); + }, + each: function(a) { + for (var b = 0, c = this.source.length; c > b; b++) + a(this.source[b]); + }, + empty: function() { + var a = this.currentLocation || { start: {} }; + return new g( + a.start.line, + a.start.column, + this.srcFile + ); + }, + wrap: function(a) { + var b = + arguments.length <= 1 || void 0 === arguments[1] + ? this.currentLocation || { start: {} } + : arguments[1]; + return a instanceof g + ? a + : ((a = d(a, this, b)), + new g( + b.start.line, + b.start.column, + this.srcFile, + a + )); + }, + functionCall: function(a, b, c) { + return ( + (c = this.generateList(c)), + this.wrap([a, b ? "." + b + "(" : "(", c, ")"]) + ); + }, + quotedString: function(a) { + return ( + '"' + + (a + "") + .replace(/\\/g, "\\\\") + .replace(/"/g, '\\"') + .replace(/\n/g, "\\n") + .replace(/\r/g, "\\r") + .replace(/\u2028/g, "\\u2028") + .replace(/\u2029/g, "\\u2029") + + '"' + ); + }, + objectLiteral: function(a) { + var b = []; + for (var c in a) + if (a.hasOwnProperty(c)) { + var e = d(a[c], this); + "undefined" !== e && + b.push([this.quotedString(c), ":", e]); + } + var f = this.generateList(b); + return f.prepend("{"), f.add("}"), f; + }, + generateList: function(a) { + for ( + var b = this.empty(), c = 0, e = a.length; + e > c; + c++ + ) + c && b.add(","), b.add(d(a[c], this)); + return b; + }, + generateArray: function(a) { + var b = this.generateList(a); + return b.prepend("["), b.add("]"), b; + } + }), + (b["default"] = e), + (a.exports = b["default"]); + } + ]); +}); diff --git a/docs/api/vendor/jquery.min.js b/docs/api/vendor/jquery.min.js index 349030de..41c6cfc9 100644 --- a/docs/api/vendor/jquery.min.js +++ b/docs/api/vendor/jquery.min.js @@ -1,4 +1,5742 @@ /*! jQuery v2.2.1 | (c) jQuery Foundation | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c}catch(e){}O.set(a,b,c); -}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("