From 8b71f91d9a8cc006ee64a798255bbfeefd9aebd6 Mon Sep 17 00:00:00 2001 From: Maneth Date: Thu, 5 Dec 2019 23:56:36 -0500 Subject: [PATCH 01/12] Accept Hacker route created --- middlewares/hacker.middleware.js | 14 ++++++++++++++ routes/api/hacker.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index bda780e9..59a61dd9 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -492,6 +492,19 @@ async function updateHacker(req, res, next) { } } +/** + * Sets Hacker Status to Accepted and runs it through updateHacker's functionality. + * @param {{params:{id: string}, body: *}} req + * @param {*} res + * @param {*} next + */ +async function acceptHacker(req, res, next) { + req.body.status = Constants.General.HACKER_STATUS_ACCEPTED; + updateHacker(req, res, next); + +} + + /** * @function createhacker * @param {{body: {hackerDetails: object}}} req @@ -602,6 +615,7 @@ module.exports = { sendStatusUpdateEmail: Middleware.Util.asyncMiddleware(sendStatusUpdateEmail), sendAppliedStatusEmail: Middleware.Util.asyncMiddleware(sendAppliedStatusEmail), updateHacker: Middleware.Util.asyncMiddleware(updateHacker), + acceptHacker: Middleware.Util.asyncMiddleware(acceptHacker), validateConfirmedStatusFromAccountId: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromAccountId), validateConfirmedStatusFromHackerId: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromHackerId), validateConfirmedStatusFromObject: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromObject), diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 154e3c03..95275408 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -248,6 +248,35 @@ module.exports = { Controllers.Hacker.updatedHacker ); + /** + * @api {patch} /hacker/accept/:id accept a Hacker + * @apiName acceptHacker + * @apiGroup Hacker + * @apiVersion 0.0.9 + * + * @apiParam (body) {ObjectId} Hacker Id + * @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("/accept/:id").patch( + Middleware.Validator.RouteParam.idValidator, + Middleware.Auth.ensureAuthenticated(), + Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), + Middleware.Hacker.validateConfirmedStatusFromHackerId, + Middleware.Hacker.acceptHacker, + 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 From e863783aacafa90f58ee7434634a147733fe2098 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 10:28:23 -0500 Subject: [PATCH 02/12] Adding route to route.constant.js --- constants/routes.constant.js | 4 ++++ middlewares/hacker.middleware.js | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/constants/routes.constant.js b/constants/routes.constant.js index d5bd5a91..75778e3a 100644 --- a/constants/routes.constant.js +++ b/constants/routes.constant.js @@ -124,6 +124,10 @@ const hackerRoutes = { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/hacker/confirmation/" + Constants.ROLE_CATEGORIES.SELF, }, + "patchAcceptHackerById": { + requestType: Constants.REQUEST_TYPES.PATCH, + uri: "/api/hacker/accept/" + Constants.ROLE_CATEGORIES.ALL, + }, "postAnySendWeekOfEmail": { requestType: Constants.REQUEST_TYPES.POST, uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.ALL, diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 59a61dd9..ba24f355 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -501,7 +501,6 @@ async function updateHacker(req, res, next) { async function acceptHacker(req, res, next) { req.body.status = Constants.General.HACKER_STATUS_ACCEPTED; updateHacker(req, res, next); - } From 84d7399681d1195f0d9c95cbe482c8cc507b196d Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 13:39:13 -0500 Subject: [PATCH 03/12] Formatting done for middleware --- middlewares/hacker.middleware.js | 6 +++--- routes/api/hacker.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index ba24f355..7240dd1c 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -498,9 +498,9 @@ async function updateHacker(req, res, next) { * @param {*} res * @param {*} next */ -async function acceptHacker(req, res, next) { +function parseAccept(req, res, next) { req.body.status = Constants.General.HACKER_STATUS_ACCEPTED; - updateHacker(req, res, next); + next(); } @@ -614,7 +614,7 @@ module.exports = { sendStatusUpdateEmail: Middleware.Util.asyncMiddleware(sendStatusUpdateEmail), sendAppliedStatusEmail: Middleware.Util.asyncMiddleware(sendAppliedStatusEmail), updateHacker: Middleware.Util.asyncMiddleware(updateHacker), - acceptHacker: Middleware.Util.asyncMiddleware(acceptHacker), + parseAccept: parseAccept, validateConfirmedStatusFromAccountId: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromAccountId), validateConfirmedStatusFromHackerId: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromHackerId), validateConfirmedStatusFromObject: Middleware.Util.asyncMiddleware(validateConfirmedStatusFromObject), diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 95275408..01c6c3bc 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -271,7 +271,8 @@ module.exports = { Middleware.Auth.ensureAuthenticated(), Middleware.Auth.ensureAuthorized([Services.Hacker.findById]), Middleware.Hacker.validateConfirmedStatusFromHackerId, - Middleware.Hacker.acceptHacker, + Middleware.Hacker.parseAccept, + Middleware.Hacker.updateHacker, Middleware.Hacker.sendStatusUpdateEmail, Controllers.Hacker.updatedHacker ); From 33604bc810cb45408bd412609b1c31c65bc829b7 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 14:54:18 -0500 Subject: [PATCH 04/12] Tests written for hacker/accept --- tests/hacker.test.js | 67 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tests/hacker.test.js b/tests/hacker.test.js index a023126a..7187e8b0 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -500,6 +500,73 @@ describe("PATCH update one hacker", function () { }); }); + it("should FAIL to accept a hacker on /api/hacker/:id GET due to authentication", function (done) { + chai.request(server.app) + .patch(`/api/hacker/accept/${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 FAIL due to authorization + it("should Fail to accept 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/accept/${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(); + }); + }); + }); + + it("should SUCCEED and accept 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/accept/${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(); + }); + }); + }); + // should succeed on admin case it("should SUCCEED and update a hacker using admin power", function (done) { util.auth.login(agent, Admin0, (error) => { From 7de7f5edad239f9983fdc9ad709cd113f6e46e83 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 15:55:31 -0500 Subject: [PATCH 05/12] Added more tests --- middlewares/hacker.middleware.js | 2 +- tests/hacker.test.js | 33 +++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 7240dd1c..8b1817b1 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -493,7 +493,7 @@ async function updateHacker(req, res, next) { } /** - * Sets Hacker Status to Accepted and runs it through updateHacker's functionality. + * Sets req.body.status to Accepted for next middleware. * @param {{params:{id: string}, body: *}} req * @param {*} res * @param {*} next diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 7187e8b0..bec9e807 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -504,9 +504,7 @@ describe("PATCH update one hacker", function () { chai.request(server.app) .patch(`/api/hacker/accept/${TeamHacker0._id}`) .type("application/json") - .send({ - gender: "Other" - }) + .send() .end(function (err, res) { res.should.have.status(401); res.should.be.json; @@ -517,7 +515,7 @@ describe("PATCH update one hacker", function () { }); // should FAIL due to authorization - it("should Fail to accept hacker info due to lack of authorization", function (done) { + it("should FAIL to accept hacker info due to lack of authorization", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { if (error) { agent.close(); @@ -526,9 +524,7 @@ describe("PATCH update one hacker", function () { return agent .patch(`/api/hacker/accept/${TeamHacker0._id}`) .type("application/json") - .send({ - gender: "Other" - }) + .send() .end(function (err, res) { res.should.have.status(403); res.should.be.json; @@ -541,6 +537,29 @@ describe("PATCH update one hacker", function () { }); }); + it("should FAIL to accept an invalid hacker's info", function (done) { + util.auth.login(agent, Admin0, (error) => { + if (error) { + agent.close(); + return done(error); + } + return agent + .patch(`/api/hacker/accept/${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(); + }); + }); + }); + it("should SUCCEED and accept a hacker STATUS as an Admin", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { From 8761d19a072a1f06a4e30417ba2d6810281268d8 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 16:14:32 -0500 Subject: [PATCH 06/12] Edited tests --- tests/hacker.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/hacker.test.js b/tests/hacker.test.js index f6becc5d..08d65f27 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -555,7 +555,7 @@ describe("PATCH update one hacker", function() { }); }); - it("should FAIL to accept a hacker on /api/hacker/:id GET due to authentication", function (done) { + it("should FAIL to accept a hacker on /api/hacker/accept/:id GET due to authentication", function (done) { chai.request(server.app) .patch(`/api/hacker/accept/${TeamHacker0._id}`) .type("application/json") @@ -570,7 +570,7 @@ describe("PATCH update one hacker", function() { }); // should FAIL due to authorization - it("should FAIL to accept hacker info due to lack of authorization", function (done) { + it("should FAIL to accept hacker info due to lack of authorization on /api/hacker/accept/:id", function (done) { util.auth.login(agent, noTeamHackerAccount0, (error) => { if (error) { agent.close(); @@ -592,7 +592,7 @@ describe("PATCH update one hacker", function() { }); }); - it("should FAIL to accept an invalid hacker's info", function (done) { + it("should FAIL to accept an invalid hacker's info on /api/hacker/accept/:id", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); @@ -615,7 +615,7 @@ describe("PATCH update one hacker", function() { }); }); - it("should SUCCEED and accept a hacker STATUS as an Admin", function (done) { + it("should SUCCEED and accept a hacker on /api/hacker/accept/:id as an Admin", function (done) { util.auth.login(agent, Admin0, (error) => { if (error) { agent.close(); From 21b999aadd2e82c2051e5664a79258fa3f57dcb2 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 16:25:20 -0500 Subject: [PATCH 07/12] Improvements --- routes/api/hacker.js | 1 - tests/hacker.test.js | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 4940086a..59d8b25f 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -256,7 +256,6 @@ module.exports = { * @apiGroup Hacker * @apiVersion 0.0.9 * - * @apiParam (body) {ObjectId} Hacker Id * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object * @apiSuccessExample {object} Success-Response: diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 08d65f27..8218fce1 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -555,7 +555,7 @@ describe("PATCH update one hacker", function() { }); }); - it("should FAIL to accept a hacker on /api/hacker/accept/:id GET due to authentication", function (done) { + it("should FAIL to accept a hacker on /api/hacker/accept/:id due to authentication", function (done) { chai.request(server.app) .patch(`/api/hacker/accept/${TeamHacker0._id}`) .type("application/json") @@ -624,9 +624,7 @@ describe("PATCH update one hacker", function() { return agent .patch(`/api/hacker/accept/${TeamHacker0._id}`) .type("application/json") - .send({ - status: "Accepted" - }) + .send() .end(function (err, res) { res.should.have.status(200); res.should.be.json; From 26b585156a994ec3500d3ba82610a69f0f25768b Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 16:38:22 -0500 Subject: [PATCH 08/12] Improving invalid hacker test for accept --- tests/hacker.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 8218fce1..26ac9210 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -600,6 +600,8 @@ describe("PATCH update one hacker", function() { } return agent .patch(`/api/hacker/accept/${invalidHacker1._id}`) + .type("application/json") + .send() .end(function (err, res) { if (err) { return done(err); From 807e79e1365b2fc2e92033510fa67b6e18e2cd36 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 23:04:56 -0500 Subject: [PATCH 09/12] Edited Middleware --- middlewares/hacker.middleware.js | 7 +++++++ tests/hacker.test.js | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/middlewares/hacker.middleware.js b/middlewares/hacker.middleware.js index 59e999b4..0c3cbc54 100644 --- a/middlewares/hacker.middleware.js +++ b/middlewares/hacker.middleware.js @@ -175,6 +175,13 @@ async function validateConfirmedStatusFromAccountId(req, res, next) { */ async function validateConfirmedStatusFromHackerId(req, res, next) { const hacker = await Services.Hacker.findById(req.params.id); + if (hacker == null) { + return next({ + status: 404, + message: Constants.Error.HACKER_404_MESSAGE, + data: req.body.hackerId + }); + } const account = await Services.Account.findById(hacker.accountId); return validateConfirmedStatus(account, next); } diff --git a/tests/hacker.test.js b/tests/hacker.test.js index 26ac9210..e7ad8626 100644 --- a/tests/hacker.test.js +++ b/tests/hacker.test.js @@ -603,9 +603,6 @@ describe("PATCH update one hacker", function() { .type("application/json") .send() .end(function (err, res) { - if (err) { - return done(err); - } res.should.have.status(404); res.should.be.json; res.body.should.have.property("message"); From 7a04dab0174ea612d74caa8cf69ac776d80935a3 Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 23:05:22 -0500 Subject: [PATCH 10/12] Edited constants file(routes) --- constants/routes.constant.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constants/routes.constant.js b/constants/routes.constant.js index 24975d03..e22e1d28 100644 --- a/constants/routes.constant.js +++ b/constants/routes.constant.js @@ -124,7 +124,7 @@ const hackerRoutes = { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/hacker/confirmation/" + Constants.ROLE_CATEGORIES.SELF }, - "patchAcceptHackerById": { + patchAcceptHackerById: { requestType: Constants.REQUEST_TYPES.PATCH, uri: "/api/hacker/accept/" + Constants.ROLE_CATEGORIES.ALL, }, From d4264c5a228adcab1546e17bfbc15cf0f8e2db2d Mon Sep 17 00:00:00 2001 From: Maneth Date: Sun, 8 Dec 2019 23:24:36 -0500 Subject: [PATCH 11/12] Documentation additions --- docs/api/api_data.js | 7291 ++++++++++++++++++++-------------------- docs/api/api_data.json | 7143 ++++++++++++++++++++------------------- 2 files changed, 7264 insertions(+), 7170 deletions(-) diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 99713c1d..b88c32e5 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1,3622 +1,3669 @@ -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 +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/accept/:id", + title: "accept a Hacker", + name: "acceptHacker", + group: "Hacker", + version: "0.0.9", + 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/accept/: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_data.json b/docs/api/api_data.json index a5d31843..a88593fc 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1,3548 +1,3595 @@ -[ - { - "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": "gender", - "description": "

Gender of the account creator.

" - }, - { - "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 \"gender\":\"Male\",\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\"gender\":\"Male\",\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 \"gender\":\"Male\",\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\"gender\":\"Male\",\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": "gender", - "description": "

Gender of the account creator.

" - }, - { - "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": "{ \"gender\": \"Male\" }", - "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 update 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" - } - ] - }, - "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/: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", - "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/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"|"Accepted"|"Declined"|"Waitlisted"|"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/dayOf/:id", - "title": "", - "description": "

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.

", - "name": "postHackerSendDayOfEmail", - "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 day-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/dayOf/: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 either confirmed, 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" - } - ] - } -] +[ + { + "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": "gender", + "description": "

Gender of the account creator.

" + }, + { + "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 \"gender\":\"Male\",\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\"gender\":\"Male\",\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 \"gender\":\"Male\",\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\"gender\":\"Male\",\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": "gender", + "description": "

Gender of the account creator.

" + }, + { + "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": "{ \"gender\": \"Male\" }", + "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 update 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" + } + ] + }, + "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": "patch", + "url": "/hacker/accept/:id", + "title": "accept a Hacker", + "name": "acceptHacker", + "group": "Hacker", + "version": "0.0.9", + "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/accept/:id" + } + ] + }, + { + "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/: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", + "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/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"|"Accepted"|"Declined"|"Waitlisted"|"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/dayOf/:id", + "title": "", + "description": "

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.

", + "name": "postHackerSendDayOfEmail", + "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 day-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/dayOf/: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 either confirmed, 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" + } + ] + } +] From bd028a4b21cc507eae0b8bffe1975242a4ae3371 Mon Sep 17 00:00:00 2001 From: ManethKulatunge <43322057+ManethKulatunge@users.noreply.github.com> Date: Sun, 8 Dec 2019 23:59:35 -0500 Subject: [PATCH 12/12] Update routes/api/hacker.js Co-Authored-By: Loreina Chew --- routes/api/hacker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 59d8b25f..23a4b6d0 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -254,7 +254,7 @@ module.exports = { * @api {patch} /hacker/accept/:id accept a Hacker * @apiName acceptHacker * @apiGroup Hacker - * @apiVersion 0.0.9 + * @apiVersion 2.0.0 * * @apiSuccess {string} message Success message * @apiSuccess {object} data Hacker object