style API.md
This commit is contained in:
parent
40b38517f8
commit
3e83becd39
|
@ -164,25 +164,92 @@
|
||||||
<div id="content" class="content">
|
<div id="content" class="content">
|
||||||
<main>
|
<main>
|
||||||
<h1 id="hole-frontend-api"><a class="header" href="#hole-frontend-api">Hole Frontend API</a></h1>
|
<h1 id="hole-frontend-api"><a class="header" href="#hole-frontend-api">Hole Frontend API</a></h1>
|
||||||
<h2 id="loginning-and-registration"><a class="header" href="#loginning-and-registration">Loginning and Registration</a></h2>
|
<!-- ## Loginning and Registration -->
|
||||||
<h3 id="registration-request"><a class="header" href="#registration-request">Registration request</a></h3>
|
<!-- ### Registration request -->
|
||||||
<p>On base of password will be generted keypair for signing and keypair for encoding.</p>
|
<!-- On base of password will be generted keypair for signing and keypair for encoding. -->
|
||||||
<pre><code class="language-json"> {
|
<!-- ``` json -->
|
||||||
request_type: "registration",
|
<!-- { -->
|
||||||
username: "user",
|
<!-- request_type: "registration", -->
|
||||||
password: "passwd123",
|
<!-- username: "user", -->
|
||||||
|
<!-- password: "passwd123", -->
|
||||||
|
<!-- } -->
|
||||||
|
<!-- ``` -->
|
||||||
|
<!-- ### Login request -->
|
||||||
|
<!-- ```json -->
|
||||||
|
<!-- { -->
|
||||||
|
<!-- request_type: login, -->
|
||||||
|
<!-- username: "name", -->
|
||||||
|
<!-- decode_key: "key", -->
|
||||||
|
<!-- sign_key: "key", -->
|
||||||
|
<!-- } -->
|
||||||
|
<!-- ``` -->
|
||||||
|
<!-- ## Adding friends -->
|
||||||
|
<!-- Each user have :w -->
|
||||||
|
<hr />
|
||||||
|
<h1 id="requests"><a class="header" href="#requests">Requests</a></h1>
|
||||||
|
<pre><code class="language-Rust">pub enum Request {
|
||||||
|
StartApp,
|
||||||
|
StopApp,
|
||||||
|
LoadUsers,
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
SendMessage {
|
||||||
|
user_id: Id,
|
||||||
|
message: String,
|
||||||
|
},
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
LoadMessages {
|
||||||
|
user_id: Id,
|
||||||
|
count: u32,
|
||||||
|
start_index: u32,
|
||||||
|
},
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
AddUser {
|
||||||
|
name: String,
|
||||||
|
sign_key: String,
|
||||||
|
insert_key: String,
|
||||||
|
}, // CreateInstance TODO v0.3
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3 id="login-request"><a class="header" href="#login-request">Login request</a></h3>
|
<h2 id="startapp"><a class="header" href="#startapp"><code>StartApp</code></a></h2>
|
||||||
|
<p>Require when when client started.</p>
|
||||||
<pre><code class="language-json">{
|
<pre><code class="language-json">{
|
||||||
request_type: login,
|
type: "startApp"
|
||||||
username: "name",
|
}
|
||||||
decode_key: "key",
|
</code></pre>
|
||||||
sign_key: "key",
|
<h2 id="stopapp"><a class="header" href="#stopapp"><code>StopApp</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "stopApp"
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="loadusers"><a class="header" href="#loadusers"><code>LoadUsers</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "loadUsers"
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="sendmessage"><a class="header" href="#sendmessage"><code>SendMessage</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "sendMessage",
|
||||||
|
userId: "UUID_V4...",
|
||||||
|
message: "hellow world"
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="adduser"><a class="header" href="#adduser"><code>AddUser</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "addUser",
|
||||||
|
name: "username",
|
||||||
|
signKey: "USK@key...",
|
||||||
|
insertKey: "insertkey..."
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="loadmessages"><a class="header" href="#loadmessages"><code>LoadMessages</code></a></h2>
|
||||||
|
<p>Requesting <code>count</code> messages from <code>userId</code> started from <code>startIndex</code>'s message</p>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "loadMessages",
|
||||||
|
userId: "UUID_V4...",
|
||||||
|
count: 10,
|
||||||
|
startIndex: 30
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2 id="adding-friends"><a class="header" href="#adding-friends">Adding friends</a></h2>
|
|
||||||
<p>Each user have :w</p>
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
|
@ -204,25 +204,92 @@ EndMessage
|
||||||
<h2 id="adding-friend"><a class="header" href="#adding-friend">Adding friend</a></h2>
|
<h2 id="adding-friend"><a class="header" href="#adding-friend">Adding friend</a></h2>
|
||||||
<p>Hole generates file, which alice have to send to bob somehow, and bob have to do the same. This file will contain unique ID and two keys</p>
|
<p>Hole generates file, which alice have to send to bob somehow, and bob have to do the same. This file will contain unique ID and two keys</p>
|
||||||
<h1 id="hole-frontend-api"><a class="header" href="#hole-frontend-api">Hole Frontend API</a></h1>
|
<h1 id="hole-frontend-api"><a class="header" href="#hole-frontend-api">Hole Frontend API</a></h1>
|
||||||
<h2 id="loginning-and-registration"><a class="header" href="#loginning-and-registration">Loginning and Registration</a></h2>
|
<!-- ## Loginning and Registration -->
|
||||||
<h3 id="registration-request"><a class="header" href="#registration-request">Registration request</a></h3>
|
<!-- ### Registration request -->
|
||||||
<p>On base of password will be generted keypair for signing and keypair for encoding.</p>
|
<!-- On base of password will be generted keypair for signing and keypair for encoding. -->
|
||||||
<pre><code class="language-json"> {
|
<!-- ``` json -->
|
||||||
request_type: "registration",
|
<!-- { -->
|
||||||
username: "user",
|
<!-- request_type: "registration", -->
|
||||||
password: "passwd123",
|
<!-- username: "user", -->
|
||||||
|
<!-- password: "passwd123", -->
|
||||||
|
<!-- } -->
|
||||||
|
<!-- ``` -->
|
||||||
|
<!-- ### Login request -->
|
||||||
|
<!-- ```json -->
|
||||||
|
<!-- { -->
|
||||||
|
<!-- request_type: login, -->
|
||||||
|
<!-- username: "name", -->
|
||||||
|
<!-- decode_key: "key", -->
|
||||||
|
<!-- sign_key: "key", -->
|
||||||
|
<!-- } -->
|
||||||
|
<!-- ``` -->
|
||||||
|
<!-- ## Adding friends -->
|
||||||
|
<!-- Each user have :w -->
|
||||||
|
<hr />
|
||||||
|
<h1 id="requests"><a class="header" href="#requests">Requests</a></h1>
|
||||||
|
<pre><code class="language-Rust">pub enum Request {
|
||||||
|
StartApp,
|
||||||
|
StopApp,
|
||||||
|
LoadUsers,
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
SendMessage {
|
||||||
|
user_id: Id,
|
||||||
|
message: String,
|
||||||
|
},
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
LoadMessages {
|
||||||
|
user_id: Id,
|
||||||
|
count: u32,
|
||||||
|
start_index: u32,
|
||||||
|
},
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
AddUser {
|
||||||
|
name: String,
|
||||||
|
sign_key: String,
|
||||||
|
insert_key: String,
|
||||||
|
}, // CreateInstance TODO v0.3
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3 id="login-request"><a class="header" href="#login-request">Login request</a></h3>
|
<h2 id="startapp"><a class="header" href="#startapp"><code>StartApp</code></a></h2>
|
||||||
|
<p>Require when when client started.</p>
|
||||||
<pre><code class="language-json">{
|
<pre><code class="language-json">{
|
||||||
request_type: login,
|
type: "startApp"
|
||||||
username: "name",
|
}
|
||||||
decode_key: "key",
|
</code></pre>
|
||||||
sign_key: "key",
|
<h2 id="stopapp"><a class="header" href="#stopapp"><code>StopApp</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "stopApp"
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="loadusers"><a class="header" href="#loadusers"><code>LoadUsers</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "loadUsers"
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="sendmessage"><a class="header" href="#sendmessage"><code>SendMessage</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "sendMessage",
|
||||||
|
userId: "UUID_V4...",
|
||||||
|
message: "hellow world"
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="adduser"><a class="header" href="#adduser"><code>AddUser</code></a></h2>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "addUser",
|
||||||
|
name: "username",
|
||||||
|
signKey: "USK@key...",
|
||||||
|
insertKey: "insertkey..."
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<h2 id="loadmessages"><a class="header" href="#loadmessages"><code>LoadMessages</code></a></h2>
|
||||||
|
<p>Requesting <code>count</code> messages from <code>userId</code> started from <code>startIndex</code>'s message</p>
|
||||||
|
<pre><code class="language-json">{
|
||||||
|
type: "loadMessages",
|
||||||
|
userId: "UUID_V4...",
|
||||||
|
count: 10,
|
||||||
|
startIndex: 30
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2 id="adding-friends"><a class="header" href="#adding-friends">Adding friends</a></h2>
|
|
||||||
<p>Each user have :w</p>
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
42
src/API.md
42
src/API.md
|
@ -1,30 +1,30 @@
|
||||||
# Hole Frontend API
|
# Hole Frontend API
|
||||||
|
|
||||||
## Loginning and Registration
|
<!-- ## Loginning and Registration -->
|
||||||
|
|
||||||
### Registration request
|
<!-- ### Registration request -->
|
||||||
On base of password will be generted keypair for signing and keypair for encoding.
|
<!-- On base of password will be generted keypair for signing and keypair for encoding. -->
|
||||||
``` json
|
<!-- ``` json -->
|
||||||
{
|
<!-- { -->
|
||||||
request_type: "registration",
|
<!-- request_type: "registration", -->
|
||||||
username: "user",
|
<!-- username: "user", -->
|
||||||
password: "passwd123",
|
<!-- password: "passwd123", -->
|
||||||
}
|
<!-- } -->
|
||||||
```
|
<!-- ``` -->
|
||||||
|
|
||||||
|
|
||||||
### Login request
|
<!-- ### Login request -->
|
||||||
```json
|
<!-- ```json -->
|
||||||
{
|
<!-- { -->
|
||||||
request_type: login,
|
<!-- request_type: login, -->
|
||||||
username: "name",
|
<!-- username: "name", -->
|
||||||
decode_key: "key",
|
<!-- decode_key: "key", -->
|
||||||
sign_key: "key",
|
<!-- sign_key: "key", -->
|
||||||
}
|
<!-- } -->
|
||||||
```
|
<!-- ``` -->
|
||||||
|
|
||||||
## Adding friends
|
<!-- ## Adding friends -->
|
||||||
Each user have :w
|
<!-- Each user have :w -->
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue