mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 09:35:00 +09:00
158 lines
2.1 KiB
Protocol Buffer
158 lines
2.1 KiB
Protocol Buffer
syntax="proto3";
|
|
|
|
message Package {
|
|
string id = 1;
|
|
oneof message {
|
|
string data = 11;
|
|
bool success = 12;
|
|
|
|
Account account = 21;
|
|
State state = 22;
|
|
DocHeader docHeader = 23;
|
|
Document document = 24;
|
|
Block block = 25;
|
|
Status status = 26;
|
|
Login login = 27;
|
|
Signup signup = 28;
|
|
}
|
|
}
|
|
|
|
message Status {
|
|
string replyTo = 1;
|
|
string message = 2;
|
|
StatusType statusType = 3;
|
|
}
|
|
|
|
message Login {
|
|
string mnemonics = 1;
|
|
string pin = 2;
|
|
}
|
|
|
|
message Signup {
|
|
string name = 1;
|
|
string icon = 2;
|
|
string pin = 3;
|
|
}
|
|
|
|
message Account {
|
|
string id = 1;
|
|
string name = 2;
|
|
string icon = 3;
|
|
}
|
|
|
|
message State {
|
|
repeated DocHeader docHeaders = 1;
|
|
string currentDocId = 2;
|
|
}
|
|
|
|
message DocHeader {
|
|
string id = 1;
|
|
string name = 2;
|
|
string version = 3;
|
|
string icon = 4;
|
|
}
|
|
|
|
message Document {
|
|
DocHeader header = 1;
|
|
repeated Block blocks = 2;
|
|
}
|
|
|
|
message Text {
|
|
string content = 1;
|
|
repeated Mark marks = 2;
|
|
ContentType contentType = 3;
|
|
}
|
|
|
|
message Mark {
|
|
MarkType type = 1;
|
|
}
|
|
|
|
message Block {
|
|
string id = 1;
|
|
oneof content {
|
|
Text text = 11;
|
|
// ...
|
|
}
|
|
}
|
|
|
|
enum StatusType {
|
|
SUCCESS = 0;
|
|
FAILURE = 1;
|
|
WRONG_MNEMONIC = 2;
|
|
NOT_FOUND = 3;
|
|
// ...
|
|
}
|
|
|
|
enum MarkType {
|
|
B = 0;
|
|
I = 1;
|
|
S = 2;
|
|
KBD = 3;
|
|
A = 4;
|
|
}
|
|
|
|
enum ContentType {
|
|
P = 0;
|
|
CODE = 1;
|
|
H_1 = 2;
|
|
H_2 = 3;
|
|
H_3 = 4;
|
|
H_4 = 5;
|
|
OL = 6;
|
|
UL = 7;
|
|
QUOTE = 8;
|
|
TOGGLE = 9;
|
|
CHECK = 10;
|
|
}
|
|
|
|
enum BlockType {
|
|
H_GRID = 0;
|
|
V_GRID = 1;
|
|
EDITABLE = 2;
|
|
DIV = 3;
|
|
VIDEO = 4;
|
|
IMAGE = 5;
|
|
PAGE = 6;
|
|
NEW_PAGE = 7;
|
|
BOOK_MARK = 8;
|
|
FILE = 9;
|
|
DATA_VIEW = 10;
|
|
}
|
|
|
|
/*
|
|
"marks": [
|
|
{ "type": "b" },
|
|
{ "type": "i" },
|
|
{ "type": "s" },
|
|
{ "type": "kbd" },
|
|
{ "type": "a" }
|
|
],
|
|
|
|
"blockType": {
|
|
"hGrid": 1,
|
|
"vGrid": 2,
|
|
"editable": 3,
|
|
"div": 4,
|
|
"video": 5,
|
|
"image": 6,
|
|
"page": 7,
|
|
"newPage": 8,
|
|
"bookMark": 9,
|
|
"file": 10,
|
|
"dataView": 11
|
|
},
|
|
|
|
"contentType": {
|
|
"p": 1,
|
|
"code": 2,
|
|
"h1": 3,
|
|
"h2": 4,
|
|
"h3": 5,
|
|
"ol": 6,
|
|
"ul": 7,
|
|
"quote": 8,
|
|
"toggle": 9,
|
|
"check": 10,
|
|
"h4": 11
|
|
},
|
|
*/
|