From ec25992578bc7cc6be2d77f424d87240d68212f8 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 25 May 2020 13:38:24 -0700 Subject: [PATCH 1/4] moved structures secction to its own .md + sub sectioned everything to fit into a greater sub context in the full docs --- docs/api.md | 41 ++++++----------------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/docs/api.md b/docs/api.md index d66f2ae..00e7eaa 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,10 +1,10 @@ -# Preface +# API Voice connections are not yet authored as they are far from being implemented -# Auth Routes +## Auth Routes -## Logging in +### Logging in Authenticated routes require a session key which this route provides, given a previously invited user's credentials @@ -25,7 +25,7 @@ Return: Unix time stamp dictating when this key should be deleted server side. Though the server may delete the key later than this time-stamp the client can request a new token via `/auth/login` or `/auth/refresh`. -## Leaving an instance +### Leaving an instance Parameters - id @@ -37,7 +37,7 @@ Return: On failure: An HTTP 400 Bad Request response; which parameter is wrong is not specified to avoid enumeration style attacks. -# Channels +## Channels ``` /channels/list/voice @@ -52,7 +52,7 @@ Return: Return: List of struct::Members in that given channel -# Messaging +## Messaging ``` /message/recent/ @@ -81,32 +81,3 @@ On paramter failure: On server error: HTTP 500 Internal Server Error -# Structures - -Below are various structures that client builds can expect to receive. - -``` -Member { - name: string - id: u64 - permissions: u64 -} - -Channel { - name: string - description: string - type: integer [1=Voice Channel, 2=Text Channel] -} - -Message { - content: string - author: Member - date: Unix Timestamp -} - -Badge { - name: string - permissions: u64 - color: u32 -} -``` From e945897ac119262754f07b7b279aac4a3757c562 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 25 May 2020 13:39:49 -0700 Subject: [PATCH 2/4] removed old outdated docs --- docs/routes | 2 -- docs/todo | 14 -------------- 2 files changed, 16 deletions(-) delete mode 100644 docs/routes delete mode 100644 docs/todo diff --git a/docs/routes b/docs/routes deleted file mode 100644 index bc05f7f..0000000 --- a/docs/routes +++ /dev/null @@ -1,2 +0,0 @@ -/auth/login -/auth/ diff --git a/docs/todo b/docs/todo deleted file mode 100644 index 1e2ec7b..0000000 --- a/docs/todo +++ /dev/null @@ -1,14 +0,0 @@ -# Server - -- DB Model -- Data Persistence -- Permissions structure -- Channels(text) - - -# Client - -- Frontend requesters for login/auth -- Auth management -- UI that doesn't succ - From 0cddfc328979d6110f8eb4eebc7bd52d788b958f Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 25 May 2020 13:40:19 -0700 Subject: [PATCH 3/4] structures section now in its own page --- docs/structures.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/structures.md diff --git a/docs/structures.md b/docs/structures.md new file mode 100644 index 0000000..99c05c3 --- /dev/null +++ b/docs/structures.md @@ -0,0 +1,50 @@ +# Structures + +Below are various structures that client builds can expect to receive. +These are not representative of how instances internally store data but what a client can expect to receive from different API requests. + +1. Member + +``` +Member { + name: string + id: u64 + permissions: u64 + badges: List +} +``` + +2. Channel + +``` +Channel { + name: string + description: string + type: integer [1=Voice Channel, 2=Text Channel] +} +``` + +3. Message + +While `Message` responses don't specify what channel they belong a channel +does have to be used to request these so it's up to the client to store these +in a way that makes sense. + +``` +Message { + author: Member + date: u64 -> [unix timestamp since epoch] + content: string +} +``` + +4. Badge + +``` +Badge { + name: string + permissions: u64 + color: u32 +} + +``` From edca7b3a4afb9beb4e3e95c72cfc49260f974399 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 25 May 2020 13:41:03 -0700 Subject: [PATCH 4/4] new docs builder script to be used by the docker container later --- docs/build-docs.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/build-docs.sh diff --git a/docs/build-docs.sh b/docs/build-docs.sh new file mode 100644 index 0000000..2fc863a --- /dev/null +++ b/docs/build-docs.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Builds all docs into a single easily searchable document +# Builds: HTML PDF TEXT versions of the documents. + +chapters='api.md structures.md' + +for chap in $chapters;do + cat $chap +done > freechat-docs.md + +pandoc freechat-docs.md -o freechat-docs.pdf +pandoc freechat-docs.md -o freechat-docs.html