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 {
|
|
|
|
oneof contents {
|
2024-05-14 23:30:20 +02:00
|
|
|
UserGraphItem user = 1;
|
|
|
|
SectionGraphItem section = 2;
|
|
|
|
ItemGraphItem item = 3;
|
2024-05-11 23:23:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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-14 23:30:20 +02:00
|
|
|
rpc UpdateItem(UpdateItemRequest) returns (UpdateItemResponse);
|
2024-05-15 15:05:26 +02:00
|
|
|
rpc ToggleItem(ToggleItemRequest) returns (ToggleItemResponse);
|
2024-06-01 13:13:18 +02:00
|
|
|
rpc Archive(ArchiveRequest) returns (ArchiveResponse);
|
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-14 23:30:20 +02:00
|
|
|
message UpdateItemRequest {
|
|
|
|
string root = 1;
|
|
|
|
repeated string path = 2;
|
|
|
|
ItemGraphItem item = 3;
|
|
|
|
}
|
|
|
|
message UpdateItemResponse {}
|
|
|
|
|
2024-05-15 15:05:26 +02:00
|
|
|
message ToggleItemRequest {
|
|
|
|
string root = 1;
|
|
|
|
repeated string path = 2;
|
|
|
|
}
|
|
|
|
message ToggleItemResponse {}
|
|
|
|
|
2024-06-01 13:13:18 +02:00
|
|
|
message ArchiveRequest {
|
|
|
|
string root = 1;
|
|
|
|
repeated string path = 2;
|
|
|
|
}
|
|
|
|
message ArchiveResponse {}
|
|
|
|
|
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
|
|
|
}
|