diff --git a/doc/scholee_api_doc.pdf b/doc/scholee_api_doc.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5368f4af619aee4ebe12355a15c65ac1e475e3c6 Binary files /dev/null and b/doc/scholee_api_doc.pdf differ diff --git a/package.json b/package.json index f3cc10c289d1e617b988a4428e210c76f47994b6..f673f04c588701a4b03e942adcbc0dbca28cb3a7 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,8 @@ "@types/js-cookie": "^3.0.5", "@types/jsonwebtoken": "^9.0.4", "@types/multer": "^1.4.10", + "@types/swagger-jsdoc": "^6.0.3", + "@types/swagger-ui-express": "^4.1.6", "@types/xml2js": "^0.4.13", "bcrypt": "^5.1.1", "cookie-parser": "^1.4.6", @@ -47,6 +49,8 @@ "mysql2": "^3.6.2", "nodemon": "^3.0.1", "redis": "^4.6.10", + "swagger-jsdoc": "^6.2.8", + "swagger-ui-express": "^5.0.0", "util": "^0.12.5", "xml2js": "^0.6.2" } diff --git a/routes/assignment.routes.ts b/routes/assignment.routes.ts index a3215323fbf39fa21a54cd6a2a465268c22811c0..864607c53e0c2ab809402e14870ae8d619417b6e 100644 --- a/routes/assignment.routes.ts +++ b/routes/assignment.routes.ts @@ -1,14 +1,153 @@ -import express from "express" +import express from "express"; import { createAssignment, updateAssignment, - deleteAssignment -} from "../controllers/assignment.controller" + deleteAssignment, +} from "../controllers/assignment.controller"; -const router = express.Router() +const router = express.Router(); -router.post("/assignment", createAssignment) -router.patch("/assignment/:sid/:aid", updateAssignment) -router.delete("/assignment/:sid/:aid", deleteAssignment) +/** + * @swagger + * tags: + * name: Assignments + * description: API endpoints for assignments + */ -module.exports = router +/** + * @swagger + * /api/assignment: + * post: + * summary: Create a new assignment + * tags: [Assignments] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * scholarship_id: + * type: string + * name: + * type: string + * desc: + * type: string + * responses: + * 200: + * description: Assignment created successfully + * content: + * application/json: + * example: + * status: success + * message: Assignment created successfully + * data: + * assignment_id: 1 + * organization_id: 123 + * assignment_name: Example Assignment + * assignment_description: Assignment description + * scholarship_id: 456 + * 400: + * description: Bad request or missing parameters + * content: + * application/json: + * example: + * status: error + * message: Some error message + */ +router.post("/assignment", createAssignment); + +/** + * @swagger + * /api/assignment/{sid}/{aid}: + * patch: + * summary: Update an assignment + * tags: [Assignments] + * parameters: + * - in: path + * name: sid + * required: true + * description: Scholarship ID + * schema: + * type: string + * - in: path + * name: aid + * required: true + * description: Assignment ID + * schema: + * type: string + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * name: + * type: string + * desc: + * type: string + * responses: + * 200: + * description: Assignment updated successfully + * content: + * application/json: + * example: + * status: success + * message: Assignment updated successfully + * data: + * assignment_id: 1 + * organization_id: 123 + * assignment_name: Updated Assignment + * assignment_description: Updated Assignment description + * scholarship_id: 456 + * 400: + * description: Bad request or missing parameters + * content: + * application/json: + * example: + * status: error + * message: Some error message + */ +router.patch("/assignment/:sid/:aid", updateAssignment); + +/** + * @swagger + * /api/assignment/{sid}/{aid}: + * delete: + * summary: Delete an assignment + * tags: [Assignments] + * parameters: + * - in: path + * name: sid + * required: true + * description: Scholarship ID + * schema: + * type: string + * - in: path + * name: aid + * required: true + * description: Assignment ID + * schema: + * type: string + * responses: + * 200: + * description: Assignment deleted successfully + * content: + * application/json: + * example: + * status: success + * message: Assignment deleted successfully + * 400: + * description: Bad request or missing parameters + * content: + * application/json: + * example: + * status: error + * message: Some error message + */ +router.delete("/assignment/:sid/:aid", deleteAssignment); + + + +module.exports = router; \ No newline at end of file diff --git a/routes/assignmentPublic.routes.ts b/routes/assignmentPublic.routes.ts index ffa2868252d81bea1d528d049bc4caaa158fab36..5dfa52287c3693208d9f7dac93b2f994c9ca2248 100644 --- a/routes/assignmentPublic.routes.ts +++ b/routes/assignmentPublic.routes.ts @@ -6,7 +6,91 @@ import express from "express" const router = express.Router() -router.get("/assignment/:sid", getAssignmentBySid) -router.get("/assignment/:sid/:aid", getAssignment) +/** + * @swagger + * /api/assignment/{sid}/{aid}: + * get: + * summary: Get assignment details + * tags: [Assignments] + * parameters: + * - in: path + * name: sid + * required: true + * description: Scholarship ID + * schema: + * type: string + * - in: path + * name: aid + * required: true + * description: Assignment ID + * schema: + * type: string + * responses: + * 200: + * description: Assignment details retrieved successfully + * content: + * application/json: + * example: + * status: success + * message: Assignment retrieved successfully + * data: + * assignments: + * - assignment_id: 1 + * scholarship_id: 123 + * assignment_name: Example Assignment + * assignment_description: Assignment description + * scholarship_name: Example Scholarship + * 400: + * description: Bad request or missing parameters + * content: + * application/json: + * example: + * status: error + * message: Some error message + */ +router.get("/assignment/:sid/:aid", getAssignment); + +/** + * @swagger + * /api/assignment/{sid}: + * get: + * summary: Get assignments by scholarship ID + * tags: [Assignments] + * parameters: + * - in: path + * name: sid + * required: true + * description: Scholarship ID + * schema: + * type: string + * responses: + * 200: + * description: Assignments retrieved successfully + * content: + * application/json: + * example: + * status: success + * message: Assignments retrieved successfully + * data: + * assignments: + * - assignment_id: 1 + * scholarship_id: 123 + * assignment_name: Example Assignment + * assignment_description: Assignment description + * scholarship_name: Example Scholarship + * - assignment_id: 2 + * scholarship_id: 123 + * assignment_name: Another Assignment + * assignment_description: Another Assignment description + * scholarship_name: Example Scholarship + * 400: + * description: Bad request or missing parameters + * content: + * application/json: + * example: + * status: error + * message: Some error message + */ +router.get("/assignment/:sid", getAssignmentBySid); module.exports = router diff --git a/routes/auth.routes.ts b/routes/auth.routes.ts index 11b813091b021cfbb5b1440cb7f4d64760310529..0917d7a8b1aa3f264d89014f6aea06b540ab6ed7 100644 --- a/routes/auth.routes.ts +++ b/routes/auth.routes.ts @@ -1,15 +1,94 @@ -import express from "express" +/** + * @swagger + * tags: + * name: Authentication + * description: User authentication operations + */ + +import express from 'express'; import { handleLogin, handleLogout, handleRefreshToken, - handleGetInfo -} from "../controllers/auth.controller" + handleGetInfo, +} from '../controllers/auth.controller'; + +const router = express.Router(); + +/** + * @swagger + * /login: + * post: + * summary: Log in and obtain access and refresh tokens + * tags: [Authentication] + * requestBody: + * description: User credentials for login + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * email: + * type: string + * password: + * type: string + * responses: + * '200': + * description: Successful login + * '401': + * description: Invalid credentials + * '500': + * description: Internal server error + */ +router.post('/login', handleLogin); + +/** + * @swagger + * /logout: + * post: + * summary: Log out and invalidate refresh token + * tags: [Authentication] + * responses: + * '204': + * description: Successful logout + * '500': + * description: Internal server error + */ +router.post('/logout', handleLogout); + +/** + * @swagger + * /refresh: + * get: + * summary: Refresh access token using a valid refresh token + * tags: [Authentication] + * responses: + * '200': + * description: Access token refreshed successfully + * '401': + * description: Invalid or expired refresh token + * '500': + * description: Internal server error + */ +router.get('/refresh', handleRefreshToken); -const router = express.Router() +/** + * @swagger + * /info: + * get: + * summary: Get user information from the access token + * tags: [Authentication] + * responses: + * '200': + * description: User information retrieved successfully + * '401': + * description: Invalid or expired access token + * '403': + * description: Invalid token or user not authorized + * '500': + * description: Internal server error + */ +router.get('/info', handleGetInfo); -router.post("/login", handleLogin) -router.post("/logout", handleLogout) -router.get("/refresh", handleRefreshToken) -router.get("/info", handleGetInfo) module.exports = router diff --git a/routes/files.routes.ts b/routes/files.routes.ts index d01f1c757fc7e5527d68514973bd71e10c60b023..b54629addceab287ca2548bf03dcf7a094bf6c22 100644 --- a/routes/files.routes.ts +++ b/routes/files.routes.ts @@ -1,12 +1,111 @@ +/** + * @swagger + * tags: + * name: Files + * description: Operations related to files + */ import express from "express" import { getAllFiles, getFileById } from "../controllers/files.controller" const router = express.Router() -router.get( - "/files/scholarship/:sid/assignment/:aid/file/:fid/user/:uid", - getFileById -) -router.get("/files/scholarship/:sid/assignment/:aid", getAllFiles) +/** + * @swagger + * /files/scholarship/{sid}/assignment/{aid}/file/{fid}/user/{uid}: + * get: + * summary: Get a specific file by ID + * tags: [Files] + * parameters: + * - in: path + * name: sid + * schema: + * type: integer + * required: true + * description: Scholarship ID + * - in: path + * name: aid + * schema: + * type: integer + * required: true + * description: Assignment ID + * - in: path + * name: fid + * schema: + * type: integer + * required: true + * description: File ID + * - in: path + * name: uid + * schema: + * type: integer + * required: true + * description: User ID + * responses: + * '200': + * description: File retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * file_id: + * type: integer + * file_path: + * type: string + */ +router.get('/files/scholarship/:sid/assignment/:aid/file/:fid/user/:uid', getFileById); + +/** + * @swagger + * /files/scholarship/{sid}/assignment/{aid}: + * get: + * summary: Get all files for a specific assignment + * tags: [Files] + * parameters: + * - in: path + * name: sid + * schema: + * type: integer + * required: true + * description: Scholarship ID + * - in: path + * name: aid + * schema: + * type: integer + * required: true + * description: Assignment ID + * responses: + * '200': + * description: Files retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * files: + * type: array + * items: + * type: object + * properties: + * file_id: + * type: integer + * file_path: + * type: string + */ +router.get('/files/scholarship/:sid/assignment/:aid', getAllFiles); module.exports = router diff --git a/routes/filesPublic.routes.ts b/routes/filesPublic.routes.ts index 1c8267648e6b6e36dc26b845c0c776a2f7a4d508..908965bc431231945bb7fa739752f261ea8e8dae 100644 --- a/routes/filesPublic.routes.ts +++ b/routes/filesPublic.routes.ts @@ -1,3 +1,9 @@ +/** + * @swagger + * tags: + * name: Files + * description: Operations related to files + */ import express from "express" import { uploadFiles, uploadFile } from "../controllers/files.controller" @@ -6,21 +12,71 @@ import multer from "multer" const router = express.Router() const upload = multer() -router.post( - "/files/scholarship/:sid/assignment/:aid", - upload.any(), - async (req: any, res: any) => { - try { - const { files } = req - const fileUrls = await Promise.all( - files.map(async (file: any) => uploadFile(file)) - ) - console.log("links", fileUrls) - await uploadFiles(req, res) - } catch (error: any) { - res.status(500).send(error.message) - } +/** + * @swagger + * /files/scholarship/{sid}/assignment/{aid}: + * post: + * summary: Upload files for a specific assignment + * tags: [Files] + * parameters: + * - in: path + * name: sid + * schema: + * type: integer + * required: true + * description: Scholarship ID + * - in: path + * name: aid + * schema: + * type: integer + * required: true + * description: Assignment ID + * requestBody: + * required: true + * content: + * multipart/form-data: + * schema: + * type: object + * properties: + * files: + * type: array + * items: + * type: string + * format: binary + * uid: + * type: integer + * description: User ID + * responses: + * '200': + * description: Files uploaded successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * files: + * type: array + * items: + * type: object + * properties: + * file_id: + * type: integer + * file_path: + * type: string + */ +router.post('/files/scholarship/:sid/assignment/:aid', upload.any(), async (req: any, res: any) => { + try { + const { files } = req; + const fileUrls = await Promise.all(files.map(async (file: any) => uploadFile(file))); + console.log('links', fileUrls); + await uploadFiles(req, res); + } catch (error: any) { + res.status(500).send(error.message); } -) +}); module.exports = router diff --git a/routes/organization.routes.ts b/routes/organization.routes.ts index 628fce3944eb6a9321bf68d7f910b96ac8ca66cf..edf1d03d91b07e14f9a1e182c988a15b4ede16ec 100644 --- a/routes/organization.routes.ts +++ b/routes/organization.routes.ts @@ -1,3 +1,9 @@ +/** + * @swagger + * tags: + * name: Organizations + * description: Operations related to organizations + */ import express from "express" import { getOrganizations, @@ -9,10 +15,231 @@ import { const router = express.Router() -router.get("/organization", getOrganizations) -router.get("/organization/:id", getOrganization) -router.post("/organization", createOrganization) -router.patch("/organization/:id", updateOrganization) -router.delete("/organization/:id", deleteOrganization) +/** + * @swagger + * /organization: + * get: + * summary: Get all organizations + * tags: [Organizations] + * responses: + * '200': + * description: Organizations retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: array + * items: + * type: object + * properties: + * organization_id: + * type: integer + * organization_name: + * type: string + * organization_email: + * type: string + * organization_address: + * type: string + * organization_description: + * type: string + */ +router.get('/organization', getOrganizations); + +/** + * @swagger + * /organization/{id}: + * get: + * summary: Get a specific organization by ID + * tags: [Organizations] + * parameters: + * - in: path + * name: id + * schema: + * type: integer + * required: true + * description: Organization ID + * responses: + * '200': + * description: Organization retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * organization_name: + * type: string + * organization_email: + * type: string + * organization_address: + * type: string + * organization_description: + * type: string + */ +router.get('/organization/:id', getOrganization); + +/** + * @swagger + * /organization: + * post: + * summary: Create a new organization + * tags: [Organizations] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * name: + * type: string + * email: + * type: string + * password: + * type: string + * address: + * type: string + * organizationDescription: + * type: string + * referral_code: + * type: string + * responses: + * '200': + * description: Organization created successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * organization_name: + * type: string + * organization_email: + * type: string + * organization_address: + * type: string + * organization_description: + * type: string + */ +router.post('/organization', createOrganization); + +/** + * @swagger + * /organization/{id}: + * patch: + * summary: Update an organization by ID + * tags: [Organizations] + * parameters: + * - in: path + * name: id + * schema: + * type: integer + * required: true + * description: Organization ID + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * name: + * type: string + * email: + * type: string + * address: + * type: string + * description: + * type: string + * responses: + * '200': + * description: Organization updated successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * organization_name: + * type: string + * organization_email: + * type: string + * organization_address: + * type: string + * organization_description: + * type: string + */ +router.patch('/organization/:id', updateOrganization); + +/** + * @swagger + * /organization/{id}: + * delete: + * summary: Delete an organization by ID + * tags: [Organizations] + * parameters: + * - in: path + * name: id + * schema: + * type: integer + * required: true + * description: Organization ID + * responses: + * '200': + * description: Organization deleted successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * organization_name: + * type: string + * organization_email: + * type: string + * organization_address: + * type: string + * organization_description: + * type: string + */ +router.delete('/organization/:id', deleteOrganization); module.exports = router diff --git a/routes/organizationPublic.routes.ts b/routes/organizationPublic.routes.ts index ff27f4378dc8374820a086afbe0dd9fe9dfb3482..0b93a2bbe4de8fd07b406f07e17dd52bc873be30 100644 --- a/routes/organizationPublic.routes.ts +++ b/routes/organizationPublic.routes.ts @@ -1,8 +1,71 @@ +/** + * @swagger + * tags: + * name: Organizations + * description: Operations related to organizations + */ + import express from "express" import { createOrganization } from "../controllers/organization.controller" const router = express.Router() -router.post("/organization", createOrganization) - +/** + * @swagger + * /organization: + * post: + * summary: Create a new organization + * tags: [Organizations] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * name: + * type: string + * description: The name of the organization. + * email: + * type: string + * description: The email address of the organization. + * password: + * type: string + * description: The password for the organization. + * address: + * type: string + * description: The address of the organization. + * organizationDescription: + * type: string + * description: The description of the organization. + * referral_code: + * type: string + * description: The referral code for the organization. + * responses: + * '200': + * description: Organization created successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * organization_name: + * type: string + * organization_email: + * type: string + * organization_address: + * type: string + * organization_description: + * type: string + */ +router.post('/organization', createOrganization); module.exports = router diff --git a/routes/scholarship.routes.ts b/routes/scholarship.routes.ts index 0e2dee4b12821d9bad6da8a4c2ea314e65c44a41..2136693e071394d8e1f5972bf5bfcd9da8865d90 100644 --- a/routes/scholarship.routes.ts +++ b/routes/scholarship.routes.ts @@ -1,3 +1,9 @@ +/** + * @swagger + * tags: + * name: Scholarships + * description: Operations related to scholarships + */ import express from "express" import { createScholarship, @@ -6,19 +12,440 @@ import { updateScholarship, deleteScholarship, getAllScholarshipTypes, - scholarshipCount, scholarshipAcceptance, getCountOfUser } from "../controllers/scholarship.controller" const router = express.Router() -router.post("/scholarship", createScholarship) -router.get("/scholarship", getScholarships) -router.get("/scholarship/:id", getScholarship) -router.patch("/scholarship/:id", updateScholarship) -router.delete("/scholarship/:id", deleteScholarship) -router.get("/scholarshiptype", getAllScholarshipTypes) -router.get("/scholarship/:id/count", getCountOfUser) -router.post("/scholarship/acceptance/:sid", scholarshipAcceptance) +/** + * @swagger + * /scholarship: + * post: + * summary: Create a new scholarship + * tags: [Scholarships] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * organization_id: + * type: integer + * type: + * type: array + * items: + * type: string + * responses: + * '201': + * description: Scholarship created successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * scholarship_id: + * type: integer + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * type: + * type: array + * items: + * type: string + */ +router.post('/scholarship', createScholarship); + +/** + * @swagger + * /scholarship: + * get: + * summary: Get scholarships + * tags: [Scholarships] + * parameters: + * - name: title + * in: query + * description: Scholarship title for filtering + * schema: + * type: string + * - name: minCoverage + * in: query + * description: Minimum coverage for filtering + * schema: + * type: string + * - name: maxCoverage + * in: query + * description: Maximum coverage for filtering + * schema: + * type: string + * - name: types + * in: query + * description: Scholarship types for filtering (comma-separated) + * schema: + * type: string + * - name: itemsPerPage + * in: query + * description: Number of items per page + * schema: + * type: integer + * - name: currentPage + * in: query + * description: Current page number + * schema: + * type: integer + * responses: + * '200': + * description: Scholarships retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * numberOfPages: + * type: integer + * data: + * type: array + * items: + * type: object + * properties: + * organization_id: + * type: integer + * scholarship_id: + * type: integer + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * type: + * type: array + * items: + * type: string + * count: + * type: integer + */ +router.get('/scholarship', getScholarships); + +/** + * @swagger + * /scholarship/{id}: + * get: + * summary: Get a scholarship by ID + * tags: [Scholarships] + * parameters: + * - name: id + * in: path + * required: true + * description: ID of the scholarship to retrieve + * schema: + * type: integer + * responses: + * '200': + * description: Scholarship retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * scholarship_id: + * type: integer + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * type: + * type: array + * items: + * type: string + */ +router.get('/scholarship/:id', getScholarship); + +/** + * @swagger + * /scholarship/{id}: + * patch: + * summary: Update a scholarship by ID + * tags: [Scholarships] + * parameters: + * - name: id + * in: path + * required: true + * description: ID of the scholarship to update + * schema: + * type: integer + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * type: + * type: array + * items: + * type: string + * responses: + * '200': + * description: Scholarship updated successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * scholarship_id: + * type: integer + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * type: + * type: array + * items: + * type: string + */ +router.patch('/scholarship/:id', updateScholarship); + +/** + * @swagger + * /scholarship/{id}: + * delete: + * summary: Delete a scholarship by ID + * tags: [Scholarships] + * parameters: + * - name: id + * in: path + * required: true + * description: ID of the scholarship to delete + * schema: + * type: integer + * responses: + * '200': + * description: Scholarship deleted successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * organization_id: + * type: integer + * scholarship_id: + * type: integer + * title: + * type: string + * description: + * type: string + * short_description: + * type: string + * coverage: + * type: string + * contact_name: + * type: string + * contact_email: + * type: string + * type: + * type: array + * items: + * type: string + */ +router.delete('/scholarship/:id', deleteScholarship); + +/** + * @swagger + * /scholarshiptype: + * get: + * summary: Get all scholarship types + * tags: [Scholarships] + * responses: + * '200': + * description: Scholarship types retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: array + * items: + * type: string + */ +router.get('/scholarshiptype', getAllScholarshipTypes); + +/** + * @swagger + * /scholarship/{id}/count: + * get: + * summary: Get count of scholarships for a user + * tags: [Scholarships] + * parameters: + * - name: id + * in: path + * required: true + * description: ID of the user (organization) + * schema: + * type: integer + * responses: + * '200': + * description: Count of scholarships retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: integer + */ +router.get('/scholarship/:id/count', getCountOfUser); + +/** + * @swagger + * /scholarship/acceptance/{sid}: + * post: + * summary: Update scholarship acceptance status + * tags: [Scholarships] + * parameters: + * - name: sid + * in: path + * required: true + * description: ID of the scholarship to update acceptance status + * schema: + * type: integer + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * user_id: + * type: integer + * responses: + * '200': + * description: Scholarship acceptance updated successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * user_id: + * type: integer + * scholarship_id: + * type: integer + * scholarship_name: + * type: string + * status: + * type: string + */ +router.post('/scholarship/acceptance/:sid', scholarshipAcceptance); module.exports = router diff --git a/routes/soap.routes.ts b/routes/soap.routes.ts index 75b8fde138b019da6bea6f8695ada140e0ab49b1..b653c3e6b01fe6a989bd357aeb7272347d47e0f9 100644 --- a/routes/soap.routes.ts +++ b/routes/soap.routes.ts @@ -1,7 +1,45 @@ +/** + * @swagger + * tags: + * name: SOAP + * description: Operations related to SOAP requests + */ import express from "express" import { scholarshipAcceptance } from "../controllers/soap.controller" const router = express.Router() -router.post("/setacceptance", scholarshipAcceptance) +/** + * @swagger + * /soap/setacceptance: + * post: + * summary: Update scholarship acceptance status via SOAP + * tags: [SOAP] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * user_id_student: + * type: integer + * scholarship_id: + * type: integer + * status: + * type: string + * responses: + * '200': + * description: Scholarship acceptance updated successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + */ +router.post('/setacceptance', scholarshipAcceptance); module.exports = router diff --git a/routes/student.routes.ts b/routes/student.routes.ts index 34d8abf139b80465e5bbc7326374b9596c3bfd4b..8c65482e516b74d51231ff5f6a660182854a8343 100644 --- a/routes/student.routes.ts +++ b/routes/student.routes.ts @@ -1,3 +1,9 @@ +/** + * @swagger + * tags: + * name: Student + * description: Operations related to student information + */ import express from "express" import { getUserPhpInfo, @@ -6,7 +12,74 @@ import { const router = express.Router() -router.get("/user/:uid", getUserPhpInfo) -router.get("/scholarship/user/:sid", getStudentFromScholarship) +/** + * @swagger + * /student/user/{uid}: + * get: + * summary: Get user information from PHP service + * tags: [Student] + * parameters: + * - in: path + * name: uid + * required: true + * schema: + * type: integer + * responses: + * '200': + * description: User information retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * user: + * type: object + * properties: + * name: + * type: string + * email: + * type: string + */ +router.get('/user/:uid', getUserPhpInfo); + +/** + * @swagger + * /student/scholarship/user/{sid}: + * get: + * summary: Get student information from SOAP service for a specific scholarship + * tags: [Student] + * parameters: + * - in: path + * name: sid + * required: true + * schema: + * type: integer + * responses: + * '200': + * description: Student information retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * scholarships: + * type: object # Adjust the type based on the actual response structure + * description: Student information for the specified scholarship + */ +router.get('/scholarship/user/:sid', getStudentFromScholarship); module.exports = router diff --git a/routes/university.routes.ts b/routes/university.routes.ts index 4514d7bbaa30b37fbf3d236a68f10f8a667dc927..d750597872f8f0345727342f03f3d110820ffec2 100644 --- a/routes/university.routes.ts +++ b/routes/university.routes.ts @@ -1,3 +1,9 @@ +/** + * @swagger + * tags: + * name: University + * description: Operations related to university information + */ import express from "express" import { getUniversities, @@ -9,10 +15,223 @@ import { const router = express.Router() -router.get("/university", getUniversities) -router.get("/university/:id", getUniversity) -router.patch("/university/:id", updateUniversity) -router.delete("/university/:id", deleteUniversity) -router.get("/university/stats/:id", getUniversityStats) +/** + * @swagger + * /university: + * get: + * summary: Get a list of universities + * tags: [University] + * responses: + * '200': + * description: Universities retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: array + * items: + * type: object + * properties: + * university_id: + * type: integer + * university_name: + * type: string + * university_email: + * type: string + * university_address: + * type: string + * university_description: + * type: string + */ +router.get('/university', getUniversities); + +/** + * @swagger + * /university/{id}: + * get: + * summary: Get university information by ID + * tags: [University] + * parameters: + * - in: path + * name: id + * required: true + * schema: + * type: integer + * responses: + * '200': + * description: University retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * university_id: + * type: integer + * university_name: + * type: string + * university_email: + * type: string + * university_address: + * type: string + * university_description: + * type: string + */ +router.get('/university/:id', getUniversity); + +/** + * @swagger + * /university: + * patch: + * summary: Update university information by ID + * tags: [University] + * parameters: + * - in: path + * name: id + * required: true + * schema: + * type: integer + * - in: body + * name: body + * required: true + * description: University data to be updated + * schema: + * type: object + * properties: + * name: + * type: string + * email: + * type: string + * address: + * type: string + * description: + * type: string + * responses: + * '200': + * description: University updated successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * university_id: + * type: integer + * university_name: + * type: string + * university_email: + * type: string + * university_address: + * type: string + * university_description: + * type: string + */ +router.patch('/university/:id', updateUniversity); +/** + * @swagger + * /university: + * delete: + * summary: Delete university by ID + * tags: [University] + * parameters: + * - in: path + * name: id + * required: true + * schema: + * type: integer + * responses: + * '200': + * description: University deleted successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * university_id: + * type: integer + * university_name: + * type: string + * university_email: + * type: string + * university_address: + * type: string + * university_description: + * type: string + */ +router.delete('/university/:id', deleteUniversity); + +/** + * @swagger + * /university/stats/{id}: + * get: + * summary: Get statistics for a specific university + * tags: [University] + * parameters: + * - in: path + * name: id + * required: true + * schema: + * type: integer + * - in: query + * name: name + * schema: + * type: string + * description: Name filter for statistics + * - in: query + * name: itemsperpage + * schema: + * type: integer + * description: Number of items per page + * - in: query + * name: currentPage + * schema: + * type: integer + * description: Current page number + * responses: + * '200': + * description: University statistics retrieved successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * # Adjust the response structure based on your actual API response + * stats: + * type: object + * description: Statistics for the specified university + */ +router.get('/university/stats/:id', getUniversityStats); module.exports = router diff --git a/routes/universityPublic.routes.ts b/routes/universityPublic.routes.ts index f846ee974088ede2c46b1a9c636a9f4e0bfc8bcb..135223445456cc3003a1953469edeff3c4458c3a 100644 --- a/routes/universityPublic.routes.ts +++ b/routes/universityPublic.routes.ts @@ -1,8 +1,63 @@ +/** + * @swagger + * tags: + * name: University + * description: Operations related to university information + */ import express from "express" import { createUniversity } from "../controllers/university.controller" const router = express.Router() -router.post("/university", createUniversity) +/** + * @swagger + * /university: + * post: + * summary: Create a new university + * tags: [University] + * requestBody: + * required: true + * content: + * application/json: + * schema: + * type: object + * properties: + * name: + * type: string + * email: + * type: string + * password: + * type: string + * address: + * type: string + * universityDescription: + * type: string + * responses: + * '200': + * description: University created successfully + * content: + * application/json: + * schema: + * type: object + * properties: + * status: + * type: string + * message: + * type: string + * data: + * type: object + * properties: + * university_id: + * type: integer + * university_name: + * type: string + * university_email: + * type: string + * university_address: + * type: string + * university_description: + * type: string + */ +router.post('/university', createUniversity); module.exports = router diff --git a/server.ts b/server.ts index f0f560f0f3a3cf7686a155c99d1d92dc512a6296..974222b665c0b553cc95a2ba60c8e189f53a4e8b 100644 --- a/server.ts +++ b/server.ts @@ -4,8 +4,22 @@ import cors from "cors" import dotenv from "dotenv" import { client } from "./redis" import { sync } from "./polling/sync" +import swaggerJSDoc from 'swagger-jsdoc'; +import swaggerUi from 'swagger-ui-express'; dotenv.config() +const swaggerOptions = { + definition: { + openapi: '3.0.0', + info: { + title: 'Scholee API Documentation', + version: '1.0.0', + description: 'Description for your API', + }, + }, + apis: ['./routes/*.ts'], +}; +const swaggerSpec = swaggerJSDoc(swaggerOptions); const app = express() const PORT = process.env.PORT || 5000 const cookies = require("cookie-parser") @@ -34,6 +48,7 @@ app.use(cookies()) app.use(express.static("static")) app.use(express.json()) app.use("/", defaultroute) +app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); app.use("/api", authRoute) app.use("/api", soapRoute) app.use("/api", publicFile) diff --git a/yarn.lock b/yarn.lock index 484908174a02bf4aa68e426c164325ca650f4405..b28ced0798ee556f1111a33283ca737de715d3f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,38 @@ # yarn lockfile v1 +"@apidevtools/json-schema-ref-parser@^9.0.6": + version "9.1.2" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz#8ff5386b365d4c9faa7c8b566ff16a46a577d9b8" + integrity sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg== + dependencies: + "@jsdevtools/ono" "^7.1.3" + "@types/json-schema" "^7.0.6" + call-me-maybe "^1.0.1" + js-yaml "^4.1.0" + +"@apidevtools/openapi-schemas@^2.0.4": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz#9fa08017fb59d80538812f03fc7cac5992caaa17" + integrity sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ== + +"@apidevtools/swagger-methods@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz#b789a362e055b0340d04712eafe7027ddc1ac267" + integrity sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg== + +"@apidevtools/swagger-parser@10.0.3": + version "10.0.3" + resolved "https://registry.yarnpkg.com/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz#32057ae99487872c4dd96b314a1ab4b95d89eaf5" + integrity sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g== + dependencies: + "@apidevtools/json-schema-ref-parser" "^9.0.6" + "@apidevtools/openapi-schemas" "^2.0.4" + "@apidevtools/swagger-methods" "^3.0.2" + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + z-schema "^5.0.1" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -27,6 +59,11 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + "@mapbox/node-pre-gyp@^1.0.11": version "1.0.11" resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" @@ -187,6 +224,11 @@ resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-3.0.5.tgz#5eba4033a4f17fb2b29d975892694315194eca33" integrity sha512-dtLshqoiGRDHbHueIT9sjkd2F4tW1qPSX2xKAQK8p1e6pM+Z913GM1shv7dOqqasEMYbC5zEaClJomQe8OtQLA== +"@types/json-schema@^7.0.6": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/jsonwebtoken@^9.0.4": version "9.0.4" resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-9.0.4.tgz#8b74bbe87bde81a3469d4b32a80609bec62c23ec" @@ -245,6 +287,19 @@ "@types/mime" "*" "@types/node" "*" +"@types/swagger-jsdoc@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/swagger-jsdoc/-/swagger-jsdoc-6.0.3.tgz#5222107a17a30f9d7624b2bce86cc779ab50b16c" + integrity sha512-QMwYeiA7OajGiqqNCESZFnZRA7HIJ1WLz53IhBkPNUsVA9ibMcEVseJQiJRtJmW3YrluHItVmANvFBTg/N8/yQ== + +"@types/swagger-ui-express@^4.1.6": + version "4.1.6" + resolved "https://registry.yarnpkg.com/@types/swagger-ui-express/-/swagger-ui-express-4.1.6.tgz#d0929e3fabac1a96a8a9c6c7ee8d42362c5cdf48" + integrity sha512-UVSiGYXa5IzdJJG3hrc86e8KdZWLYxyEsVoUI4iPXc7CO4VZ3AfNP8d/8+hrDRIqz+HAaSMtZSqAsF3Nq2X/Dg== + dependencies: + "@types/express" "*" + "@types/serve-static" "*" + "@types/xml2js@^0.4.13": version "0.4.13" resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.4.13.tgz#219134d550c21e2f1d7b0e2fbb9174144c6053ed" @@ -325,6 +380,11 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -441,6 +501,11 @@ call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4: get-intrinsic "^1.2.1" set-function-length "^1.1.1" +call-me-maybe@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" + integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== + chokidar@^3.5.2: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -478,6 +543,16 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" +commander@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75" + integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q== + +commander@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -616,6 +691,13 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +doctrine@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dotenv@^16.3.1: version "16.3.1" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" @@ -655,6 +737,11 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -837,6 +924,18 @@ glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" +glob@7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@^7.1.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -1077,6 +1176,13 @@ js-cookie@^3.0.5: resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-3.0.5.tgz#0b7e2fd0c01552c58ba86e0841f94dc2557dcdbc" integrity sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw== +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + json-bigint@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" @@ -1134,6 +1240,11 @@ jws@^4.0.0: jwa "^2.0.0" safe-buffer "^5.0.1" +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + lodash.includes@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" @@ -1144,6 +1255,11 @@ lodash.isboolean@^3.0.3: resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" integrity sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg== +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.isinteger@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" @@ -1164,6 +1280,11 @@ lodash.isstring@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw== +lodash.mergewith@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" + integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== + lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" @@ -1235,7 +1356,7 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -1700,6 +1821,37 @@ supports-color@^5.5.0: dependencies: has-flag "^3.0.0" +swagger-jsdoc@^6.2.8: + version "6.2.8" + resolved "https://registry.yarnpkg.com/swagger-jsdoc/-/swagger-jsdoc-6.2.8.tgz#6d33d9fb07ff4a7c1564379c52c08989ec7d0256" + integrity sha512-VPvil1+JRpmJ55CgAtn8DIcpBs0bL5L3q5bVQvF4tAW/k/9JYSj7dCpaYCAv5rufe0vcCbBRQXGvzpkWjvLklQ== + dependencies: + commander "6.2.0" + doctrine "3.0.0" + glob "7.1.6" + lodash.mergewith "^4.6.2" + swagger-parser "^10.0.3" + yaml "2.0.0-1" + +swagger-parser@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/swagger-parser/-/swagger-parser-10.0.3.tgz#04cb01c18c3ac192b41161c77f81e79309135d03" + integrity sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg== + dependencies: + "@apidevtools/swagger-parser" "10.0.3" + +swagger-ui-dist@>=5.0.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.10.0.tgz#5ead451df863bca60bb76b02d9370205c1e8879e" + integrity sha512-PBTn5qDOQVtU29hrx74km86SnK3/mFtF3grI98y575y1aRpxiuStRTIvsfXFudPFkLofHU7H9a+fKrP+Oayc3g== + +swagger-ui-express@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/swagger-ui-express/-/swagger-ui-express-5.0.0.tgz#7a00a18dd909574cb0d628574a299b9ba53d4d49" + integrity sha512-tsU9tODVvhyfkNSvf03E6FAk+z+5cU3lXAzMy6Pv4av2Gt2xA0++fogwC4qo19XuFf6hdxevPuVCSKFuMHJhFA== + dependencies: + swagger-ui-dist ">=5.0.0" + tar@^6.1.11: version "6.2.0" resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73" @@ -1824,6 +1976,11 @@ v8-compile-cache-lib@^3.0.1: resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== +validator@^13.7.0: + version "13.11.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.11.0.tgz#23ab3fd59290c61248364eabf4067f04955fbb1b" + integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ== + vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -1888,7 +2045,23 @@ yallist@4.0.0, yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@2.0.0-1: + version "2.0.0-1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.0.0-1.tgz#8c3029b3ee2028306d5bcf396980623115ff8d18" + integrity sha512-W7h5dEhywMKenDJh2iX/LABkbFnBxasD27oyXWDS/feDsxiw0dD5ncXdYXgkvAsXIY2MpW/ZKkr9IU30DBdMNQ== + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +z-schema@^5.0.1: + version "5.0.6" + resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.6.tgz#46d6a687b15e4a4369e18d6cb1c7b8618fc256c5" + integrity sha512-+XR1GhnWklYdfr8YaZv/iu+vY+ux7V5DS5zH1DQf6bO5ufrt/5cgNhVO5qyhsjFXvsqQb/f08DWE9b6uPscyAg== + dependencies: + lodash.get "^4.4.2" + lodash.isequal "^4.5.0" + validator "^13.7.0" + optionalDependencies: + commander "^10.0.0"