From cea0a001b82d06ec9de181799b46b925bbb027b90f83fa9d659dbc7144dc4c3e Mon Sep 17 00:00:00 2001 From: aslan Date: Tue, 23 Dec 2025 14:45:41 -0500 Subject: [PATCH] Add more objects --- docs/api/auth.md | 4 +-- docs/api/channel.md | 12 ++++++++ docs/api/community.md | 65 +++++++++++++++++++++++++++++++++++++++++++ docs/api/role.md | 12 ++++++++ docs/api/session.md | 11 ++++++++ docs/api/user.md | 57 ++++++++++++++++++++++++++++++++++++- 6 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 docs/api/channel.md create mode 100644 docs/api/community.md create mode 100644 docs/api/role.md create mode 100644 docs/api/session.md diff --git a/docs/api/auth.md b/docs/api/auth.md index 75d5d40..3cfbbb7 100644 --- a/docs/api/auth.md +++ b/docs/api/auth.md @@ -1,4 +1,4 @@ -## POST /api/v1/register +## POST /api/v1/auth/register ### Request: ```json { @@ -27,7 +27,7 @@ Registers a new user --- -## POST /api/v1/login +## POST /api/v1/auth/login ### Request: ```json { diff --git a/docs/api/channel.md b/docs/api/channel.md new file mode 100644 index 0000000..4aebb3d --- /dev/null +++ b/docs/api/channel.md @@ -0,0 +1,12 @@ +## GET /api/v1/channel/{id} +*Requires authentication header* +Returns a channel with id = {id} + +### Response: +```json +{ + "id": "string", + "name": "string", + "communityId": "string" +} +``` diff --git a/docs/api/community.md b/docs/api/community.md new file mode 100644 index 0000000..f4dffed --- /dev/null +++ b/docs/api/community.md @@ -0,0 +1,65 @@ +## GET /api/v1/community/{id} +*Requires authentication header* +Returns a community with id = {id} + +### Response: +```json +{ + "id": "string", + "name": "string" +} +``` + +## GET /api/v1/community/{id}/members +*Requires authentication header* +Returns users for a community with id = {id} + +### Response: +```json +{ + "id": "string", + "name": "string", + "members": [ + { + "id": "string", + "username": "string" + } + ] +} +``` + +## GET /api/v1/community/{id}/channels +*Requires authentication header* +Returns channels for a community with id = {id} + +### Response: +```json +{ + "id": "string", + "name": "string", + "channels": [ + { + "id": "string", + "name": "string" + } + ] +} +``` + +## GET /api/v1/community/{id}/roles +*Requires authentication header* +Returns roles for a community with id = {id} + +### Response: +```json +{ + "id": "string", + "name": "string", + "roles": [ + { + "id": "string", + "name": "string" + } + ] +} +``` diff --git a/docs/api/role.md b/docs/api/role.md new file mode 100644 index 0000000..7a7b2cf --- /dev/null +++ b/docs/api/role.md @@ -0,0 +1,12 @@ +## GET /api/v1/role/{id} +*Requires authentication header* +Returns a role with id = {id} + +### Response: +```json +{ + "id": "string", + "name": "string", + "communityId": "string" +} +``` diff --git a/docs/api/session.md b/docs/api/session.md new file mode 100644 index 0000000..baea870 --- /dev/null +++ b/docs/api/session.md @@ -0,0 +1,11 @@ +## GET /api/v1/session/{id} +*Requires authentication header* +Returns a session with id = {id} + +### Response: +```json +{ + "id": "string", + "userId": "string" +} +``` diff --git a/docs/api/user.md b/docs/api/user.md index e0deecb..c6b6969 100644 --- a/docs/api/user.md +++ b/docs/api/user.md @@ -1,5 +1,6 @@ ## GET /api/v1/user/{id} -Returns a user object with id = {id} +*Requires authentication header* +Returns a user with id = {id} ### Response: ```json @@ -13,3 +14,57 @@ Returns a user object with id = {id} "lastLogin": 0 } ``` + +## GET /api/v1/user/{id}/sessions +*Requires authentication header* +Returns all sessions for a user with id = {id} + +### Response: +```json +{ + "sessions": [ + { + "id": "string", + "userId": "string" + } + ] +} +``` + +## POST /api/v1/user/{id}/email +*Requires authentication header* +### Request: +```json +{ + "email": "string" +} +``` + +Updates email for a user with id = {id} + +### Response: +```json +{ + "id": "string", + "email": "string", +} +``` + +## POST /api/v1/user/{id}/description +*Requires authentication header* +### Request: +```json +{ + "description": "string" +} +``` + +Updates description for a user with id = {id} + +### Response: +```json +{ + "id": "string", + "description": "string", +} +```