! Finsihed goal on roadmap

! Finished docs on new update from roadmap
/neighbors/ api is now fully doc'd however we still need some rtc integration
This commit is contained in:
shockrah 2021-05-12 15:00:39 -07:00
parent cfbee6d887
commit 7ae975e7c1
3 changed files with 135 additions and 2 deletions

View File

@ -0,0 +1,115 @@
---
title: Neighbors
anchor: neighbors-ep
weight: 18
---
### `GET /neighbor/list`
* Required query string parameters
* jwt: String
* Returns
* neighbors: Array\<Neighbor\>
Example
```
> GET /neighbor/list?jwt=...
< {
< "neighbors": [
< {
< "name": "Instance Name",
< "url": "https://instance.xyz",
< "wsurl": "wss://instance.xyz",
< "description": "Interesting description",
< "tags": ["tech", "code", "docs"]
< },
< ...
< ]
< }
```
### `POST /neighbor/add`
* Required query string parameters
* jwt: String
* Required HTTP Headers
* content-type: Must be of `application/json`
* content-length
* Required Body
* Neighbor structure data(json encoded)
* Returns
* On sucess: 200 OK
Example
```
> POST /neighbor/add
> content-type: application/json
> content-length: ...
> {
> "name": "Instance Name",
> "url": "https://instance.xyz",
> "wsurl": "wss://instance.xyz",
> "description": "Interesting description",
> "tags": ["tech", "code", "docs"]
> }
< 200 OK
```
### `PUT /neighbor/update`
This route requires the full neighbor structure in the body with all the fields modified to satisfaction.
The url parameter in the query string is used to uniquely identify a listed neighbor.
_Note that the url can also be changed but the original/previous url must be used to identify
what is currently listed_.
* Required query string parameters
* jwt: String
* url: String := target url of the neighbor to update
* Required headers
* content-type: application/json
* content-length
Example
```
> PUT /neighbor/update
> content-type: application/json
> content-length: ...
> {
> "name": "New Instance Name",
> "url": "https://new.instance.xyz",
> "wsurl": "wss://new.instance.xyz",
> "description": "New Interesting description",
> "tags": ["new", "tags", "tech", "code", "docs"]
> }
< 200 OK
```
### `DELETE /neighbor/delete`
As long as the permissions are correct this route will basically always 200.
Even if nothing is found the endpoint will still 200.
* Required query string parameters
* jwt: String
* url: String
Example
```
> PUT /neighbor/update?url=https%3A%2F%2Finstance.xyz
< 200 OK
```

View File

@ -0,0 +1,18 @@
---
title: Neighbors
anchor: neighbors-structure
weight: 45
---
Neighbors contain the following structure
Name | Type
:-----:|:-----:
url\* | String
wsurl | String
name | String
description | String
tags | Array\<String\>
* url: is used as the primary key for identifying neighbors from one another

View File

@ -37,9 +37,9 @@ I'd like to be able to support people that make good software and give them a pl
* More server meta endpoint support: Some basic server metadata is stored in environment vars but we can probably store these somewhere a bit smarter idk. * ~~More server meta endpoint support: Some basic server metadata is stored in environment vars but we can probably store these somewhere a bit smarter idk.~~
* This is now actively being worked with /neighbor/list and /neighbor/add now being added to the supported routes. Further testing is required, as well as relevant documentation. At least this should be done within the next few days as I find time for it among other projects. * ~~This is now actively being worked with /neighbor/list and /neighbor/add now being added to the supported routes. Further testing is required, as well as relevant documentation. At least this should be done within the next few days as I find time for it among other projects.~~
* RTC Permissions: Unprivileged users shouldn't receive messaegs if they don't have the required permissions * RTC Permissions: Unprivileged users shouldn't receive messaegs if they don't have the required permissions