diff --git a/docs/api/api_data.js b/docs/api/api_data.js index 4cc31425..ab46549f 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1167,7 +1167,7 @@ define({ }, { "group": "body", - "type": "String", + "type": "String[]", "optional": false, "field": "major", "description": "

the major of the hacker

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

the major of the hacker

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

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

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

the user's invite token.

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

the user's invite token.

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

MongoId of an account

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

MongoId of an account

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

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

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

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

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

for confirming the account

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

for confirming the account

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

the email address of the account

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

the email address of the account

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

MongoId of an account

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

MongoId of an account

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

the password of the account

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

the password of the account

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

the token that was provided in the reset password email

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

the token that was provided in the reset password email

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

Check-in status. "Checked-in"

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

Check-in status. "Checked-in"

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

the major of the hacker

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

a hacker's unique mongoID

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

a hacker's unique mongoID

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

a hacker's unique email

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

a hacker's unique email

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

Hacker id

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

Hacker id

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

Success message

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

Success message

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

"Resume does not exist"

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

"Resume does not exist"

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

the major of the hacker

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

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

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

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

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

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

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

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

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

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

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

Hacker id

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

The uploaded file.

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

Hacker id

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

The uploaded file.

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

The hacker ID

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

The hacker ID

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

The hacker ID

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

The hacker ID

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

a sponsor's unique mongoID

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

a sponsor's unique mongoID

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

ObjectID of the sponsor

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

ObjectID of the sponsor

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

MongoId of the team

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

MongoId of the team

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

Name of the team to join

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

Name of the team to join

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

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

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

a hacker's unique Id

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

a hacker's unique Id

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

MongoID of the account of the volunteer

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

MongoID of the account of the volunteer

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

a volunteer's unique mongoID

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

a volunteer's unique mongoID

" + }] } }, "success": { "fields": { - "Success 200": [ - { + "Success 200": [{ "group": "Success 200", "type": "String", "optional": false, @@ -3441,18 +3045,15 @@ } ] }, - "examples": [ - { - "title": "Success-Response: ", - "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", - "type": "object" - } - ] + "examples": [{ + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + }] }, "error": { "fields": { - "Error 4xx": [ - { + "Error 4xx": [{ "group": "Error 4xx", "type": "String", "optional": false, @@ -3468,20 +3069,16 @@ } ] }, - "examples": [ - { - "title": "Error-Response: ", - "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", - "type": "object" - } - ] + "examples": [{ + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + }] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", - "sampleRequest": [ - { - "url": "https://api.mchacks.ca/api/volunteer/:id" - } - ] + "sampleRequest": [{ + "url": "https://api.mchacks.ca/api/volunteer/:id" + }] } -] +] \ No newline at end of file diff --git a/docs/api/api_project.js b/docs/api/api_project.js index 50871819..5875ef3e 100644 --- a/docs/api/api_project.js +++ b/docs/api/api_project.js @@ -9,7 +9,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-07T00:12:02.506Z", + "time": "2019-02-18T21:54:16.394Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/docs/api/api_project.json b/docs/api/api_project.json index 2ca1c771..befdcc87 100644 --- a/docs/api/api_project.json +++ b/docs/api/api_project.json @@ -9,7 +9,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2019-02-07T00:12:02.506Z", + "time": "2019-02-18T21:54:16.394Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/middlewares/validators/account.validator.js b/middlewares/validators/account.validator.js index 69ef5fb7..a1c86932 100644 --- a/middlewares/validators/account.validator.js +++ b/middlewares/validators/account.validator.js @@ -4,9 +4,9 @@ const Constants = require("../../constants/general.constant"); module.exports = { newAccountValidator: [ - VALIDATOR.asciiValidator("body", "firstName", false), - VALIDATOR.asciiValidator("body", "lastName", false), - VALIDATOR.asciiValidator("body", "pronoun", false), + VALIDATOR.stringValidator("body", "firstName", false), + VALIDATOR.stringValidator("body", "lastName", false), + VALIDATOR.stringValidator("body", "pronoun", false), VALIDATOR.regexValidator("body", "email", false, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", false), VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, false), @@ -16,9 +16,9 @@ module.exports = { VALIDATOR.phoneNumberValidator("body", "phoneNumber", false) ], updateAccountValidator: [ - VALIDATOR.asciiValidator("body", "firstName", true), - VALIDATOR.asciiValidator("body", "lastName", true), - VALIDATOR.asciiValidator("body", "pronoun", true), + VALIDATOR.stringValidator("body", "firstName", true), + VALIDATOR.stringValidator("body", "lastName", true), + VALIDATOR.stringValidator("body", "pronoun", true), VALIDATOR.regexValidator("body", "email", true, Constants.EMAIL_REGEX), VALIDATOR.alphaArrayValidator("body", "dietaryRestrictions", true), VALIDATOR.enumValidator("body", "shirtSize", Constants.SHIRT_SIZES, true), diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js index 0170fce6..6728a9f6 100644 --- a/middlewares/validators/hacker.validator.js +++ b/middlewares/validators/hacker.validator.js @@ -6,13 +6,13 @@ module.exports = { newHackerValidator: [ // status will be added automatically VALIDATOR.mongoIdValidator("body", "accountId", false), - VALIDATOR.asciiValidator("body", "school", false), - VALIDATOR.asciiValidator("body", "degree", false), - VALIDATOR.asciiValidator("body", "gender", false), + VALIDATOR.stringValidator("body", "school", false), + VALIDATOR.stringValidator("body", "degree", false), + VALIDATOR.stringValidator("body", "gender", false), VALIDATOR.booleanValidator("body", "needsBus", false), VALIDATOR.applicationValidator("body", "application", false), VALIDATOR.alphaArrayValidator("body", "ethnicity", false), - VALIDATOR.asciiValidator("body", "major", false), + VALIDATOR.alphaArrayValidator("body", "major", false), VALIDATOR.integerValidator("body", "graduationYear", false, 2019, 2030), VALIDATOR.booleanValidator("body", "codeOfConduct", false, true), VALIDATOR.mongoIdValidator("body", "teamId", true) @@ -23,13 +23,13 @@ module.exports = { ], updateHackerValidator: [ - VALIDATOR.asciiValidator("body", "school", true), - VALIDATOR.asciiValidator("body", "degree", true), - VALIDATOR.asciiValidator("body", "gender", true), + VALIDATOR.stringValidator("body", "school", true), + VALIDATOR.stringValidator("body", "degree", true), + VALIDATOR.stringValidator("body", "gender", true), VALIDATOR.booleanValidator("body", "needsBus", true), VALIDATOR.applicationValidator("body", "application", true), VALIDATOR.alphaArrayValidator("body", "ethnicity", true), - VALIDATOR.asciiValidator("body", "major", true), + VALIDATOR.alphaArrayValidator("body", "major", true), VALIDATOR.integerValidator("body", "graduationYear", true, 2019, 2030), ], updateStatusValidator: [ diff --git a/middlewares/validators/sponsor.validator.js b/middlewares/validators/sponsor.validator.js index 60deab29..f2f9d8f5 100644 --- a/middlewares/validators/sponsor.validator.js +++ b/middlewares/validators/sponsor.validator.js @@ -10,13 +10,13 @@ module.exports = { // assuming that the tiers are between 0 and 5 (inclusive) // 5 is the custom class VALIDATOR.integerValidator("body", "tier", false, 0, 5), - VALIDATOR.asciiValidator("body", "company", false), + VALIDATOR.stringValidator("body", "company", false), VALIDATOR.regexValidator("body", "contractURL", false, Constants.URL_REGEX), VALIDATOR.mongoIdArrayValidator("body", "nominees", true), ], updateSponsorValidator: [ - VALIDATOR.asciiValidator("body", "company", true), + VALIDATOR.stringValidator("body", "company", true), VALIDATOR.regexValidator("body", "contractURL", true, Constants.URL_REGEX), VALIDATOR.mongoIdArrayValidator("body", "nominees", true), ], diff --git a/middlewares/validators/team.validator.js b/middlewares/validators/team.validator.js index c064fe00..bd18949a 100644 --- a/middlewares/validators/team.validator.js +++ b/middlewares/validators/team.validator.js @@ -4,18 +4,18 @@ const Constants = require("../../constants/general.constant"); module.exports = { newTeamValidator: [ - VALIDATOR.asciiValidator("body", "name", false), + VALIDATOR.stringValidator("body", "name", false), VALIDATOR.regexValidator("body", "devpostURL", true, Constants.DEVPOST_REGEX), - VALIDATOR.asciiValidator("body", "projectName", true) + VALIDATOR.stringValidator("body", "projectName", true) ], joinTeamValidator: [ - VALIDATOR.asciiValidator("body", "name", false), + VALIDATOR.stringValidator("body", "name", false), ], patchTeamValidator: [ - VALIDATOR.asciiValidator("body", "name", true), + VALIDATOR.stringValidator("body", "name", true), VALIDATOR.regexValidator("body", "devpostURL", true, Constants.DEVPOST_REGEX), - VALIDATOR.asciiValidator("body", "projectName", true) + VALIDATOR.stringValidator("body", "projectName", true) ], }; \ No newline at end of file diff --git a/middlewares/validators/validator.helper.js b/middlewares/validators/validator.helper.js index 1ebcf272..3fff34b4 100644 --- a/middlewares/validators/validator.helper.js +++ b/middlewares/validators/validator.helper.js @@ -124,6 +124,23 @@ function asciiValidator(fieldLocation, fieldname, optional = true) { } } +/** + * Validates that field name is string only. + * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found + * @param {string} fieldname name of the field that needs to be validated. + * @param {boolean} optional whether the field is optional or not. + */ +function stringValidator(fieldLocation, fieldname, optional = true) { + const name = setProperValidationChainBuilder(fieldLocation, fieldname, "invalid string"); + if (optional) { + return name.optional({ + checkFalsy: true + }).isString().withMessage("must be a string"); + } else { + return name.exists().withMessage("name must exist").isString().withMessage("must be a string"); + } +} + /** * Validates the field against a regex * @param {"query" | "body" | "header" | "param"} fieldLocation the location where the field should be found @@ -614,4 +631,5 @@ module.exports = { dateValidator: dateValidator, enumValidator: enumValidator, routesValidator: routesValidator, + stringValidator: stringValidator }; \ No newline at end of file diff --git a/models/hacker.model.js b/models/hacker.model.js index d1536cf6..26316e6b 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -83,10 +83,10 @@ const HackerSchema = new mongoose.Schema({ }], required: true }, - major: { + major: [{ type: String, required: true - }, + }], graduationYear: { type: Number, required: true diff --git a/routes/api/hacker.js b/routes/api/hacker.js index 250a2c51..2ce81ad9 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -59,7 +59,7 @@ module.exports = { "school":"McPherson College", "gender":"Female", "needsBus":false, - "major":"Accounting", + "major":["Accounting"], "graduationYear":2019, "codeOfConduct":true, } @@ -89,7 +89,7 @@ module.exports = { * @apiParam (body) {String} gender Gender of the hacker * @apiParam (body) {Boolean} needsBus Whether the hacker requires a bus for transportation * @apiParam (body) {String[]} ethnicity the ethnicities of the hacker - * @apiParam (body) {String} major the major of the hacker + * @apiParam (body) {String[]} major the major of the hacker * @apiParam (body) {Number} graduationYear the graduation year of the hacker * @apiParam (body) {Boolean} codeOfConduct acceptance of the code of conduct * @apiParam (body) {Json} application The hacker's application. Resume and jobInterest fields are required. @@ -291,7 +291,7 @@ module.exports = { * @apiParam (body) {String} [gender] Gender of the hacker * @apiParam (body) {Boolean} [needsBus] Whether the hacker requires a bus for transportation * @apiParam (body) {String[]} [ethnicity] the ethnicities of the hacker - * @apiParam (body) {String} [major] the major of the hacker + * @apiParam (body) {String[]} [major] the major of the hacker * @apiParam (body) {Number} [graduationYear] the graduation year of the hacker * @apiParam (body) {Json} [application] The hacker's application * @apiParamExample {Json} application: diff --git a/tests/util/hacker.test.util.js b/tests/util/hacker.test.util.js index a23e62bf..a34c6565 100644 --- a/tests/util/hacker.test.util.js +++ b/tests/util/hacker.test.util.js @@ -32,7 +32,7 @@ const TeamHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Native American"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team1Id, @@ -60,7 +60,7 @@ const TeamHacker1 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -88,7 +88,7 @@ const TeamHacker2 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -116,7 +116,7 @@ const TeamHacker3 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -144,7 +144,7 @@ const TeamHacker4 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team3Id, @@ -172,7 +172,7 @@ const NoTeamHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -197,7 +197,7 @@ const newHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Caucasian"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -222,7 +222,7 @@ const newHacker1 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["African American"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -248,7 +248,7 @@ const invalidHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Caucasian"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": false, }; @@ -268,7 +268,7 @@ const invalidHacker1 = { "jobInterest": "ASDF", }, "ethnicity": ["Asian", "Caucasian"], - "major": "CS", + "major": ["CS"], "graduationYear": 2020, "codeOfConduct": true, }; @@ -295,7 +295,7 @@ const duplicateAccountLinkHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["Caucasian"], - "major": "CS", + "major": ["CS"], "graduationYear": 2019, "codeOfConduct": true, }; @@ -322,7 +322,7 @@ const waitlistedHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, "teamId": Constants.MongoId.team2Id, @@ -350,7 +350,7 @@ const unconfirmedAccountHacker0 = { "skills": ["CSS", "HTML", "JS"], }, "ethnicity": ["European"], - "major": "EE", + "major": ["EE"], "graduationYear": 2019, "codeOfConduct": true, };