2024-05-11 16:23:52 +02:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package hyperlog;
|
|
|
|
|
2024-05-11 23:23:00 +02:00
|
|
|
message UserGraphItem {
|
|
|
|
map<string, GraphItem> items = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
message SectionGraphItem {
|
|
|
|
map<string, GraphItem> items = 1;
|
|
|
|
}
|
|
|
|
|
2024-05-12 12:58:54 +02:00
|
|
|
message ItemStateNotDone {}
|
|
|
|
message ItemStateDone {}
|
2024-05-11 23:23:00 +02:00
|
|
|
|
|
|
|
message ItemGraphItem {
|
|
|
|
string title = 1;
|
|
|
|
string description = 2;
|
2024-05-12 12:58:54 +02:00
|
|
|
oneof item_state {
|
|
|
|
ItemStateNotDone not_done = 3;
|
|
|
|
ItemStateDone done = 4;
|
|
|
|
}
|
2024-05-11 23:23:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message GraphItem {
|
|
|
|
string path = 1;
|
|
|
|
oneof contents {
|
|
|
|
UserGraphItem user = 2;
|
|
|
|
SectionGraphItem section = 3;
|
|
|
|
ItemGraphItem item = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-12 22:24:37 +02:00
|
|
|
service Graph {
|
2024-05-13 22:57:20 +02:00
|
|
|
// Commands
|
|
|
|
rpc CreateSection(CreateSectionRequest) returns (CreateSectionResponse);
|
|
|
|
rpc CreateRoot(CreateRootRequest) returns (CreateRootResponse);
|
2024-05-13 23:33:37 +02:00
|
|
|
rpc CreateItem(CreateItemRequest) returns (CreateItemResponse);
|
2024-05-13 22:57:20 +02:00
|
|
|
|
|
|
|
// Queriers
|
2024-05-12 22:24:37 +02:00
|
|
|
rpc GetAvailableRoots(GetAvailableRootsRequest) returns (GetAvailableRootsResponse);
|
|
|
|
rpc Get(GetRequest) returns (GetReply);
|
2024-05-13 22:57:20 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Commands
|
|
|
|
message CreateSectionRequest {
|
|
|
|
string root = 1;
|
|
|
|
repeated string path = 2;
|
|
|
|
}
|
|
|
|
message CreateSectionResponse {}
|
|
|
|
|
|
|
|
message CreateRootRequest {
|
|
|
|
string root = 1;
|
2024-05-12 22:24:37 +02:00
|
|
|
}
|
2024-05-13 22:57:20 +02:00
|
|
|
message CreateRootResponse {}
|
2024-05-12 22:24:37 +02:00
|
|
|
|
2024-05-13 23:33:37 +02:00
|
|
|
message CreateItemRequest {
|
|
|
|
string root = 1;
|
|
|
|
repeated string path = 2;
|
|
|
|
ItemGraphItem item = 3;
|
|
|
|
}
|
|
|
|
message CreateItemResponse {}
|
|
|
|
|
2024-05-13 22:57:20 +02:00
|
|
|
// Queries
|
2024-05-12 22:24:37 +02:00
|
|
|
message GetAvailableRootsRequest {}
|
|
|
|
message GetAvailableRootsResponse {
|
|
|
|
repeated string roots = 1;
|
|
|
|
}
|
|
|
|
|
2024-05-11 23:23:00 +02:00
|
|
|
message GetRequest {
|
|
|
|
string root = 1;
|
|
|
|
repeated string paths = 2;
|
2024-05-11 16:23:52 +02:00
|
|
|
}
|
|
|
|
|
2024-05-11 23:23:00 +02:00
|
|
|
message GetReply {
|
2024-05-12 12:58:54 +02:00
|
|
|
GraphItem item = 1;
|
2024-05-11 16:23:52 +02:00
|
|
|
}
|