From 36c952fe81db1f7879352983d879ea6708464c11160e6643debaf60597e521d3 Mon Sep 17 00:00:00 2001 From: aslan Date: Mon, 29 Dec 2025 02:03:47 +0100 Subject: [PATCH 1/2] Add more services --- docs/api/auth.md | 4 +-- docs/api/channel.md | 41 ++++++++++++++++++++++++++++- docs/api/community.md | 16 +++++++++++- docs/api/invite.md | 14 +++++----- docs/api/role.md | 61 ++++++++++++++++++++++++++++++++++++++++++- docs/api/session.md | 2 +- docs/api/user.md | 50 ++++++++++++++++++++++++++++++++--- 7 files changed, 172 insertions(+), 16 deletions(-) diff --git a/docs/api/auth.md b/docs/api/auth.md index 2617369..d582559 100644 --- a/docs/api/auth.md +++ b/docs/api/auth.md @@ -6,7 +6,7 @@ { "username": "string", "password": "string", - "email": "string" + "email": "string?" } ``` @@ -18,7 +18,7 @@ Registers a new user { "id": "string", "username": "string", - "registerDate": 0 + "registerDate": "number" } ``` diff --git a/docs/api/channel.md b/docs/api/channel.md index 465117a..0ab4552 100644 --- a/docs/api/channel.md +++ b/docs/api/channel.md @@ -11,7 +11,7 @@ Returns a channel with id = {id} "id": "string", "name": "string", "communityId": "string", - "creationDate": 0 + "creationDate": "number" } ``` @@ -39,3 +39,42 @@ Creates a new channel and returns it "communityId": "string" } ``` + +## PATCH /api/v1/channel/{id} + +_Requires an authorization header_ + +### Request: + +```json +{ + "name": "string?" +} +``` + +Updates a channel with id = {id} + +### Response: + +```json +{ + "id": "string", + "name": "string", + "communityId": "string" +} +``` + +## DELETE /api/v1/channel/{id} + +_Requires an authorization header_ + +Removes a channel with id = {id} + +### Response: + +```json +{ + "id": "string", + "communityId": "string" +} +``` diff --git a/docs/api/community.md b/docs/api/community.md index 80c4326..5f260ae 100644 --- a/docs/api/community.md +++ b/docs/api/community.md @@ -10,7 +10,7 @@ Returns a community with id = {id} "name": "string", "description": "string", "ownerId": "string", - "creationDate": 0 + "creationDate": "number" } ``` @@ -65,6 +65,20 @@ Updates a community with id = {id} } ``` +## DELETE /api/v1/community/{id} + +_Requires an authorization header_ + +Removes a community with id = {id} + +### Response: + +```json +{ + "id": "string" +} +``` + ## GET /api/v1/community/{id}/members _Requires an authorization header_ diff --git a/docs/api/invite.md b/docs/api/invite.md index b240449..16641f8 100644 --- a/docs/api/invite.md +++ b/docs/api/invite.md @@ -8,13 +8,13 @@ Returns an invite with id = {id} { "id": "string", "communityId": "string", - "valid": true, - "unlimitedInvites": false, - "hasExpiration": false, - "totalInvites": 0, - "remainingInvites": 0, - "creationDate": 0, - "expirationDate": 0 + "valid": "boolean", + "unlimitedInvites": "boolean", + "hasExpiration": "boolean", + "totalInvites": "number", + "remainingInvites": "number", + "creationDate": "number", + "expirationDate": "number" } ``` diff --git a/docs/api/role.md b/docs/api/role.md index ce360ff..2e1a51c 100644 --- a/docs/api/role.md +++ b/docs/api/role.md @@ -11,7 +11,25 @@ Returns a role with id = {id} "id": "string", "name": "string", "communityId": "string", - "creationDate": 0 + "creationDate": "number" +} +``` + +## GET /api/v1/role/{id}/permissions + +_Requires an authorization header_ + +Returns a role with id = {id} and permissions + +### Response: + +```json +{ + "id": "string", + "name": "string", + "communityId": "string", + "permissions": "string[]". + "creationDate": "number" } ``` @@ -41,6 +59,32 @@ Creates a new role and returns it } ``` +## PATCH /api/v1/role/{id} + +_Requires an authorization header_ + +### Request: + +```json +{ + "name": "string?", + "permissions": "string[]?" +} +``` + +Updates a role with id = {id} + +### Response: + +```json +{ + "id": "string", + "name": "string", + "communityId": "string", + "permissions": "string[]" +} +``` + ## POST /api/v1/role/{id}/assign _Requires an authorization header_ @@ -90,3 +134,18 @@ Unassigns a role from a user "userId": "string" } ``` + +## DELETE /api/v1/role/{id} + +_Requires an authorization header_ + +Removes a role with id = {id} + +### Response: + +```json +{ + "id": "string", + "communityId": "string" +} +``` diff --git a/docs/api/session.md b/docs/api/session.md index 1b4be61..cdbd5be 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -10,7 +10,7 @@ Returns a session with id = {id} { "id": "string", "userId": "string", - "creationDate": 0 + "creationDate": "number" } ``` diff --git a/docs/api/user.md b/docs/api/user.md index 6856c59..68d2099 100644 --- a/docs/api/user.md +++ b/docs/api/user.md @@ -12,9 +12,39 @@ Returns a user with id = {id} "username": "string", "email": "string", "description": "string", - "admin": false, - "registerDate": 0, - "lastLogin": 0 + "admin": "boolean", + "registerDate": "number", + "lastLogin": "number" +} +``` + +## POST /api/v1/user + +_Requires an authorization header_ + +### Request: + +```json +{ + "username": "string", + "password": "string", + "email": "string?", + "description": "string?", + "admin": "boolean?" +} +``` + +Creates a new user and returns it + +### Response: + +```json +{ + "id": "string", + "username": "string", + "email": "string", + "description": "string", + "admin": "boolean" } ``` @@ -43,6 +73,20 @@ Updates a user with id = {id} } ``` +## DELETE /api/v1/user/{id} + +_Requires an authorization header_ + +Removes a user with id = {id} + +### Response: + +```json +{ + "id": "string" +} +``` + ## GET /api/v1/user/{id}/sessions _Requires an authorization header_ From df2b2a42479fd4e7bec672cd6767b2a8e3ef8f82711b98dc9aba3ec266fce44b Mon Sep 17 00:00:00 2001 From: aslan Date: Mon, 29 Dec 2025 02:03:58 +0100 Subject: [PATCH 2/2] Version 0.3.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 165e48d..cc21297 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +0.3.3