Protocol Documentation
Table of Contents
Top
service/service.proto
ClientCommands
Top
changes.proto
BlockChanges
BlocksListSingleChange
Change
Change.Block
Change.Block.Children
Field |
Type |
Label |
Description |
children |
string |
repeated |
|
Change.Block.Content
Change.Block.Content.Dashboard
Change.Block.Content.Media
Change.Block.Content.Page
Change.Block.Content.Text
Top
commands.proto
Rpc
Rpc.Account
Rpc.Account.Create
Rpc.Account.Create.Request
Front end to middleware request-to-create-an account
Field |
Type |
Label |
Description |
name |
string |
|
Account name |
avatarLocalPath |
string |
|
Path to an image, that will be used as an avatar of this account |
avatarColor |
string |
|
Avatar color as an alternative for avatar image |
Rpc.Account.Create.Response
Middleware-to-front-end response for an account creation request, that can contain a NULL error and created account or a non-NULL error and an empty account
Field |
Type |
Label |
Description |
error |
Rpc.Account.Create.Response.Error |
|
Error while trying to create an account |
account |
Model.Account |
|
A newly created account; In case of a failure, i.e. error is non-NULL, the account model should contain empty/default-value fields |
Rpc.Account.Create.Response.Error
Rpc.Account.Recover
Rpc.Account.Recover.Request
Front end to middleware request-to-start-search of an accounts for a recovered mnemonic.
Each of an account that would be found will come with an AccountAdd event
Rpc.Account.Recover.Response
Middleware-to-front-end response to an account recover request, that can contain a NULL error and created account or a non-NULL error and an empty account
Rpc.Account.Recover.Response.Error
Rpc.Account.Select
Rpc.Account.Select.Request
Front end to middleware request-to-launch-a specific account using account id and a root path
User can select an account from those, that came with an AccountAdd events
Field |
Type |
Label |
Description |
id |
string |
|
Id of a selected account |
rootPath |
string |
|
Root path is optional, set if this is a first request |
Rpc.Account.Select.Response
Middleware-to-front-end response for an account select request, that can contain a NULL error and selected account or a non-NULL error and an empty account
Rpc.Account.Select.Response.Error
Rpc.Block
Rpc.Block.Create
Rpc.Block.Create.Request
Rpc.Block.Create.Response
Rpc.Block.Create.Response.Error
Rpc.Block.History
Rpc.Block.History.Move
Rpc.Block.History.Move.Request
Rpc.Block.History.Move.Response
Rpc.Block.History.Move.Response.Error
Rpc.Block.Open
Rpc.Block.Open.Request
Field |
Type |
Label |
Description |
id |
string |
|
|
Rpc.Block.Open.Response
Rpc.Block.Open.Response.Error
Rpc.Block.Update
Rpc.Block.Update.Request
Rpc.Block.Update.Response
Rpc.Block.Update.Response.Error
Rpc.Image
Rpc.Image.Get
Rpc.Image.Get.Blob
Rpc.Image.Get.Blob.Request
Rpc.Image.Get.Blob.Response
Rpc.Image.Get.Blob.Response.Error
Rpc.Image.Get.File
Rpc.Image.Get.File.Request
Rpc.Image.Get.File.Response
Rpc.Image.Get.File.Response.Error
Rpc.Ipfs
Rpc.Ipfs.Get
Rpc.Ipfs.Get.File
Rpc.Ipfs.Get.File.Request
Field |
Type |
Label |
Description |
id |
string |
|
|
Rpc.Ipfs.Get.File.Response
Rpc.Ipfs.Get.File.Response.Error
Rpc.Log
Rpc.Log.Send
Rpc.Log.Send.Request
Rpc.Log.Send.Response
Rpc.Log.Send.Response.Error
Rpc.Version
Rpc.Version.Get
Rpc.Version.Get.Request
Rpc.Version.Get.Response
Rpc.Version.Get.Response.Error
Rpc.Wallet
Rpc.Wallet.Create
Rpc.Wallet.Create.Request
Front-end-to-middleware request to create a new wallet
Field |
Type |
Label |
Description |
rootPath |
string |
|
Path to a wallet directory |
Rpc.Wallet.Create.Response
Middleware-to-front-end response, that can contain mnemonic of a created account and a NULL error or an empty mnemonic and a non-NULL error
Rpc.Wallet.Create.Response.Error
Rpc.Wallet.Recover
Rpc.Wallet.Recover.Request
Front end to middleware request-to-recover-a wallet with this mnemonic and a rootPath
Field |
Type |
Label |
Description |
rootPath |
string |
|
Path to a wallet directory |
mnemonic |
string |
|
Mnemonic of a wallet to recover |
Rpc.Wallet.Recover.Response
Middleware-to-front-end response, that can contain a NULL error or a non-NULL error
Rpc.Wallet.Recover.Response.Error
Rpc.Account.Create.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
No error; Account should be non-empty |
UNKNOWN_ERROR |
1 |
Any other errors |
BAD_INPUT |
2 |
Avatar or name is not correct |
ACCOUNT_CREATED_BUT_FAILED_TO_START_NODE |
101 |
|
ACCOUNT_CREATED_BUT_FAILED_TO_SET_NAME |
102 |
|
ACCOUNT_CREATED_BUT_FAILED_TO_SET_AVATAR |
103 |
|
Rpc.Account.Recover.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
No error; |
UNKNOWN_ERROR |
1 |
Any other errors |
BAD_INPUT |
2 |
|
NO_ACCOUNTS_FOUND |
101 |
|
NEED_TO_RECOVER_WALLET_FIRST |
102 |
|
FAILED_TO_CREATE_LOCAL_REPO |
103 |
|
LOCAL_REPO_EXISTS_BUT_CORRUPTED |
104 |
|
FAILED_TO_RUN_NODE |
105 |
|
WALLET_RECOVER_NOT_PERFORMED |
106 |
|
Rpc.Account.Select.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
No error |
UNKNOWN_ERROR |
1 |
Any other errors |
BAD_INPUT |
2 |
Id or root path is wrong |
FAILED_TO_CREATE_LOCAL_REPO |
101 |
|
LOCAL_REPO_EXISTS_BUT_CORRUPTED |
102 |
|
FAILED_TO_RUN_NODE |
103 |
|
FAILED_TO_FIND_ACCOUNT_INFO |
104 |
|
LOCAL_REPO_NOT_EXISTS_AND_MNEMONIC_NOT_SET |
105 |
|
Rpc.Block.Create.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
... |
Rpc.Block.History.Move.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
|
CAN_NOT_MOVE |
3 |
... |
Rpc.Block.Open.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
... |
Rpc.Block.Update.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
... |
Rpc.Image.Get.Blob.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
... |
NOT_FOUND |
101 |
|
TIMEOUT |
102 |
|
Rpc.Image.Get.File.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
... |
NOT_FOUND |
101 |
|
TIMEOUT |
102 |
|
Rpc.Ipfs.Get.File.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
... |
NOT_FOUND |
101 |
|
TIMEOUT |
102 |
|
Rpc.Log.Send.Request.Level
Name |
Number |
Description |
DEBUG |
0 |
|
ERROR |
1 |
|
FATAL |
2 |
|
INFO |
3 |
|
PANIC |
4 |
|
WARNING |
5 |
|
Rpc.Log.Send.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
|
NOT_FOUND |
101 |
|
TIMEOUT |
102 |
|
Rpc.Version.Get.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
|
UNKNOWN_ERROR |
1 |
|
BAD_INPUT |
2 |
|
VERSION_IS_EMPTY |
3 |
|
NOT_FOUND |
101 |
|
TIMEOUT |
102 |
|
Rpc.Wallet.Create.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
No error; mnemonic should be non-empty |
UNKNOWN_ERROR |
1 |
Any other errors |
BAD_INPUT |
2 |
Root path is wrong |
FAILED_TO_CREATE_LOCAL_REPO |
101 |
... |
Rpc.Wallet.Recover.Response.Error.Code
Name |
Number |
Description |
NULL |
0 |
No error; wallet successfully recovered |
UNKNOWN_ERROR |
1 |
Any other errors |
BAD_INPUT |
2 |
Root path or mnemonic is wrong |
FAILED_TO_CREATE_LOCAL_REPO |
101 |
|
Top
events.proto
Event
Event.Account
Event.Account.Show
Message, that will be sent to the front on each account found after an AccountRecoverRequest
Field |
Type |
Label |
Description |
index |
int64 |
|
Number of an account in an all found accounts list |
account |
Model.Account |
|
An Account, that has been found for the mnemonic |
Event.Block
Event.Block.Create
Event.Block.FilesUpload
Middleware to front end event message, that will be sent on one of this scenarios:
Precondition: user A opened a block
- User A drops a set of files/pictures/videos
- User A creates a MediaBlock and drops a single media, that corresponds to its type.
Field |
Type |
Label |
Description |
filePath |
string |
repeated |
filepaths to the files |
blockId |
string |
|
if empty => create new blocks |
Event.Block.Show
Event.Block.Update
Event.User
Event.User.Block
Event.User.Block.Join
Middleware to front end event message, that will be sent in this scenario:
Precondition: user A opened a block
- User B opens the same block
- User A receives a message about p.1
Field |
Type |
Label |
Description |
account |
Event.Account |
|
Account of the user, that opened a block |
Event.User.Block.Left
Middleware to front end event message, that will be sent in this scenario:
Precondition: user A and user B opened the same block
- User B closes the block
- User A receives a message about p.1
Field |
Type |
Label |
Description |
account |
Event.Account |
|
Account of the user, that left the block |
Event.User.Block.SelectRange
Middleware to front end event message, that will be sent in this scenario:
Precondition: user A and user B opened the same block
- User B selects some inner blocks
- User A receives a message about p.1
Field |
Type |
Label |
Description |
account |
Event.Account |
|
Account of the user, that selected blocks |
blockIdsArray |
string |
repeated |
Ids of selected blocks. |
Middleware to front end event message, that will be sent in this scenario:
Precondition: user A and user B opened the same block
- User B sets cursor or selects a text region into a text block
- User A receives a message about p.1
Field |
Type |
Label |
Description |
account |
Event.Account |
|
Account of the user, that selected a text |
blockId |
string |
|
Id of the text block, that have a selection |
range |
Model.Range |
|
Range of the selection |
Top
models.proto
Model
Model.Account
Contains basic information about user account
Field |
Type |
Label |
Description |
id |
string |
|
User's thread id |
name |
string |
|
User name, that associated with this account |
avatar |
Model.Account.Avatar |
|
Avatar of a user's account |
Model.Account.Avatar
Avatar of a user's account. It could be an image or color
Field |
Type |
Label |
Description |
image |
Model.Image |
|
Image of the avatar. Contains hash and size |
color |
string |
|
Color of the avatar, if no image |
Model.Block
Model.Block.Content
Model.Block.Content.Dashboard
Model.Block.Content.Dataview
...
Model.Block.Content.Div
Model.Block.Content.Layout
Model.Block.Content.Media
Model.Block.Content.Media.FilePreview
Model.Block.Content.Media.ImagePreview
Model.Block.Content.Media.VideoPreview
Model.Block.Content.Page
Model.Block.Content.Text
Model.Block.Content.Text.Mark
Model.Block.Content.Text.Marks
Model.Image
Model.Preview
Model.Preview.Link
Model.Range
Model.Struct
Model.Struct.FieldsEntry
Model.Struct.ListValue
ListValue
is a wrapper around a repeated field of values.
Model.Struct.Value
Value
represents a dynamically typed value which can be either
null, a number, a string, a boolean, a recursive struct value, or a
list of values. A producer of value is expected to set one of that
variants, absence of any variant indicates an error.
Model.Video
Model.Block.Content.Dashboard.Style
Name |
Number |
Description |
MAIN_SCREEN |
0 |
... |
Model.Block.Content.Layout.Style
Name |
Number |
Description |
ROW |
0 |
|
COLUMN |
1 |
|
Model.Block.Content.Media.State
Name |
Number |
Description |
EMPTY |
0 |
|
UPLOADING |
1 |
|
PREVIEW |
2 |
|
DOWNLOADING |
3 |
|
DONE |
4 |
|
Model.Block.Content.Page.Style
Name |
Number |
Description |
EMPTY |
0 |
|
TASK |
1 |
|
BOOKMARK |
2 |
|
SET |
3 |
... |
Model.Block.Content.Text.Mark.Type
Name |
Number |
Description |
STRIKETHROUGH |
0 |
|
KEYBOARD |
1 |
|
ITALIC |
2 |
|
BOLD |
3 |
|
LINK |
4 |
|
Model.Block.Content.Text.MarkerType
Name |
Number |
Description |
none |
0 |
|
number |
1 |
|
bullet |
2 |
|
Model.Block.Content.Text.Style
Name |
Number |
Description |
p |
0 |
|
h1 |
1 |
|
h2 |
2 |
|
h3 |
3 |
|
h4 |
4 |
|
quote |
5 |
|
code |
6 |
|
Name |
Number |
Description |
DASHBOARD |
0 |
|
PAGE |
1 |
|
DATAVIEW |
2 |
|
TEXT |
3 |
|
FILE |
4 |
|
PICTURE |
5 |
|
VIDEO |
6 |
|
BOOKMARK |
7 |
|
LAYOUT |
8 |
|
DIV |
9 |
|
Model.Image.Size
Name |
Number |
Description |
LARGE |
0 |
|
SMALL |
1 |
|
THUMB |
2 |
|
Model.Preview.Link.Type
Name |
Number |
Description |
PAGE |
0 |
|
IMAGE |
1 |
|
TEXT |
2 |
|
UNEXPECTED |
3 |
|
Model.Struct.NullValue
NullValue
is a singleton enumeration to represent the null value for the
Name |
Number |
Description |
NULL_VALUE |
0 |
|
Model.Video.Size
Name |
Number |
Description |
SD_360p |
0 |
|
SD_480p |
1 |
|
HD_720p |
2 |
|
HD_1080p |
3 |
|
UHD_1440p |
4 |
|
UHD_2160p |
5 |
|
Scalar Value Types
.proto Type |
Notes |
C++ Type |
Java Type |
Python Type |
double |
|
double |
double |
float |
float |
|
float |
float |
float |
int32 |
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. |
int32 |
int |
int |
int64 |
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. |
int64 |
long |
int/long |
uint32 |
Uses variable-length encoding. |
uint32 |
int |
int/long |
uint64 |
Uses variable-length encoding. |
uint64 |
long |
int/long |
sint32 |
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. |
int32 |
int |
int |
sint64 |
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. |
int64 |
long |
int/long |
fixed32 |
Always four bytes. More efficient than uint32 if values are often greater than 2^28. |
uint32 |
int |
int |
fixed64 |
Always eight bytes. More efficient than uint64 if values are often greater than 2^56. |
uint64 |
long |
int/long |
sfixed32 |
Always four bytes. |
int32 |
int |
int |
sfixed64 |
Always eight bytes. |
int64 |
long |
int/long |
bool |
|
bool |
boolean |
boolean |
string |
A string must always contain UTF-8 encoded or 7-bit ASCII text. |
string |
String |
str/unicode |
bytes |
May contain any arbitrary sequence of bytes. |
string |
ByteString |
str |