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-03-22 05:15:02 +01:00
|
|
|
message OptionalInt32 {
|
|
|
|
sint32 val = 1;
|
|
|
|
}
|
|
|
|
|
2020-04-14 01:32:28 +02:00
|
|
|
message OptionalUInt32 {
|
|
|
|
uint32 val = 1;
|
|
|
|
}
|
|
|
|
|
2020-01-30 02:22:34 +01:00
|
|
|
message BackendInit {
|
2020-03-14 00:08:02 +01:00
|
|
|
repeated string preferred_langs = 1;
|
|
|
|
string locale_folder_path = 2;
|
|
|
|
bool server = 3;
|
2020-01-30 02:22:34 +01:00
|
|
|
}
|
|
|
|
|
2020-02-23 05:57:02 +01:00
|
|
|
message I18nBackendInit {
|
|
|
|
repeated string preferred_langs = 4;
|
|
|
|
string locale_folder_path = 5;
|
|
|
|
}
|
|
|
|
|
2020-02-26 23:46:09 +01:00
|
|
|
// 1-15 reserved for future use
|
2019-12-27 09:14:19 +01:00
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
message BackendInput {
|
2019-12-24 04:33:44 +01:00
|
|
|
oneof value {
|
2020-05-11 05:58:40 +02:00
|
|
|
Empty sched_timing_today = 17;
|
2020-05-03 00:43:22 +02:00
|
|
|
DeckTreeIn deck_tree = 18;
|
2020-03-20 22:54:43 +01:00
|
|
|
SearchCardsIn search_cards = 19;
|
2020-03-21 00:00:05 +01:00
|
|
|
SearchNotesIn search_notes = 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;
|
2020-03-10 03:49:40 +01:00
|
|
|
Empty empty_trash = 34;
|
2020-03-10 04:35:09 +01:00
|
|
|
Empty restore_trash = 35;
|
2020-03-14 00:08:02 +01:00
|
|
|
OpenCollectionIn open_collection = 36;
|
2020-03-30 12:01:16 +02:00
|
|
|
CloseCollectionIn close_collection = 37;
|
2020-03-26 08:47:43 +01:00
|
|
|
int64 get_card = 38;
|
2020-03-26 09:54:20 +01:00
|
|
|
Card update_card = 39;
|
2020-03-27 06:11:07 +01:00
|
|
|
Card add_card = 40;
|
2020-03-30 06:39:46 +02:00
|
|
|
int64 get_deck_config = 41;
|
2020-04-03 05:54:52 +02:00
|
|
|
AddOrUpdateDeckConfigIn add_or_update_deck_config = 42;
|
2020-03-30 06:39:46 +02:00
|
|
|
Empty all_deck_config = 43;
|
|
|
|
Empty new_deck_config = 44;
|
|
|
|
int64 remove_deck_config = 45;
|
2020-04-01 01:49:25 +02:00
|
|
|
Empty abort_media_sync = 46;
|
2020-04-03 11:30:42 +02:00
|
|
|
Empty before_upload = 47;
|
|
|
|
RegisterTagsIn register_tags = 48;
|
|
|
|
Empty all_tags = 50;
|
|
|
|
int32 get_changed_tags = 51;
|
2020-04-05 13:38:58 +02:00
|
|
|
string get_config_json = 52;
|
|
|
|
SetConfigJson set_config_json = 53;
|
2020-04-06 01:50:21 +02:00
|
|
|
bytes set_all_config = 54;
|
2020-04-05 13:38:58 +02:00
|
|
|
Empty get_all_config = 55;
|
2020-04-23 02:10:28 +02:00
|
|
|
int32 get_changed_notetypes = 56;
|
|
|
|
AddOrUpdateNotetypeIn add_or_update_notetype = 57;
|
2020-04-09 03:23:53 +02:00
|
|
|
Empty get_all_decks = 58;
|
2020-05-03 04:24:18 +02:00
|
|
|
Empty check_database = 59;
|
2020-04-13 23:30:33 +02:00
|
|
|
Empty all_stock_notetypes = 60;
|
2020-04-23 02:10:28 +02:00
|
|
|
int64 get_notetype_legacy = 61;
|
|
|
|
Empty get_notetype_names = 62;
|
|
|
|
Empty get_notetype_names_and_counts = 63;
|
|
|
|
string get_notetype_id_by_name = 64;
|
|
|
|
int64 remove_notetype = 65;
|
|
|
|
int64 new_note = 66;
|
|
|
|
AddNoteIn add_note = 67;
|
|
|
|
Note update_note = 68;
|
|
|
|
int64 get_note = 69;
|
2020-04-25 10:25:56 +02:00
|
|
|
Empty get_empty_cards = 70;
|
2020-05-02 04:41:53 +02:00
|
|
|
int64 get_deck_legacy = 71;
|
|
|
|
string get_deck_id_by_name = 72;
|
|
|
|
Empty get_deck_names = 73;
|
|
|
|
AddOrUpdateDeckLegacyIn add_or_update_deck_legacy = 74;
|
|
|
|
bool new_deck_legacy = 75;
|
|
|
|
int64 remove_deck = 76;
|
2020-05-03 13:28:35 +02:00
|
|
|
Empty deck_tree_legacy = 77;
|
2020-05-05 12:50:17 +02:00
|
|
|
FieldNamesForNotesIn field_names_for_notes = 78;
|
|
|
|
FindAndReplaceIn find_and_replace = 79;
|
2020-05-06 05:14:57 +02:00
|
|
|
AfterNoteUpdatesIn after_note_updates = 80;
|
2020-05-07 09:54:23 +02:00
|
|
|
AddNoteTagsIn add_note_tags = 81;
|
|
|
|
UpdateNoteTagsIn update_note_tags = 82;
|
2020-05-11 04:11:24 +02:00
|
|
|
int32 set_local_minutes_west = 83;
|
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 {
|
2020-02-26 23:46:09 +01:00
|
|
|
// infallible commands
|
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-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;
|
2020-04-01 01:49:25 +02:00
|
|
|
Empty abort_media_sync = 46;
|
2020-04-13 23:30:33 +02:00
|
|
|
AllStockNotetypesOut all_stock_notetypes = 60;
|
2019-12-27 09:14:19 +01:00
|
|
|
|
2020-02-26 23:46:09 +01:00
|
|
|
// fallible commands
|
2020-05-11 05:58:40 +02:00
|
|
|
SchedTimingTodayOut sched_timing_today = 17;
|
2020-05-03 00:43:22 +02:00
|
|
|
DeckTreeNode deck_tree = 18;
|
2020-03-20 22:54:43 +01:00
|
|
|
SearchCardsOut search_cards = 19;
|
2020-03-21 00:00:05 +01:00
|
|
|
SearchNotesOut search_notes = 20;
|
2020-02-26 23:46:09 +01:00
|
|
|
RenderCardOut render_card = 21;
|
|
|
|
string add_media_file = 26;
|
|
|
|
Empty sync_media = 27;
|
|
|
|
MediaCheckOut check_media = 28;
|
|
|
|
Empty trash_media_files = 29;
|
2020-03-10 03:49:40 +01:00
|
|
|
Empty empty_trash = 34;
|
2020-03-10 04:35:09 +01:00
|
|
|
Empty restore_trash = 35;
|
2020-03-14 00:08:02 +01:00
|
|
|
Empty open_collection = 36;
|
|
|
|
Empty close_collection = 37;
|
2020-03-26 08:47:43 +01:00
|
|
|
GetCardOut get_card = 38;
|
2020-03-26 09:54:20 +01:00
|
|
|
Empty update_card = 39;
|
2020-03-27 06:11:07 +01:00
|
|
|
int64 add_card = 40;
|
2020-04-06 01:59:32 +02:00
|
|
|
bytes get_deck_config = 41;
|
2020-03-30 06:39:46 +02:00
|
|
|
int64 add_or_update_deck_config = 42;
|
2020-04-06 01:59:32 +02:00
|
|
|
bytes all_deck_config = 43;
|
|
|
|
bytes new_deck_config = 44;
|
2020-03-30 06:39:46 +02:00
|
|
|
Empty remove_deck_config = 45;
|
2020-04-03 11:30:42 +02:00
|
|
|
Empty before_upload = 47;
|
|
|
|
bool register_tags = 48;
|
|
|
|
AllTagsOut all_tags = 50;
|
|
|
|
GetChangedTagsOut get_changed_tags = 51;
|
2020-04-06 01:50:21 +02:00
|
|
|
bytes get_config_json = 52;
|
2020-04-05 13:38:58 +02:00
|
|
|
Empty set_config_json = 53;
|
|
|
|
Empty set_all_config = 54;
|
2020-04-06 01:50:21 +02:00
|
|
|
bytes get_all_config = 55;
|
2020-04-23 02:10:28 +02:00
|
|
|
bytes get_changed_notetypes = 56;
|
|
|
|
int64 add_or_update_notetype = 57;
|
2020-04-09 03:23:53 +02:00
|
|
|
bytes get_all_decks = 58;
|
2020-05-10 05:50:04 +02:00
|
|
|
CheckDatabaseOut check_database = 59;
|
2020-04-23 02:10:28 +02:00
|
|
|
bytes get_notetype_legacy = 61;
|
|
|
|
NoteTypeNames get_notetype_names = 62;
|
|
|
|
NoteTypeUseCounts get_notetype_names_and_counts = 63;
|
|
|
|
int64 get_notetype_id_by_name = 64;
|
|
|
|
Empty remove_notetype = 65;
|
|
|
|
Note new_note = 66;
|
|
|
|
int64 add_note = 67;
|
|
|
|
Empty update_note = 68;
|
|
|
|
Note get_note = 69;
|
2020-04-25 10:25:56 +02:00
|
|
|
EmptyCardsReport get_empty_cards = 70;
|
2020-05-02 04:41:53 +02:00
|
|
|
bytes get_deck_legacy = 71;
|
|
|
|
int64 get_deck_id_by_name = 72;
|
|
|
|
DeckNames get_deck_names = 73;
|
|
|
|
int64 add_or_update_deck_legacy = 74;
|
|
|
|
bytes new_deck_legacy = 75;
|
|
|
|
Empty remove_deck = 76;
|
2020-05-03 13:28:35 +02:00
|
|
|
bytes deck_tree_legacy = 77;
|
2020-05-05 12:50:17 +02:00
|
|
|
FieldNamesForNotesOut field_names_for_notes = 78;
|
|
|
|
uint32 find_and_replace = 79;
|
2020-05-06 05:14:57 +02:00
|
|
|
Empty after_note_updates = 80;
|
2020-05-07 09:54:23 +02:00
|
|
|
uint32 add_note_tags = 81;
|
|
|
|
uint32 update_note_tags = 82;
|
2020-05-11 04:11:24 +02:00
|
|
|
Empty set_local_minutes_west = 83;
|
2020-02-26 23:46:09 +01:00
|
|
|
|
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 {
|
2020-02-27 01:46:24 +01:00
|
|
|
// localized error description suitable for displaying to the user
|
|
|
|
string localized = 1;
|
|
|
|
// error specifics
|
2019-12-24 04:33:44 +01:00
|
|
|
oneof value {
|
2020-02-27 01:53:49 +01:00
|
|
|
Empty invalid_input = 2;
|
|
|
|
Empty template_parse = 3;
|
|
|
|
Empty io_error = 4;
|
|
|
|
Empty db_error = 5;
|
2020-02-27 01:46:24 +01:00
|
|
|
NetworkError network_error = 6;
|
|
|
|
SyncError sync_error = 7;
|
2020-02-02 12:02:20 +01:00
|
|
|
// user interrupted operation
|
|
|
|
Empty interrupted = 8;
|
2020-04-06 08:29:31 +02:00
|
|
|
string json_error = 9;
|
2020-04-12 09:45:21 +02:00
|
|
|
string proto_error = 10;
|
2020-04-23 02:10:28 +02:00
|
|
|
Empty not_found_error = 11;
|
2020-05-02 04:41:53 +02:00
|
|
|
Empty exists = 12;
|
|
|
|
Empty deck_is_filtered = 13;
|
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-02-04 10:39:31 +01:00
|
|
|
message NetworkError {
|
|
|
|
enum NetworkErrorKind {
|
|
|
|
OTHER = 0;
|
|
|
|
OFFLINE = 1;
|
|
|
|
TIMEOUT = 2;
|
|
|
|
PROXY_AUTH = 3;
|
|
|
|
}
|
2020-02-27 01:53:49 +01:00
|
|
|
NetworkErrorKind kind = 1;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SyncError {
|
|
|
|
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
|
|
|
}
|
2020-02-27 01:53:49 +01:00
|
|
|
SyncErrorKind kind = 1;
|
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-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
|
|
|
|
2020-05-03 00:43:22 +02:00
|
|
|
message DeckTreeIn {
|
|
|
|
bool include_counts = 1;
|
2020-01-06 03:18:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeckTreeNode {
|
2020-05-03 00:43:22 +02:00
|
|
|
int64 deck_id = 1;
|
|
|
|
string name = 2;
|
|
|
|
repeated DeckTreeNode children = 3;
|
|
|
|
uint32 level = 4;
|
|
|
|
bool collapsed = 5;
|
|
|
|
|
|
|
|
uint32 review_count = 6;
|
|
|
|
uint32 learn_count = 7;
|
|
|
|
uint32 new_count = 8;
|
2020-01-06 03:18:20 +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;
|
2020-02-24 09:34:08 +01:00
|
|
|
bool expand_clozes = 3;
|
2020-02-11 05:20:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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-03-10 03:49:40 +01:00
|
|
|
bool have_trash = 4;
|
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-25 08:29:06 +01:00
|
|
|
PRECISE = 0;
|
2020-02-20 07:07:28 +01:00
|
|
|
ANSWER_BUTTONS = 1;
|
2020-02-25 08:29:06 +01:00
|
|
|
INTERVALS = 2;
|
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;
|
2020-03-09 09:58:49 +01:00
|
|
|
}
|
2020-03-14 00:08:02 +01:00
|
|
|
|
|
|
|
message OpenCollectionIn {
|
|
|
|
string collection_path = 1;
|
|
|
|
string media_folder_path = 2;
|
|
|
|
string media_db_path = 3;
|
|
|
|
string log_path = 4;
|
|
|
|
}
|
2020-03-19 23:20:47 +01:00
|
|
|
|
|
|
|
message SearchCardsIn {
|
|
|
|
string search = 1;
|
2020-03-20 22:54:43 +01:00
|
|
|
SortOrder order = 2;
|
2020-03-19 23:20:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SearchCardsOut {
|
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
|
|
|
|
}
|
2020-03-20 22:54:43 +01:00
|
|
|
|
|
|
|
message SortOrder {
|
|
|
|
oneof value {
|
|
|
|
Empty from_config = 1;
|
|
|
|
Empty none = 2;
|
|
|
|
string custom = 3;
|
2020-03-22 03:59:24 +01:00
|
|
|
BuiltinSearchOrder builtin = 4;
|
2020-03-20 22:54:43 +01:00
|
|
|
}
|
|
|
|
}
|
2020-03-21 00:00:05 +01:00
|
|
|
|
|
|
|
message SearchNotesIn {
|
|
|
|
string search = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SearchNotesOut {
|
|
|
|
repeated int64 note_ids = 2;
|
|
|
|
}
|
2020-03-22 03:59:24 +01:00
|
|
|
|
|
|
|
message BuiltinSearchOrder {
|
2020-04-14 12:27:33 +02:00
|
|
|
enum BuiltinSortKind {
|
|
|
|
NOTE_CREATION = 0;
|
|
|
|
NOTE_MOD = 1;
|
|
|
|
NOTE_FIELD = 2;
|
|
|
|
NOTE_TAGS = 3;
|
|
|
|
NOTE_TYPE = 4;
|
|
|
|
CARD_MOD = 5;
|
|
|
|
CARD_REPS = 6;
|
|
|
|
CARD_DUE = 7;
|
|
|
|
CARD_EASE = 8;
|
|
|
|
CARD_LAPSES = 9;
|
|
|
|
CARD_INTERVAL = 10;
|
|
|
|
CARD_DECK = 11;
|
|
|
|
CARD_TEMPLATE = 12;
|
|
|
|
}
|
2020-03-22 03:59:24 +01:00
|
|
|
BuiltinSortKind kind = 1;
|
|
|
|
bool reverse = 2;
|
|
|
|
}
|
|
|
|
|
2020-03-26 08:47:43 +01:00
|
|
|
|
|
|
|
message GetCardOut {
|
|
|
|
Card card = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Card {
|
|
|
|
int64 id = 1;
|
|
|
|
int64 nid = 2;
|
|
|
|
int64 did = 3;
|
|
|
|
uint32 ord = 4;
|
|
|
|
int64 mtime = 5;
|
|
|
|
sint32 usn = 6;
|
|
|
|
uint32 ctype = 7;
|
|
|
|
sint32 queue = 8;
|
2020-03-26 11:55:04 +01:00
|
|
|
sint32 due = 9;
|
|
|
|
uint32 ivl = 10;
|
2020-03-26 08:47:43 +01:00
|
|
|
uint32 factor = 11;
|
2020-03-26 11:55:04 +01:00
|
|
|
uint32 reps = 12;
|
|
|
|
uint32 lapses = 13;
|
|
|
|
uint32 left = 14;
|
|
|
|
sint32 odue = 15;
|
2020-03-26 08:47:43 +01:00
|
|
|
int64 odid = 16;
|
2020-03-26 11:55:04 +01:00
|
|
|
uint32 flags = 17;
|
2020-03-26 08:47:43 +01:00
|
|
|
string data = 18;
|
|
|
|
}
|
2020-03-30 12:01:16 +02:00
|
|
|
|
|
|
|
message CloseCollectionIn {
|
|
|
|
bool downgrade_to_schema11 = 1;
|
|
|
|
}
|
2020-04-03 05:54:52 +02:00
|
|
|
|
|
|
|
message AddOrUpdateDeckConfigIn {
|
2020-04-06 01:59:32 +02:00
|
|
|
bytes config = 1;
|
2020-04-03 05:54:52 +02:00
|
|
|
bool preserve_usn_and_mtime = 2;
|
|
|
|
}
|
2020-04-03 11:30:42 +02:00
|
|
|
|
|
|
|
message RegisterTagsIn {
|
|
|
|
string tags = 1;
|
|
|
|
bool preserve_usn = 2;
|
|
|
|
int32 usn = 3;
|
|
|
|
bool clear_first = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AllTagsOut {
|
|
|
|
repeated TagUsnTuple tags = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TagUsnTuple {
|
|
|
|
string tag = 1;
|
|
|
|
sint32 usn = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetChangedTagsOut {
|
|
|
|
repeated string tags = 1;
|
|
|
|
}
|
|
|
|
|
2020-04-05 13:38:58 +02:00
|
|
|
message SetConfigJson {
|
|
|
|
string key = 1;
|
|
|
|
oneof op {
|
2020-04-06 01:50:21 +02:00
|
|
|
bytes val = 2;
|
2020-04-05 13:38:58 +02:00
|
|
|
Empty remove = 3;
|
|
|
|
}
|
|
|
|
}
|
2020-04-12 09:45:21 +02:00
|
|
|
|
|
|
|
message NoteFieldConfig {
|
|
|
|
bool sticky = 1;
|
|
|
|
bool rtl = 2;
|
|
|
|
string font_name = 3;
|
|
|
|
uint32 font_size = 4;
|
|
|
|
bytes other = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteField {
|
2020-04-14 01:32:28 +02:00
|
|
|
OptionalUInt32 ord = 1;
|
2020-04-12 09:45:21 +02:00
|
|
|
string name = 2;
|
|
|
|
NoteFieldConfig config = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CardTemplateConfig {
|
|
|
|
string q_format = 1;
|
|
|
|
string a_format = 2;
|
|
|
|
string q_format_browser = 3;
|
|
|
|
string a_format_browser= 4;
|
|
|
|
int64 target_deck_id = 5;
|
|
|
|
string browser_font_name = 6;
|
|
|
|
uint32 browser_font_size = 7;
|
|
|
|
bytes other = 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CardTemplate {
|
2020-04-14 01:58:30 +02:00
|
|
|
OptionalUInt32 ord = 1;
|
2020-04-12 09:45:21 +02:00
|
|
|
string name = 2;
|
|
|
|
uint32 mtime_secs = 3;
|
|
|
|
sint32 usn = 4;
|
|
|
|
CardTemplateConfig config = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeConfig {
|
2020-04-17 06:54:26 +02:00
|
|
|
enum Kind {
|
|
|
|
NORMAL = 0;
|
|
|
|
CLOZE = 1;
|
|
|
|
}
|
|
|
|
Kind kind = 1;
|
2020-04-12 09:45:21 +02:00
|
|
|
uint32 sort_field_idx = 2;
|
|
|
|
string css = 3;
|
|
|
|
// fixme: anki currently sets this without flushing
|
|
|
|
int64 target_deck_id = 4;
|
|
|
|
string latex_pre = 5;
|
|
|
|
string latex_post = 6;
|
|
|
|
bool latex_svg = 7;
|
|
|
|
repeated CardRequirement reqs = 8;
|
|
|
|
bytes other = 9;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CardRequirement {
|
2020-04-17 06:54:26 +02:00
|
|
|
enum Kind {
|
2020-04-13 11:14:30 +02:00
|
|
|
None = 0;
|
|
|
|
Any = 1;
|
|
|
|
All = 2;
|
|
|
|
}
|
2020-04-12 09:45:21 +02:00
|
|
|
uint32 card_ord = 1;
|
2020-04-17 06:54:26 +02:00
|
|
|
Kind kind = 2;
|
2020-04-12 09:45:21 +02:00
|
|
|
repeated uint32 field_ords = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteType {
|
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
uint32 mtime_secs = 3;
|
|
|
|
sint32 usn = 4;
|
|
|
|
NoteTypeConfig config = 7;
|
|
|
|
repeated NoteField fields = 8;
|
|
|
|
repeated CardTemplate templates = 9;
|
|
|
|
}
|
2020-04-13 11:14:30 +02:00
|
|
|
|
|
|
|
enum StockNoteType {
|
|
|
|
StockNoteTypeBasic = 0;
|
|
|
|
StockNoteTypeBasicAndReversed = 1;
|
|
|
|
StockNoteTypeBasicOptionalReversed = 2;
|
|
|
|
StockNoteTypeBasicTyping = 3;
|
|
|
|
StockNoteTypeCloze = 4;
|
|
|
|
}
|
2020-04-13 23:30:33 +02:00
|
|
|
|
|
|
|
message AllStockNotetypesOut {
|
|
|
|
repeated NoteType notetypes = 1;
|
|
|
|
}
|
2020-04-23 02:10:28 +02:00
|
|
|
|
|
|
|
message NoteTypeNames {
|
|
|
|
repeated NoteTypeNameID entries = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeUseCounts {
|
|
|
|
repeated NoteTypeNameIDUseCount entries = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeNameID {
|
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeNameIDUseCount {
|
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
uint32 use_count = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AddOrUpdateNotetypeIn {
|
|
|
|
bytes json = 1;
|
|
|
|
bool preserve_usn_and_mtime = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Note {
|
|
|
|
int64 id = 1;
|
|
|
|
string guid = 2;
|
|
|
|
int64 ntid = 3;
|
|
|
|
uint32 mtime_secs = 4;
|
|
|
|
int32 usn = 5;
|
|
|
|
repeated string tags = 6;
|
|
|
|
repeated string fields = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AddNoteIn {
|
|
|
|
Note note = 1;
|
|
|
|
int64 deck_id = 2;
|
|
|
|
}
|
2020-04-25 10:25:56 +02:00
|
|
|
|
|
|
|
message EmptyCardsReport {
|
|
|
|
string report = 1;
|
|
|
|
repeated NoteWithEmptyCards notes = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message NoteWithEmptyCards {
|
|
|
|
int64 note_id = 1;
|
|
|
|
repeated int64 card_ids = 2;
|
|
|
|
bool will_delete_note = 3;
|
|
|
|
}
|
2020-05-02 04:41:53 +02:00
|
|
|
|
|
|
|
message Deck {
|
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
uint32 mtime_secs = 3;
|
|
|
|
int32 usn = 4;
|
|
|
|
DeckCommon common = 5;
|
|
|
|
oneof kind {
|
|
|
|
NormalDeck normal = 6;
|
|
|
|
FilteredDeck filtered = 7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeckCommon {
|
2020-05-03 01:44:36 +02:00
|
|
|
bool study_collapsed = 1;
|
|
|
|
bool browser_collapsed = 2;
|
|
|
|
|
|
|
|
uint32 last_day_studied = 3;
|
|
|
|
int32 new_studied = 4;
|
|
|
|
int32 review_studied = 5;
|
|
|
|
int32 learning_studied = 6;
|
|
|
|
int32 secs_studied = 7;
|
|
|
|
|
2020-05-02 04:41:53 +02:00
|
|
|
bytes other = 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeckKind {
|
|
|
|
oneof kind {
|
|
|
|
NormalDeck normal = 1;
|
|
|
|
FilteredDeck filtered = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message NormalDeck {
|
|
|
|
int64 config_id = 1;
|
|
|
|
uint32 extend_new = 2;
|
|
|
|
uint32 extend_review = 3;
|
|
|
|
string description = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FilteredDeck {
|
|
|
|
bool reschedule = 1;
|
|
|
|
repeated FilteredSearchTerm search_terms = 2;
|
|
|
|
// v1 scheduler only
|
|
|
|
repeated float delays = 3;
|
|
|
|
// v2 scheduler only
|
|
|
|
uint32 preview_delay = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FilteredSearchTerm {
|
|
|
|
string search = 1;
|
|
|
|
uint32 limit = 2;
|
|
|
|
FilteredSearchOrder order = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum FilteredSearchOrder {
|
|
|
|
FILTERED_SEARCH_ORDER_OLDEST_FIRST = 0;
|
|
|
|
FILTERED_SEARCH_ORDER_RANDOM = 1;
|
|
|
|
FILTERED_SEARCH_ORDER_INTERVALS_ASCENDING = 2;
|
|
|
|
FILTERED_SEARCH_ORDER_INTERVALS_DESCENDING = 3;
|
|
|
|
FILTERED_SEARCH_ORDER_LAPSES = 4;
|
|
|
|
FILTERED_SEARCH_ORDER_ADDED = 5;
|
|
|
|
FILTERED_SEARCH_ORDER_DUE = 6;
|
|
|
|
FILTERED_SEARCH_ORDER_REVERSE_ADDED = 7;
|
|
|
|
FILTERED_SEARCH_ORDER_DUE_PRIORITY = 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeckNames {
|
|
|
|
repeated DeckNameID entries = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeckNameID {
|
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AddOrUpdateDeckLegacyIn {
|
|
|
|
bytes deck = 1;
|
|
|
|
bool preserve_usn_and_mtime = 2;
|
|
|
|
}
|
2020-05-03 00:43:22 +02:00
|
|
|
|
2020-05-05 12:50:17 +02:00
|
|
|
message FieldNamesForNotesIn {
|
|
|
|
repeated int64 nids = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FieldNamesForNotesOut {
|
|
|
|
repeated string fields = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message FindAndReplaceIn {
|
|
|
|
repeated int64 nids = 1;
|
|
|
|
string search = 2;
|
|
|
|
string replacement = 3;
|
|
|
|
bool regex = 4;
|
|
|
|
bool match_case = 5;
|
|
|
|
string field_name = 6;
|
|
|
|
}
|
2020-05-06 05:14:57 +02:00
|
|
|
|
|
|
|
message AfterNoteUpdatesIn {
|
|
|
|
repeated int64 nids = 1;
|
|
|
|
bool mark_notes_modified = 2;
|
|
|
|
bool generate_cards = 3;
|
|
|
|
}
|
2020-05-07 09:54:23 +02:00
|
|
|
|
|
|
|
message AddNoteTagsIn {
|
|
|
|
repeated int64 nids = 1;
|
|
|
|
string tags = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateNoteTagsIn {
|
|
|
|
repeated int64 nids = 1;
|
|
|
|
string tags = 2;
|
|
|
|
string replacement = 3;
|
|
|
|
bool regex = 4;
|
|
|
|
}
|
2020-05-10 05:50:04 +02:00
|
|
|
|
|
|
|
message CheckDatabaseOut {
|
|
|
|
repeated string problems = 1;
|
|
|
|
}
|