2019-12-24 04:33:44 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
package backend_proto;
|
2019-12-24 04:33:44 +01:00
|
|
|
|
|
|
|
message Empty {}
|
|
|
|
|
2019-12-27 09:14:19 +01:00
|
|
|
// 1-15 reserved for future use; 2047 for errors
|
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
message BackendInput {
|
2019-12-27 09:14:19 +01:00
|
|
|
reserved 2047;
|
2019-12-24 04:33:44 +01:00
|
|
|
oneof value {
|
2019-12-27 09:14:19 +01:00
|
|
|
TemplateRequirementsIn template_requirements = 16;
|
|
|
|
SchedTimingTodayIn sched_timing_today = 17;
|
2020-01-06 03:18:20 +01:00
|
|
|
Empty deck_tree = 18;
|
|
|
|
FindCardsIn find_cards = 19;
|
|
|
|
BrowserRowsIn browser_rows = 20;
|
2020-01-08 11:28:04 +01:00
|
|
|
FlattenTemplateIn flatten_template = 21;
|
2019-12-27 09:14:19 +01:00
|
|
|
|
|
|
|
PlusOneIn plus_one = 2046; // temporary, for testing
|
2019-12-24 04:33:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
message BackendOutput {
|
2019-12-24 04:33:44 +01:00
|
|
|
oneof value {
|
2019-12-27 09:14:19 +01:00
|
|
|
TemplateRequirementsOut template_requirements = 16;
|
|
|
|
SchedTimingTodayOut sched_timing_today = 17;
|
2020-01-06 03:18:20 +01:00
|
|
|
DeckTreeOut deck_tree = 18;
|
|
|
|
FindCardsOut find_cards = 19;
|
|
|
|
BrowserRowsOut browser_rows = 20;
|
2020-01-08 11:28:04 +01:00
|
|
|
FlattenTemplateOut flatten_template = 21;
|
2019-12-27 09:14:19 +01:00
|
|
|
|
|
|
|
PlusOneOut plus_one = 2046; // temporary, for testing
|
|
|
|
|
|
|
|
BackendError error = 2047;
|
2019-12-24 04:33:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
message BackendError {
|
2019-12-24 04:33:44 +01:00
|
|
|
oneof value {
|
|
|
|
InvalidInputError invalid_input = 1;
|
2019-12-24 05:05:15 +01:00
|
|
|
TemplateParseError template_parse = 2;
|
2019-12-24 04:33:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message InvalidInputError {
|
|
|
|
string info = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PlusOneIn {
|
|
|
|
int32 num = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PlusOneOut {
|
|
|
|
int32 num = 1;
|
|
|
|
}
|
2019-12-24 05:05:15 +01:00
|
|
|
|
|
|
|
message TemplateParseError {
|
|
|
|
string info = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TemplateRequirementsIn {
|
|
|
|
repeated string template_front = 1;
|
|
|
|
map<string, uint32> field_names_to_ordinals = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TemplateRequirementsOut {
|
|
|
|
repeated TemplateRequirement requirements = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TemplateRequirement {
|
|
|
|
oneof value {
|
|
|
|
TemplateRequirementAll all = 1;
|
|
|
|
TemplateRequirementAny any = 2;
|
|
|
|
Empty none = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message TemplateRequirementAll {
|
|
|
|
repeated uint32 ords = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TemplateRequirementAny {
|
|
|
|
repeated uint32 ords = 1;
|
|
|
|
}
|
2019-12-27 09:14:19 +01:00
|
|
|
|
|
|
|
message SchedTimingTodayIn {
|
2020-01-09 07:58:27 +01:00
|
|
|
int64 created_secs = 1;
|
|
|
|
sint32 created_mins_west = 2;
|
|
|
|
int64 now_secs = 3;
|
|
|
|
sint32 now_mins_west = 4;
|
|
|
|
sint32 rollover_hour = 5;
|
2019-12-27 09:14:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SchedTimingTodayOut {
|
|
|
|
uint32 days_elapsed = 1;
|
|
|
|
int64 next_day_at = 2;
|
|
|
|
}
|
2020-01-06 03:18:20 +01:00
|
|
|
|
|
|
|
message DeckTreeOut {
|
|
|
|
DeckTreeNode top = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeckTreeNode {
|
|
|
|
// the components of a deck, split on ::
|
|
|
|
repeated string names = 1;
|
|
|
|
int64 deck_id = 2;
|
|
|
|
uint32 review_count = 3;
|
|
|
|
uint32 learn_count = 4;
|
|
|
|
uint32 new_count = 5;
|
|
|
|
repeated DeckTreeNode children = 6;
|
|
|
|
bool collapsed = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FindCardsIn {
|
|
|
|
string search = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FindCardsOut {
|
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BrowserRowsIn {
|
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BrowserRowsOut {
|
|
|
|
// just sort fields for proof of concept
|
|
|
|
repeated string sort_fields = 1;
|
|
|
|
}
|
2020-01-08 11:28:04 +01:00
|
|
|
|
|
|
|
message FlattenTemplateIn {
|
|
|
|
string template_text = 1;
|
|
|
|
repeated string nonempty_field_names = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FlattenTemplateOut {
|
|
|
|
repeated FlattenedTemplateNode nodes = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FlattenedTemplateNode {
|
|
|
|
oneof value {
|
|
|
|
string text = 1;
|
|
|
|
FlattenedTemplateReplacement replacement = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message FlattenedTemplateReplacement {
|
|
|
|
string field_name = 1;
|
|
|
|
repeated string filters = 2;
|
|
|
|
}
|