From 628f3a3d12727da77c4ccd316719ba64ccd32a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 11 Aug 2024 16:15:30 +0300 Subject: [PATCH 01/13] chore: create openapi.json with openapi 3.1.0 format > Objects >> info >> servers --- Server/openapi.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Server/openapi.json diff --git a/Server/openapi.json b/Server/openapi.json new file mode 100644 index 000000000..635dfe0ad --- /dev/null +++ b/Server/openapi.json @@ -0,0 +1,35 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "BluWave Uptime", + "summary": "BlueWave Uptime OpenAPI Specifications", + "description": "BlueWave Uptime is an open source server monitoring application used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.", + "contact": { + "name": "API Support", + "url": "mailto:hello@bluewavelabs.ca", + "email": "hello@bluewavelabs.ca" + }, + "license": { + "name": "AGPLv3", + "url": "https://github.com/bluewave-labs/bluewave-uptime/tree/HEAD/LICENSE" + }, + "version": "1.0" + }, + "servers": [ + { + "url": "https://bluewavelabs.ca", + "description": "Remote Development Server" + }, + { + "url": "http://localhost:{PORT}", + "description": "Local Development Server", + "variables": { + "PORT": { + "description": "The Data Set API is accessible via https and http", + "enum": ["5000", "3000", "8080"], + "default": "5000" + } + } + } + ] +} From 0d2366cb3fa05c9577a6e058bf134229955bc122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 11 Aug 2024 18:52:19 +0300 Subject: [PATCH 02/13] chore: update contact email in openapi.json --- Server/openapi.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index 635dfe0ad..8e219b5ae 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -6,8 +6,8 @@ "description": "BlueWave Uptime is an open source server monitoring application used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.", "contact": { "name": "API Support", - "url": "mailto:hello@bluewavelabs.ca", - "email": "hello@bluewavelabs.ca" + "url": "mailto:support@bluewavelabs.ca", + "email": "support@bluewavelabs.ca" }, "license": { "name": "AGPLv3", From adbbdd405c01854e0c47b5a63a91eda93f5b4d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 11 Aug 2024 19:03:02 +0300 Subject: [PATCH 03/13] chore(openapi): dynamic API path variables on servers --- Server/openapi.json | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index 8e219b5ae..8d3fff916 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -17,17 +17,29 @@ }, "servers": [ { - "url": "https://bluewavelabs.ca", - "description": "Remote Development Server" + "url": "https://bluewavelabs.ca/{API_PATH}", + "description": "Remote Development Server", + "variables": { + "API_PATH": { + "description": "API Base Path", + "enum": ["api/v1", "api/v1.1", "api/v2"], + "default": "api/v1" + } + } }, { - "url": "http://localhost:{PORT}", + "url": "http://localhost:{PORT}/{API_PATH}", "description": "Local Development Server", "variables": { "PORT": { - "description": "The Data Set API is accessible via https and http", + "description": "API Port", "enum": ["5000", "3000", "8080"], "default": "5000" + }, + "API_PATH": { + "description": "API Base Path", + "enum": ["api/v1", "api/v1.1", "api/v2"], + "default": "api/v1" } } } From 1541fd20fc4934769692bf7b3e8311938f61da29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Mon, 12 Aug 2024 21:39:10 +0300 Subject: [PATCH 04/13] chore(openapi): define the endpoint, method and description on auth routes > Common Responses - 200 - 422 - 500 --- Server/openapi.json | 320 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 319 insertions(+), 1 deletion(-) diff --git a/Server/openapi.json b/Server/openapi.json index 8d3fff916..e66c38294 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -43,5 +43,323 @@ } } } - ] + ], + "tags": [ + { + "name": "auth", + "description": "Authentication" + } + ], + "paths": { + "/auth/register": { + "post": { + "tags": ["auth"], + "description": "Register a new user", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/login": { + "post": { + "tags": ["auth"], + "description": "Login with credentials", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/logout": { + "post": { + "tags": ["auth"], + "description": "Logout", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/user/:userId": { + "put": { + "tags": ["auth"], + "description": "Change user informations", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + }, + "delete": { + "tags": ["auth"], + "description": "Delete user", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/users/admin": { + "get": { + "tags": ["auth"], + "description": "Checks to see if an admin account exists", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/users": { + "get": { + "tags": ["auth"], + "description": "Get all users", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/invite": { + "post": { + "tags": ["auth"], + "description": "Invite people to application", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/invite/verify": { + "post": { + "tags": ["auth"], + "description": "Verify the invite", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/recovery/request": { + "post": { + "tags": ["auth"], + "description": "Request a recovery token", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/recovery/validate": { + "post": { + "tags": ["auth"], + "description": "Validate recovery token", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + }, + "/auth/recovery/reset": { + "post": { + "tags": ["auth"], + "description": "Password reset", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": {} + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": {} + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": {} + } + } + } + } + } + } } From 16eb578a5563f2ab289e167fb8178cce2cfea9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Mon, 12 Aug 2024 21:40:15 +0300 Subject: [PATCH 05/13] fix(openapi): update typo in title from 'BluWave uptime' to 'BlueWave Uptime' --- Server/openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/openapi.json b/Server/openapi.json index e66c38294..36f18a73f 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -1,7 +1,7 @@ { "openapi": "3.1.0", "info": { - "title": "BluWave Uptime", + "title": "BlueWave Uptime", "summary": "BlueWave Uptime OpenAPI Specifications", "description": "BlueWave Uptime is an open source server monitoring application used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.", "contact": { From e28530cdc7bd2de9cf6689358d00e312626034f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Tue, 13 Aug 2024 00:14:29 +0300 Subject: [PATCH 06/13] chore(openapi): add ErrorResponse and SuccessResponse schema components to auth routes --- Server/openapi.json | 245 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 209 insertions(+), 36 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index 36f18a73f..b0b7deba6 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -59,19 +59,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -85,19 +97,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -111,19 +135,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -137,19 +173,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -161,19 +209,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -187,19 +247,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -213,19 +285,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -239,19 +323,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -265,19 +361,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -291,19 +399,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -317,19 +437,31 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } @@ -343,23 +475,64 @@ "200": { "description": "OK", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } } }, "422": { "description": "Unprocessable Content", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } }, "500": { "description": "Internal Server Error", "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } } } } } } + }, + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "msg": { + "type": "string" + } + } + }, + "SuccessResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "msg": { + "type": "string" + }, + "data": { + "type": "object" + } + } + } + } } } From 137500bbd0d523e14243e8cd97d5ee120d05b98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 18 Aug 2024 20:01:34 +0300 Subject: [PATCH 07/13] chore(openapi): add UserSuccessResponse ref to auth responses --- Server/openapi.json | 241 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 229 insertions(+), 12 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index b0b7deba6..cf4338be6 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -61,7 +61,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -99,7 +99,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -137,7 +137,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -175,7 +175,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -211,7 +211,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -249,7 +249,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -287,7 +287,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -325,7 +325,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -363,7 +363,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -401,7 +401,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -439,7 +439,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -477,7 +477,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SuccessResponse" + "$ref": "#/components/schemas/UserSuccessResponse" } } } @@ -532,6 +532,223 @@ "type": "object" } } + }, + "UserSuccessResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "msg": { + "type": "string" + }, + "data": { + "type": "object", + "$ref": "#/components/schemas/UserDataType" + } + } + }, + "MonitorSuccessResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "msg": { + "type": "string" + }, + "data": { + "type": "object", + "$ref": "#/components/schemas/MonitorDataType" + } + } + }, + "CheckDataSuccessResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "msg": { + "type": "string" + }, + "data": { + "type": "object", + "$ref": "#/components/schemas/CheckDataType" + } + } + }, + "AlertDataSuccessResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "msg": { + "type": "string" + }, + "data": { + "type": "object", + "$ref": "#/components/schemas/AlertDataType" + } + } + }, + "UserDataType": { + "type": "object", + "required": [ + "firstname", + "lastname", + "email", + "profilePicUrl", + "isActive", + "isVerified", + "updated_at", + "created_at" + ], + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "profilePicUrl": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "isVerified": { + "type": "boolean" + }, + "updated_at": { + "type": "string" + }, + "created_at": { + "type": "string" + } + } + }, + "MonitorDataType": { + "type": "object", + "required": [ + "userId", + "name", + "description", + "url", + "isActive", + "interval", + "updatedAt", + "createdAt" + ], + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "interval": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + } + }, + "CheckDataType": { + "type": "object", + "required": [ + "monitorId", + "status", + "responseTime", + "statusCode", + "message", + "updatedAt", + "createdAt" + ], + "properties": { + "monitorId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "responseTime": { + "type": "integer" + }, + "statusCode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + } + }, + "AlertDataType": { + "type": "object", + "required": [ + "checkId", + "monitorId", + "userId", + "status", + "message", + "notifiedStatus", + "acknowledgedStatus", + "updatedAt", + "createdAt" + ], + "properties": { + "checkId": { + "type": "string" + }, + "monitorId": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "message": { + "type": "string" + }, + "notifiedStatus": { + "type": "boolean" + }, + "acknowledgedStatus": { + "type": "boolean" + }, + "updatedAt": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + } } } } From cc08d7f8d59602fc33c84ebeb7ba6cf868f99826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sun, 18 Aug 2024 20:20:28 +0300 Subject: [PATCH 08/13] fix(openapi): update property names to camelCase in UserDataType schema --- Server/openapi.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index cf4338be6..536992638 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -602,8 +602,8 @@ "profilePicUrl", "isActive", "isVerified", - "updated_at", - "created_at" + "updatedAt", + "createdAt" ], "properties": { "firstname": { @@ -625,10 +625,10 @@ "isVerified": { "type": "boolean" }, - "updated_at": { + "updatedAt": { "type": "string" }, - "created_at": { + "createdAt": { "type": "string" } } From 21ce46a29e4bdd2e0ac19e16b8691c2829e806bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 30 Aug 2024 21:09:16 +0300 Subject: [PATCH 09/13] feat(openapi): add request body to login and register routes --- Server/openapi.json | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Server/openapi.json b/Server/openapi.json index 536992638..066bded08 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -55,6 +55,45 @@ "post": { "tags": ["auth"], "description": "Register a new user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["firstName", "lastName", "email", "password", "role", "teamId"], + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + }, + "profileImage": { + "type": "file", + "format": "file" + }, + "role": { + "type": "array", + "enum": [["user"], ["admin"], ["superadmin"]], + "default": ["superadmin"] + }, + "teamId": { + "type": "string", + "format": "uuid" + } + } + } + } + } + }, "responses": { "200": { "description": "OK", @@ -93,6 +132,26 @@ "post": { "tags": ["auth"], "description": "Login with credentials", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["email", "password"], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, "responses": { "200": { "description": "OK", From bdb293c18159b152d35cbcdfd6ac8a167210d0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 30 Aug 2024 21:10:13 +0300 Subject: [PATCH 10/13] fix(openapi): remove logout route from auth --- Server/openapi.json | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index 066bded08..72397d139 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -186,44 +186,6 @@ } } }, - "/auth/logout": { - "post": { - "tags": ["auth"], - "description": "Logout", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserSuccessResponse" - } - } - } - }, - "422": { - "description": "Unprocessable Content", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - } - } - } - }, "/auth/user/:userId": { "put": { "tags": ["auth"], From 649cf6835654fbdb3bc3f84b535e8679b81a064f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Fri, 30 Aug 2024 21:12:08 +0300 Subject: [PATCH 11/13] chore(openapi): remove remote development server --- Server/openapi.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Server/openapi.json b/Server/openapi.json index 72397d139..5db6250c5 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -16,17 +16,6 @@ "version": "1.0" }, "servers": [ - { - "url": "https://bluewavelabs.ca/{API_PATH}", - "description": "Remote Development Server", - "variables": { - "API_PATH": { - "description": "API Base Path", - "enum": ["api/v1", "api/v1.1", "api/v2"], - "default": "api/v1" - } - } - }, { "url": "http://localhost:{PORT}/{API_PATH}", "description": "Local Development Server", From f680ed8af1b23b3ab0a0d8bbfc1dffbed0b71d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 31 Aug 2024 13:44:23 +0300 Subject: [PATCH 12/13] chore(openapi): add missing route groups to tags - invite - monitors - checks - alerts - pagespeed - maintenance-window - healthy - mail --- Server/openapi.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Server/openapi.json b/Server/openapi.json index 5db6250c5..d9a55dbe6 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -37,6 +37,38 @@ { "name": "auth", "description": "Authentication" + }, + { + "name": "invite", + "description": "Invite" + }, + { + "name": "monitors", + "description": "Monitors" + }, + { + "name": "checks", + "description": "Checks" + }, + { + "name": "alerts", + "description": "Alerts" + }, + { + "name": "pagespeed", + "description": "Page Speed" + }, + { + "name": "maintenance-window", + "description": "Maintenance window" + }, + { + "name": "healthy", + "description": "Health check" + }, + { + "name": "mail", + "description": "Mail service" } ], "paths": { From b6190728a02d32c8ae23631db9d1bfd8a26742a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20=C5=9Ei=C5=9Fmano=C4=9Flu?= Date: Sat, 31 Aug 2024 13:51:36 +0300 Subject: [PATCH 13/13] feat(openapi): add /healthy route for health check --- Server/openapi.json | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Server/openapi.json b/Server/openapi.json index d9a55dbe6..23c16521d 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -546,6 +546,44 @@ } } } + }, + "/healthy": { + "get": { + "tags": ["healthy"], + "description": "Health check", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } } }, "components": {