2019-12-24 04:33:44 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2020-02-23 03:21:12 +01:00
|
|
|
import "fluent.proto";
|
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
package backend_proto;
|
2019-12-24 04:33:44 +01:00
|
|
|
|
|
|
|
message Empty {}
|
|
|
|
|
2020-01-30 02:22:34 +01:00
|
|
|
message BackendInit {
|
|
|
|
string collection_path = 1;
|
|
|
|
string media_folder_path = 2;
|
|
|
|
string media_db_path = 3;
|
2020-02-14 05:51:07 +01:00
|
|
|
repeated string preferred_langs = 4;
|
|
|
|
string locale_folder_path = 5;
|
2020-01-30 02:22:34 +01:00
|
|
|
}
|
|
|
|
|
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-12 06:15:46 +01:00
|
|
|
RenderCardIn render_card = 21;
|
2020-01-18 02:52:36 +01:00
|
|
|
int64 local_minutes_west = 22;
|
2020-01-20 10:12:34 +01:00
|
|
|
string strip_av_tags = 23;
|
2020-01-24 02:06:11 +01:00
|
|
|
ExtractAVTagsIn extract_av_tags = 24;
|
2020-02-11 05:20:07 +01:00
|
|
|
ExtractLatexIn extract_latex = 25;
|
2020-02-11 09:08:34 +01:00
|
|
|
AddMediaFileIn add_media_file = 26;
|
2020-02-04 00:07:15 +01:00
|
|
|
SyncMediaIn sync_media = 27;
|
2020-02-10 08:58:54 +01:00
|
|
|
Empty check_media = 28;
|
2020-02-11 08:30:10 +01:00
|
|
|
TrashMediaFilesIn trash_media_files = 29;
|
2020-02-16 12:07:40 +01:00
|
|
|
TranslateStringIn translate_string = 30;
|
2020-02-20 05:16:33 +01:00
|
|
|
FormatTimeSpanIn format_time_span = 31;
|
2020-02-21 09:01:15 +01:00
|
|
|
StudiedTodayIn studied_today = 32;
|
2020-02-21 10:26:45 +01:00
|
|
|
CongratsLearnMsgIn congrats_learn_msg = 33;
|
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-12 06:15:46 +01:00
|
|
|
RenderCardOut render_card = 21;
|
2020-01-18 02:52:36 +01:00
|
|
|
sint32 local_minutes_west = 22;
|
2020-01-20 10:12:34 +01:00
|
|
|
string strip_av_tags = 23;
|
2020-01-24 02:06:11 +01:00
|
|
|
ExtractAVTagsOut extract_av_tags = 24;
|
2020-02-11 05:20:07 +01:00
|
|
|
ExtractLatexOut extract_latex = 25;
|
2020-02-11 09:08:34 +01:00
|
|
|
string add_media_file = 26;
|
2020-02-04 00:07:15 +01:00
|
|
|
Empty sync_media = 27;
|
2020-02-10 08:58:54 +01:00
|
|
|
MediaCheckOut check_media = 28;
|
2020-02-11 08:30:10 +01:00
|
|
|
Empty trash_media_files = 29;
|
2020-02-16 12:07:40 +01:00
|
|
|
string translate_string = 30;
|
2020-02-20 05:16:33 +01:00
|
|
|
string format_time_span = 31;
|
2020-02-21 09:01:15 +01:00
|
|
|
string studied_today = 32;
|
2020-02-21 10:26:45 +01:00
|
|
|
string congrats_learn_msg = 33;
|
2019-12-27 09:14:19 +01:00
|
|
|
|
|
|
|
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 {
|
2020-01-28 12:45:26 +01:00
|
|
|
StringError invalid_input = 1;
|
2020-02-04 00:07:15 +01:00
|
|
|
TemplateParseError template_parse = 2;
|
2020-01-28 12:45:26 +01:00
|
|
|
StringError io_error = 3;
|
2020-01-29 04:17:07 +01:00
|
|
|
StringError db_error = 4;
|
2020-02-04 10:39:31 +01:00
|
|
|
NetworkError network_error = 5;
|
|
|
|
SyncError sync_error = 6;
|
2020-02-02 12:02:20 +01:00
|
|
|
// user interrupted operation
|
|
|
|
Empty interrupted = 8;
|
2019-12-24 04:33:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-04 00:07:15 +01:00
|
|
|
message Progress {
|
|
|
|
oneof value {
|
|
|
|
MediaSyncProgress media_sync = 1;
|
2020-02-16 09:46:51 +01:00
|
|
|
string media_check = 2;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-28 12:45:26 +01:00
|
|
|
message StringError {
|
2019-12-24 05:05:15 +01:00
|
|
|
string info = 1;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TemplateParseError {
|
|
|
|
string info = 1;
|
2019-12-24 05:05:15 +01:00
|
|
|
}
|
|
|
|
|
2020-02-04 10:39:31 +01:00
|
|
|
message NetworkError {
|
|
|
|
string info = 1;
|
|
|
|
enum NetworkErrorKind {
|
|
|
|
OTHER = 0;
|
|
|
|
OFFLINE = 1;
|
|
|
|
TIMEOUT = 2;
|
|
|
|
PROXY_AUTH = 3;
|
|
|
|
}
|
|
|
|
NetworkErrorKind kind = 2;
|
2020-02-17 02:38:22 +01:00
|
|
|
string localized = 3;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SyncError {
|
|
|
|
string info = 1;
|
|
|
|
enum SyncErrorKind {
|
|
|
|
OTHER = 0;
|
|
|
|
CONFLICT = 1;
|
|
|
|
SERVER_ERROR = 2;
|
|
|
|
CLIENT_TOO_OLD = 3;
|
|
|
|
AUTH_FAILED = 4;
|
|
|
|
SERVER_MESSAGE = 5;
|
2020-02-05 04:35:40 +01:00
|
|
|
MEDIA_CHECK_REQUIRED = 6;
|
|
|
|
RESYNC_REQUIRED = 7;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
|
|
|
SyncErrorKind kind = 2;
|
2020-02-17 02:38:22 +01:00
|
|
|
string localized = 3;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
|
|
|
|
2020-02-04 00:07:15 +01:00
|
|
|
message MediaSyncProgress {
|
2020-02-16 09:46:51 +01:00
|
|
|
string checked = 1;
|
|
|
|
string added = 2;
|
|
|
|
string removed = 3;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message MediaSyncUploadProgress {
|
|
|
|
uint32 files = 1;
|
|
|
|
uint32 deletions = 2;
|
|
|
|
}
|
|
|
|
|
2019-12-24 05:05:15 +01:00
|
|
|
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
|
|
|
|
2020-01-12 06:15:46 +01:00
|
|
|
message RenderCardIn {
|
|
|
|
string question_template = 1;
|
|
|
|
string answer_template = 2;
|
|
|
|
map<string,string> fields = 3;
|
|
|
|
int32 card_ordinal = 4;
|
2020-01-08 11:28:04 +01:00
|
|
|
}
|
|
|
|
|
2020-01-12 06:15:46 +01:00
|
|
|
message RenderCardOut {
|
|
|
|
repeated RenderedTemplateNode question_nodes = 1;
|
|
|
|
repeated RenderedTemplateNode answer_nodes = 2;
|
2020-01-08 11:28:04 +01:00
|
|
|
}
|
|
|
|
|
2020-01-10 05:59:29 +01:00
|
|
|
message RenderedTemplateNode {
|
2020-01-08 11:28:04 +01:00
|
|
|
oneof value {
|
|
|
|
string text = 1;
|
2020-01-10 05:59:29 +01:00
|
|
|
RenderedTemplateReplacement replacement = 2;
|
2020-01-08 11:28:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-10 05:59:29 +01:00
|
|
|
message RenderedTemplateReplacement {
|
2020-01-08 11:28:04 +01:00
|
|
|
string field_name = 1;
|
2020-01-10 09:02:26 +01:00
|
|
|
string current_text = 2;
|
|
|
|
repeated string filters = 3;
|
2020-01-08 11:28:04 +01:00
|
|
|
}
|
2020-01-20 10:12:34 +01:00
|
|
|
|
2020-01-24 02:06:11 +01:00
|
|
|
message ExtractAVTagsIn {
|
|
|
|
string text = 1;
|
|
|
|
bool question_side = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ExtractAVTagsOut {
|
|
|
|
string text = 1;
|
|
|
|
repeated AVTag av_tags = 2;
|
2020-01-20 10:12:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message AVTag {
|
|
|
|
oneof value {
|
|
|
|
string sound_or_video = 1;
|
|
|
|
TTSTag tts = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message TTSTag {
|
2020-01-21 03:41:37 +01:00
|
|
|
string field_text = 1;
|
|
|
|
string lang = 2;
|
|
|
|
repeated string voices = 3;
|
2020-01-26 05:28:17 +01:00
|
|
|
float speed = 4;
|
|
|
|
repeated string other_args = 5;
|
2020-01-20 10:12:34 +01:00
|
|
|
}
|
2020-01-28 12:45:26 +01:00
|
|
|
|
2020-02-11 05:20:07 +01:00
|
|
|
message ExtractLatexIn {
|
|
|
|
string text = 1;
|
|
|
|
bool svg = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ExtractLatexOut {
|
|
|
|
string text = 1;
|
|
|
|
repeated ExtractedLatex latex = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ExtractedLatex {
|
|
|
|
string filename = 1;
|
|
|
|
string latex_body = 2;
|
|
|
|
}
|
|
|
|
|
2020-02-11 09:08:34 +01:00
|
|
|
message AddMediaFileIn {
|
2020-01-28 12:45:26 +01:00
|
|
|
string desired_name = 1;
|
|
|
|
bytes data = 2;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SyncMediaIn {
|
|
|
|
string hkey = 1;
|
2020-02-09 03:44:03 +01:00
|
|
|
string endpoint = 2;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
2020-02-10 08:58:54 +01:00
|
|
|
|
|
|
|
message MediaCheckOut {
|
|
|
|
repeated string unused = 1;
|
|
|
|
repeated string missing = 2;
|
2020-02-14 07:15:18 +01:00
|
|
|
string report = 3;
|
2020-02-11 08:30:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TrashMediaFilesIn {
|
|
|
|
repeated string fnames = 1;
|
2020-02-16 12:07:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TranslateStringIn {
|
2020-02-23 03:21:12 +01:00
|
|
|
FluentString key = 2;
|
2020-02-16 12:07:40 +01:00
|
|
|
map<string,TranslateArgValue> args = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TranslateArgValue {
|
|
|
|
oneof value {
|
|
|
|
string str = 1;
|
2020-02-20 01:42:16 +01:00
|
|
|
double number = 2;
|
2020-02-16 12:07:40 +01:00
|
|
|
}
|
|
|
|
}
|
2020-02-20 05:16:33 +01:00
|
|
|
|
|
|
|
message FormatTimeSpanIn {
|
|
|
|
enum Context {
|
2020-02-20 07:07:28 +01:00
|
|
|
NORMAL = 0;
|
|
|
|
ANSWER_BUTTONS = 1;
|
2020-02-20 05:16:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
float seconds = 1;
|
|
|
|
Context context = 2;
|
|
|
|
}
|
2020-02-21 09:01:15 +01:00
|
|
|
|
|
|
|
message StudiedTodayIn {
|
|
|
|
uint32 cards = 1;
|
|
|
|
double seconds = 2;
|
|
|
|
}
|
2020-02-21 10:26:45 +01:00
|
|
|
|
|
|
|
message CongratsLearnMsgIn {
|
|
|
|
float next_due = 1;
|
|
|
|
uint32 remaining = 2;
|
|
|
|
}
|