2019-12-24 04:33:44 +01:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2020-06-17 07:27:08 +02:00
|
|
|
package BackendProto;
|
2019-12-24 04:33:44 +01:00
|
|
|
|
2020-05-22 13:25:25 +02:00
|
|
|
// Generic containers
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2019-12-24 04:33:44 +01:00
|
|
|
message Empty {}
|
|
|
|
|
2020-03-22 05:15:02 +01:00
|
|
|
message OptionalInt32 {
|
2021-01-09 06:50:24 +01:00
|
|
|
sint32 val = 1;
|
2020-03-22 05:15:02 +01:00
|
|
|
}
|
|
|
|
|
2020-04-14 01:32:28 +02:00
|
|
|
message OptionalUInt32 {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 val = 1;
|
2020-04-14 01:32:28 +02:00
|
|
|
}
|
|
|
|
|
2020-05-22 13:25:25 +02:00
|
|
|
message Int32 {
|
2021-01-09 06:50:24 +01:00
|
|
|
sint32 val = 1;
|
2020-05-22 13:25:25 +02:00
|
|
|
}
|
|
|
|
|
2020-05-23 08:19:48 +02:00
|
|
|
message UInt32 {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 val = 1;
|
2020-05-23 08:19:48 +02:00
|
|
|
}
|
|
|
|
|
2020-05-22 13:25:25 +02:00
|
|
|
message Int64 {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 val = 1;
|
2020-05-22 13:25:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message String {
|
2021-01-09 06:50:24 +01:00
|
|
|
string val = 1;
|
2020-05-22 13:25:25 +02:00
|
|
|
}
|
|
|
|
|
2020-05-23 08:56:05 +02:00
|
|
|
message Json {
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes json = 1;
|
2020-05-23 04:58:13 +02:00
|
|
|
}
|
|
|
|
|
2020-05-23 07:09:16 +02:00
|
|
|
message Bool {
|
2021-01-09 06:50:24 +01:00
|
|
|
bool val = 1;
|
2020-05-23 07:09:16 +02:00
|
|
|
}
|
|
|
|
|
2020-05-23 08:56:05 +02:00
|
|
|
// IDs used in RPC calls
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2020-05-23 08:19:48 +02:00
|
|
|
message NoteTypeID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 ntid = 1;
|
2020-05-23 08:19:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 nid = 1;
|
2020-05-23 08:19:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message CardID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 cid = 1;
|
2020-05-23 08:19:48 +02:00
|
|
|
}
|
|
|
|
|
2020-08-29 14:02:22 +02:00
|
|
|
message CardIDs {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 cids = 1;
|
2020-08-29 14:02:22 +02:00
|
|
|
}
|
|
|
|
|
2020-05-23 08:56:05 +02:00
|
|
|
message DeckID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 did = 1;
|
2020-05-23 08:56:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeckConfigID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 dcid = 1;
|
2020-05-23 08:56:05 +02:00
|
|
|
}
|
2020-05-23 08:19:48 +02:00
|
|
|
|
2020-05-22 13:25:25 +02:00
|
|
|
// New style RPC definitions
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2020-05-22 12:02:10 +02:00
|
|
|
service BackendService {
|
2021-01-09 15:48:34 +01:00
|
|
|
rpc LatestProgress(Empty) returns (Progress);
|
|
|
|
rpc SetWantsAbort(Empty) returns (Empty);
|
|
|
|
|
|
|
|
// card rendering
|
|
|
|
|
|
|
|
rpc ExtractAVTags(ExtractAVTagsIn) returns (ExtractAVTagsOut);
|
|
|
|
rpc ExtractLatex(ExtractLatexIn) returns (ExtractLatexOut);
|
|
|
|
rpc GetEmptyCards(Empty) returns (EmptyCardsReport);
|
|
|
|
rpc RenderExistingCard(RenderExistingCardIn) returns (RenderCardOut);
|
|
|
|
rpc RenderUncommittedCard(RenderUncommittedCardIn) returns (RenderCardOut);
|
|
|
|
rpc StripAVTags(String) returns (String);
|
|
|
|
|
|
|
|
// searching
|
|
|
|
|
|
|
|
rpc NormalizeSearch(String) returns (String);
|
|
|
|
rpc SearchCards(SearchCardsIn) returns (SearchCardsOut);
|
|
|
|
rpc SearchNotes(SearchNotesIn) returns (SearchNotesOut);
|
|
|
|
rpc NegateSearch(String) returns (String);
|
|
|
|
rpc ConcatenateSearches(ConcatenateSearchesIn) returns (String);
|
|
|
|
rpc ReplaceSearchTerm(ReplaceSearchTermIn) returns (String);
|
|
|
|
rpc FindAndReplace(FindAndReplaceIn) returns (UInt32);
|
|
|
|
|
|
|
|
// scheduling
|
|
|
|
|
|
|
|
rpc LocalMinutesWest(Int64) returns (Int32);
|
|
|
|
rpc SetLocalMinutesWest(Int32) returns (Empty);
|
|
|
|
rpc SchedTimingToday(Empty) returns (SchedTimingTodayOut);
|
|
|
|
rpc StudiedToday(Empty) returns (String);
|
|
|
|
rpc StudiedTodayMessage(StudiedTodayMessageIn) returns (String);
|
|
|
|
rpc UpdateStats(UpdateStatsIn) returns (Empty);
|
|
|
|
rpc ExtendLimits(ExtendLimitsIn) returns (Empty);
|
|
|
|
rpc CountsForDeckToday(DeckID) returns (CountsForDeckTodayOut);
|
|
|
|
rpc CongratsInfo(Empty) returns (CongratsInfoOut);
|
|
|
|
rpc RestoreBuriedAndSuspendedCards(CardIDs) returns (Empty);
|
|
|
|
rpc UnburyCardsInCurrentDeck(UnburyCardsInCurrentDeckIn) returns (Empty);
|
|
|
|
rpc BuryOrSuspendCards(BuryOrSuspendCardsIn) returns (Empty);
|
|
|
|
rpc EmptyFilteredDeck(DeckID) returns (Empty);
|
|
|
|
rpc RebuildFilteredDeck(DeckID) returns (UInt32);
|
|
|
|
rpc ScheduleCardsAsReviews(ScheduleCardsAsReviewsIn) returns (Empty);
|
|
|
|
rpc ScheduleCardsAsNew(ScheduleCardsAsNewIn) returns (Empty);
|
|
|
|
rpc SortCards(SortCardsIn) returns (Empty);
|
|
|
|
rpc SortDeck(SortDeckIn) returns (Empty);
|
|
|
|
|
|
|
|
// stats
|
|
|
|
|
|
|
|
rpc CardStats(CardID) returns (String);
|
|
|
|
rpc Graphs(GraphsIn) returns (GraphsOut);
|
|
|
|
|
|
|
|
// media
|
|
|
|
|
|
|
|
rpc CheckMedia(Empty) returns (CheckMediaOut);
|
|
|
|
rpc TrashMediaFiles(TrashMediaFilesIn) returns (Empty);
|
|
|
|
rpc AddMediaFile(AddMediaFileIn) returns (String);
|
|
|
|
rpc EmptyTrash(Empty) returns (Empty);
|
|
|
|
rpc RestoreTrash(Empty) returns (Empty);
|
|
|
|
|
|
|
|
// decks
|
|
|
|
|
|
|
|
rpc AddOrUpdateDeckLegacy(AddOrUpdateDeckLegacyIn) returns (DeckID);
|
|
|
|
rpc DeckTree(DeckTreeIn) returns (DeckTreeNode);
|
|
|
|
rpc DeckTreeLegacy(Empty) returns (Json);
|
|
|
|
rpc GetAllDecksLegacy(Empty) returns (Json);
|
|
|
|
rpc GetDeckIDByName(String) returns (DeckID);
|
|
|
|
rpc GetDeckLegacy(DeckID) returns (Json);
|
|
|
|
rpc GetDeckNames(GetDeckNamesIn) returns (DeckNames);
|
|
|
|
rpc NewDeckLegacy(Bool) returns (Json);
|
|
|
|
rpc RemoveDeck(DeckID) returns (Empty);
|
|
|
|
|
|
|
|
// deck config
|
|
|
|
|
|
|
|
rpc AddOrUpdateDeckConfigLegacy(AddOrUpdateDeckConfigLegacyIn)
|
|
|
|
returns (DeckConfigID);
|
|
|
|
rpc AllDeckConfigLegacy(Empty) returns (Json);
|
|
|
|
rpc GetDeckConfigLegacy(DeckConfigID) returns (Json);
|
|
|
|
rpc NewDeckConfigLegacy(Empty) returns (Json);
|
|
|
|
rpc RemoveDeckConfig(DeckConfigID) returns (Empty);
|
|
|
|
|
|
|
|
// cards
|
|
|
|
|
|
|
|
rpc GetCard(CardID) returns (Card);
|
|
|
|
rpc UpdateCard(Card) returns (Empty);
|
|
|
|
rpc AddCard(Card) returns (CardID);
|
|
|
|
rpc RemoveCards(RemoveCardsIn) returns (Empty);
|
|
|
|
rpc SetDeck(SetDeckIn) returns (Empty);
|
|
|
|
|
|
|
|
// notes
|
|
|
|
|
|
|
|
rpc NewNote(NoteTypeID) returns (Note);
|
|
|
|
rpc AddNote(AddNoteIn) returns (NoteID);
|
|
|
|
rpc UpdateNote(Note) returns (Empty);
|
|
|
|
rpc GetNote(NoteID) returns (Note);
|
|
|
|
rpc RemoveNotes(RemoveNotesIn) returns (Empty);
|
|
|
|
rpc AddNoteTags(AddNoteTagsIn) returns (UInt32);
|
|
|
|
rpc UpdateNoteTags(UpdateNoteTagsIn) returns (UInt32);
|
|
|
|
rpc GetNoteTags(GetNoteTagsIn) returns (GetNoteTagsOut);
|
|
|
|
rpc ClozeNumbersInNote(Note) returns (ClozeNumbersInNoteOut);
|
|
|
|
rpc AfterNoteUpdates(AfterNoteUpdatesIn) returns (Empty);
|
|
|
|
rpc FieldNamesForNotes(FieldNamesForNotesIn) returns (FieldNamesForNotesOut);
|
|
|
|
rpc NoteIsDuplicateOrEmpty(Note) returns (NoteIsDuplicateOrEmptyOut);
|
|
|
|
rpc CardsOfNote(NoteID) returns (CardIDs);
|
|
|
|
|
|
|
|
// note types
|
|
|
|
|
|
|
|
rpc AddOrUpdateNotetype(AddOrUpdateNotetypeIn) returns (NoteTypeID);
|
|
|
|
rpc GetStockNotetypeLegacy(GetStockNotetypeIn) returns (Json);
|
|
|
|
rpc GetNotetypeLegacy(NoteTypeID) returns (Json);
|
|
|
|
rpc GetNotetypeNames(Empty) returns (NoteTypeNames);
|
|
|
|
rpc GetNotetypeNamesAndCounts(Empty) returns (NoteTypeUseCounts);
|
|
|
|
rpc GetNotetypeIDByName(String) returns (NoteTypeID);
|
|
|
|
rpc RemoveNotetype(NoteTypeID) returns (Empty);
|
|
|
|
|
|
|
|
// collection
|
|
|
|
|
|
|
|
rpc OpenCollection(OpenCollectionIn) returns (Empty);
|
|
|
|
rpc CloseCollection(CloseCollectionIn) returns (Empty);
|
|
|
|
rpc CheckDatabase(Empty) returns (CheckDatabaseOut);
|
|
|
|
|
|
|
|
// sync
|
|
|
|
|
|
|
|
rpc SyncMedia(SyncAuth) returns (Empty);
|
|
|
|
rpc AbortSync(Empty) returns (Empty);
|
|
|
|
rpc AbortMediaSync(Empty) returns (Empty);
|
|
|
|
rpc BeforeUpload(Empty) returns (Empty);
|
|
|
|
rpc SyncLogin(SyncLoginIn) returns (SyncAuth);
|
|
|
|
rpc SyncStatus(SyncAuth) returns (SyncStatusOut);
|
|
|
|
rpc SyncCollection(SyncAuth) returns (SyncCollectionOut);
|
|
|
|
rpc FullUpload(SyncAuth) returns (Empty);
|
|
|
|
rpc FullDownload(SyncAuth) returns (Empty);
|
|
|
|
|
|
|
|
// translation/messages
|
|
|
|
|
|
|
|
rpc TranslateString(TranslateStringIn) returns (String);
|
|
|
|
rpc FormatTimespan(FormatTimespanIn) returns (String);
|
|
|
|
rpc I18nResources(Empty) returns (Json);
|
|
|
|
|
|
|
|
// tags
|
|
|
|
|
|
|
|
rpc RegisterTags(RegisterTagsIn) returns (Bool);
|
|
|
|
rpc AllTags(Empty) returns (AllTagsOut);
|
|
|
|
rpc SetTagCollapsed(SetTagCollapsedIn) returns (Bool);
|
|
|
|
rpc ClearTag(String) returns (Bool);
|
|
|
|
rpc TagTree(Empty) returns (TagTreeNode);
|
|
|
|
|
|
|
|
// config/preferences
|
|
|
|
|
|
|
|
rpc GetConfigJson(String) returns (Json);
|
|
|
|
rpc SetConfigJson(SetConfigJsonIn) returns (Empty);
|
|
|
|
rpc RemoveConfig(String) returns (Empty);
|
|
|
|
rpc SetAllConfig(Json) returns (Empty);
|
|
|
|
rpc GetAllConfig(Empty) returns (Json);
|
|
|
|
rpc GetPreferences(Empty) returns (Preferences);
|
|
|
|
rpc SetPreferences(Preferences) returns (Empty);
|
2020-05-22 12:02:10 +02:00
|
|
|
}
|
|
|
|
|
2020-05-18 00:57:30 +02:00
|
|
|
// Protobuf stored in .anki2 files
|
|
|
|
// These should be moved to a separate file in the future
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
message DeckConfigInner {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum NewCardOrder {
|
|
|
|
NEW_CARD_ORDER_DUE = 0;
|
|
|
|
NEW_CARD_ORDER_RANDOM = 1;
|
|
|
|
}
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
enum LeechAction {
|
|
|
|
LEECH_ACTION_SUSPEND = 0;
|
|
|
|
LEECH_ACTION_TAG_ONLY = 1;
|
|
|
|
}
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated float learn_steps = 1;
|
|
|
|
repeated float relearn_steps = 2;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
reserved 3 to 8;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 new_per_day = 9;
|
|
|
|
uint32 reviews_per_day = 10;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
float initial_ease = 11;
|
|
|
|
float easy_multiplier = 12;
|
|
|
|
float hard_multiplier = 13;
|
|
|
|
float lapse_multiplier = 14;
|
|
|
|
float interval_multiplier = 15;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 maximum_review_interval = 16;
|
|
|
|
uint32 minimum_review_interval = 17;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 graduating_interval_good = 18;
|
|
|
|
uint32 graduating_interval_easy = 19;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
NewCardOrder new_card_order = 20;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
LeechAction leech_action = 21;
|
|
|
|
uint32 leech_threshold = 22;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bool disable_autoplay = 23;
|
|
|
|
uint32 cap_answer_time_to_secs = 24;
|
|
|
|
uint32 visible_timer_secs = 25;
|
|
|
|
bool skip_question_when_replaying_answer = 26;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bool bury_new = 27;
|
|
|
|
bool bury_reviews = 28;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes other = 255;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeckCommon {
|
2021-01-09 06:50:24 +01:00
|
|
|
bool study_collapsed = 1;
|
|
|
|
bool browser_collapsed = 2;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 last_day_studied = 3;
|
|
|
|
int32 new_studied = 4;
|
|
|
|
int32 review_studied = 5;
|
|
|
|
int32 milliseconds_studied = 7;
|
2020-06-05 11:49:53 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
// previously set in the v1 scheduler,
|
|
|
|
// but not currently used for anything
|
|
|
|
int32 learning_studied = 6;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes other = 255;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeckKind {
|
2021-01-09 06:50:24 +01:00
|
|
|
oneof kind {
|
|
|
|
NormalDeck normal = 1;
|
|
|
|
FilteredDeck filtered = 2;
|
|
|
|
}
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NormalDeck {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 config_id = 1;
|
|
|
|
uint32 extend_new = 2;
|
|
|
|
uint32 extend_review = 3;
|
|
|
|
string description = 4;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message FilteredDeck {
|
2021-01-09 06:50:24 +01:00
|
|
|
bool reschedule = 1;
|
|
|
|
repeated FilteredSearchTerm search_terms = 2;
|
|
|
|
// v1 scheduler only
|
|
|
|
repeated float delays = 3;
|
|
|
|
// v2 scheduler only
|
|
|
|
uint32 preview_delay = 4;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message FilteredSearchTerm {
|
2021-01-09 06:50:24 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
string search = 1;
|
|
|
|
uint32 limit = 2;
|
|
|
|
FilteredSearchOrder order = 3;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteFieldConfig {
|
2021-01-09 06:50:24 +01:00
|
|
|
bool sticky = 1;
|
|
|
|
bool rtl = 2;
|
|
|
|
string font_name = 3;
|
|
|
|
uint32 font_size = 4;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes other = 255;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message CardTemplateConfig {
|
2021-01-09 06:50:24 +01:00
|
|
|
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;
|
2020-05-18 00:57:30 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes other = 255;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeConfig {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Kind {
|
|
|
|
KIND_NORMAL = 0;
|
|
|
|
KIND_CLOZE = 1;
|
|
|
|
}
|
|
|
|
Kind kind = 1;
|
|
|
|
uint32 sort_field_idx = 2;
|
|
|
|
string css = 3;
|
|
|
|
int64 target_deck_id = 4;
|
|
|
|
string latex_pre = 5;
|
|
|
|
string latex_post = 6;
|
|
|
|
bool latex_svg = 7;
|
|
|
|
repeated CardRequirement reqs = 8;
|
|
|
|
|
|
|
|
bytes other = 255;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message CardRequirement {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Kind {
|
|
|
|
KIND_NONE = 0;
|
|
|
|
KIND_ANY = 1;
|
|
|
|
KIND_ALL = 2;
|
|
|
|
}
|
|
|
|
uint32 card_ord = 1;
|
|
|
|
Kind kind = 2;
|
|
|
|
repeated uint32 field_ords = 3;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Containers for passing around database objects
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
message Deck {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
uint32 mtime_secs = 3;
|
|
|
|
int32 usn = 4;
|
|
|
|
DeckCommon common = 5;
|
|
|
|
oneof kind {
|
|
|
|
NormalDeck normal = 6;
|
|
|
|
FilteredDeck filtered = 7;
|
|
|
|
}
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteType {
|
2021-01-09 06:50:24 +01:00
|
|
|
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-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteField {
|
2021-01-09 06:50:24 +01:00
|
|
|
OptionalUInt32 ord = 1;
|
|
|
|
string name = 2;
|
|
|
|
NoteFieldConfig config = 5;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message CardTemplate {
|
2021-01-09 06:50:24 +01:00
|
|
|
OptionalUInt32 ord = 1;
|
|
|
|
string name = 2;
|
|
|
|
uint32 mtime_secs = 3;
|
|
|
|
sint32 usn = 4;
|
|
|
|
CardTemplateConfig config = 5;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message Note {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 id = 1;
|
|
|
|
string guid = 2;
|
|
|
|
int64 notetype_id = 3;
|
|
|
|
uint32 mtime_secs = 4;
|
|
|
|
int32 usn = 5;
|
|
|
|
repeated string tags = 6;
|
|
|
|
repeated string fields = 7;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message Card {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 id = 1;
|
|
|
|
int64 note_id = 2;
|
|
|
|
int64 deck_id = 3;
|
|
|
|
uint32 template_idx = 4;
|
|
|
|
int64 mtime_secs = 5;
|
|
|
|
sint32 usn = 6;
|
|
|
|
uint32 ctype = 7;
|
|
|
|
sint32 queue = 8;
|
|
|
|
sint32 due = 9;
|
|
|
|
uint32 interval = 10;
|
|
|
|
uint32 ease_factor = 11;
|
|
|
|
uint32 reps = 12;
|
|
|
|
uint32 lapses = 13;
|
|
|
|
uint32 remaining_steps = 14;
|
|
|
|
sint32 original_due = 15;
|
|
|
|
int64 original_deck_id = 16;
|
|
|
|
uint32 flags = 17;
|
|
|
|
string data = 18;
|
2020-05-18 00:57:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Backend
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2020-01-30 02:22:34 +01:00
|
|
|
message BackendInit {
|
2021-01-09 06:50:24 +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 {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated string preferred_langs = 4;
|
|
|
|
string locale_folder_path = 5;
|
2020-02-23 05:57:02 +01:00
|
|
|
}
|
|
|
|
|
2020-05-24 00:36:50 +02:00
|
|
|
// Errors
|
2020-05-22 13:25:25 +02:00
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2019-12-24 23:59:33 +01:00
|
|
|
message BackendError {
|
2021-01-09 06:50:24 +01:00
|
|
|
// localized error description suitable for displaying to the user
|
|
|
|
string localized = 1;
|
|
|
|
// error specifics
|
|
|
|
oneof value {
|
|
|
|
Empty invalid_input = 2;
|
|
|
|
Empty template_parse = 3;
|
|
|
|
Empty io_error = 4;
|
|
|
|
Empty db_error = 5;
|
|
|
|
NetworkError network_error = 6;
|
|
|
|
SyncError sync_error = 7;
|
|
|
|
// user interrupted operation
|
|
|
|
Empty interrupted = 8;
|
|
|
|
string json_error = 9;
|
|
|
|
string proto_error = 10;
|
|
|
|
Empty not_found_error = 11;
|
|
|
|
Empty exists = 12;
|
|
|
|
Empty deck_is_filtered = 13;
|
|
|
|
}
|
2019-12-24 04:33:44 +01:00
|
|
|
}
|
|
|
|
|
2020-02-04 10:39:31 +01:00
|
|
|
message NetworkError {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum NetworkErrorKind {
|
|
|
|
OTHER = 0;
|
|
|
|
OFFLINE = 1;
|
|
|
|
TIMEOUT = 2;
|
|
|
|
PROXY_AUTH = 3;
|
|
|
|
}
|
|
|
|
NetworkErrorKind kind = 1;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SyncError {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum SyncErrorKind {
|
|
|
|
OTHER = 0;
|
|
|
|
CONFLICT = 1;
|
|
|
|
SERVER_ERROR = 2;
|
|
|
|
CLIENT_TOO_OLD = 3;
|
|
|
|
AUTH_FAILED = 4;
|
|
|
|
SERVER_MESSAGE = 5;
|
|
|
|
MEDIA_CHECK_REQUIRED = 6;
|
|
|
|
RESYNC_REQUIRED = 7;
|
|
|
|
CLOCK_INCORRECT = 8;
|
|
|
|
DATABASE_CHECK_REQUIRED = 9;
|
|
|
|
}
|
|
|
|
SyncErrorKind kind = 1;
|
2020-02-04 10:39:31 +01:00
|
|
|
}
|
|
|
|
|
2020-05-29 11:59:50 +02:00
|
|
|
// Progress
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
message Progress {
|
2021-01-09 06:50:24 +01:00
|
|
|
oneof value {
|
|
|
|
Empty none = 1;
|
|
|
|
MediaSyncProgress media_sync = 2;
|
|
|
|
string media_check = 3;
|
|
|
|
FullSyncProgress full_sync = 4;
|
|
|
|
NormalSyncProgress normal_sync = 5;
|
|
|
|
DatabaseCheckProgress database_check = 6;
|
|
|
|
}
|
2020-05-29 11:59:50 +02:00
|
|
|
}
|
|
|
|
|
2020-02-04 00:07:15 +01:00
|
|
|
message MediaSyncProgress {
|
2021-01-09 06:50:24 +01:00
|
|
|
string checked = 1;
|
|
|
|
string added = 2;
|
|
|
|
string removed = 3;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
|
2020-05-29 08:45:27 +02:00
|
|
|
message FullSyncProgress {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 transferred = 1;
|
|
|
|
uint32 total = 2;
|
2020-05-29 08:45:27 +02:00
|
|
|
}
|
|
|
|
|
2020-02-04 00:07:15 +01:00
|
|
|
message MediaSyncUploadProgress {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 files = 1;
|
|
|
|
uint32 deletions = 2;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
|
2020-05-31 06:43:27 +02:00
|
|
|
message NormalSyncProgress {
|
2021-01-09 06:50:24 +01:00
|
|
|
string stage = 1;
|
|
|
|
string added = 2;
|
|
|
|
string removed = 3;
|
2020-05-31 06:43:27 +02:00
|
|
|
}
|
|
|
|
|
2020-06-08 12:28:11 +02:00
|
|
|
message DatabaseCheckProgress {
|
2021-01-09 06:50:24 +01:00
|
|
|
string stage = 1;
|
|
|
|
uint32 stage_total = 2;
|
|
|
|
uint32 stage_current = 3;
|
2020-06-08 12:28:11 +02:00
|
|
|
}
|
|
|
|
|
2020-05-24 00:36:50 +02:00
|
|
|
// Messages
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
2019-12-27 09:14:19 +01:00
|
|
|
message SchedTimingTodayOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 days_elapsed = 1;
|
|
|
|
int64 next_day_at = 2;
|
2019-12-27 09:14:19 +01:00
|
|
|
}
|
2020-01-06 03:18:20 +01:00
|
|
|
|
2020-05-03 00:43:22 +02:00
|
|
|
message DeckTreeIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
// if non-zero, counts for the provided timestamp will be included
|
|
|
|
int64 now = 1;
|
|
|
|
int64 top_deck_id = 2;
|
2020-01-06 03:18:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeckTreeNode {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 deck_id = 1;
|
|
|
|
string name = 2;
|
|
|
|
repeated DeckTreeNode children = 3;
|
|
|
|
uint32 level = 4;
|
|
|
|
bool collapsed = 5;
|
2020-05-03 00:43:22 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 review_count = 6;
|
|
|
|
uint32 learn_count = 7;
|
|
|
|
uint32 new_count = 8;
|
2020-05-16 02:52:14 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
bool filtered = 16;
|
2020-01-06 03:18:20 +01:00
|
|
|
}
|
|
|
|
|
2020-05-13 02:35:01 +02:00
|
|
|
message RenderExistingCardIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 card_id = 1;
|
|
|
|
bool browser = 2;
|
2020-01-08 11:28:04 +01:00
|
|
|
}
|
|
|
|
|
2020-05-13 09:24:49 +02:00
|
|
|
message RenderUncommittedCardIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
Note note = 1;
|
|
|
|
uint32 card_ord = 2;
|
|
|
|
bytes template = 3;
|
|
|
|
bool fill_empty = 4;
|
2020-05-13 09:24:49 +02:00
|
|
|
}
|
|
|
|
|
2020-01-12 06:15:46 +01:00
|
|
|
message RenderCardOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
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 {
|
2021-01-09 06:50:24 +01:00
|
|
|
oneof value {
|
|
|
|
string text = 1;
|
|
|
|
RenderedTemplateReplacement replacement = 2;
|
|
|
|
}
|
2020-01-08 11:28:04 +01:00
|
|
|
}
|
|
|
|
|
2020-01-10 05:59:29 +01:00
|
|
|
message RenderedTemplateReplacement {
|
2021-01-09 06:50:24 +01:00
|
|
|
string field_name = 1;
|
|
|
|
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 {
|
2021-01-09 06:50:24 +01:00
|
|
|
string text = 1;
|
|
|
|
bool question_side = 2;
|
2020-01-24 02:06:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message ExtractAVTagsOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
string text = 1;
|
|
|
|
repeated AVTag av_tags = 2;
|
2020-01-20 10:12:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message AVTag {
|
2021-01-09 06:50:24 +01:00
|
|
|
oneof value {
|
|
|
|
string sound_or_video = 1;
|
|
|
|
TTSTag tts = 2;
|
|
|
|
}
|
2020-01-20 10:12:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TTSTag {
|
2021-01-09 06:50:24 +01:00
|
|
|
string field_text = 1;
|
|
|
|
string lang = 2;
|
|
|
|
repeated string voices = 3;
|
|
|
|
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 {
|
2021-01-09 06:50:24 +01:00
|
|
|
string text = 1;
|
|
|
|
bool svg = 2;
|
|
|
|
bool expand_clozes = 3;
|
2020-02-11 05:20:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message ExtractLatexOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
string text = 1;
|
|
|
|
repeated ExtractedLatex latex = 2;
|
2020-02-11 05:20:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message ExtractedLatex {
|
2021-01-09 06:50:24 +01:00
|
|
|
string filename = 1;
|
|
|
|
string latex_body = 2;
|
2020-02-11 05:20:07 +01:00
|
|
|
}
|
|
|
|
|
2020-02-11 09:08:34 +01:00
|
|
|
message AddMediaFileIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string desired_name = 1;
|
|
|
|
bytes data = 2;
|
2020-02-04 00:07:15 +01:00
|
|
|
}
|
|
|
|
|
2020-05-22 13:25:25 +02:00
|
|
|
message CheckMediaOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated string unused = 1;
|
|
|
|
repeated string missing = 2;
|
|
|
|
string report = 3;
|
|
|
|
bool have_trash = 4;
|
2020-02-11 08:30:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TrashMediaFilesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated string fnames = 1;
|
2020-02-16 12:07:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TranslateStringIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
int32 key = 2;
|
|
|
|
map<string, TranslateArgValue> args = 3;
|
2020-02-16 12:07:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message TranslateArgValue {
|
2021-01-09 06:50:24 +01:00
|
|
|
oneof value {
|
|
|
|
string str = 1;
|
|
|
|
double number = 2;
|
|
|
|
}
|
2020-02-16 12:07:40 +01:00
|
|
|
}
|
2020-02-20 05:16:33 +01:00
|
|
|
|
2020-05-24 00:36:50 +02:00
|
|
|
message FormatTimespanIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Context {
|
|
|
|
PRECISE = 0;
|
|
|
|
ANSWER_BUTTONS = 1;
|
|
|
|
INTERVALS = 2;
|
|
|
|
}
|
2020-02-20 05:16:33 +01:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
float seconds = 1;
|
|
|
|
Context context = 2;
|
2020-02-20 05:16:33 +01:00
|
|
|
}
|
2020-02-21 09:01:15 +01:00
|
|
|
|
2020-09-02 09:18:29 +02:00
|
|
|
message StudiedTodayMessageIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 cards = 1;
|
|
|
|
double seconds = 2;
|
2020-02-21 09:01:15 +01:00
|
|
|
}
|
2020-02-21 10:26:45 +01:00
|
|
|
|
2020-05-23 13:34:19 +02:00
|
|
|
message CongratsLearnMessageIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
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 {
|
2021-01-09 06:50:24 +01:00
|
|
|
string collection_path = 1;
|
|
|
|
string media_folder_path = 2;
|
|
|
|
string media_db_path = 3;
|
|
|
|
string log_path = 4;
|
2020-03-14 00:08:02 +01:00
|
|
|
}
|
2020-03-19 23:20:47 +01:00
|
|
|
|
|
|
|
message SearchCardsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string search = 1;
|
|
|
|
SortOrder order = 2;
|
2020-03-19 23:20:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SearchCardsOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 card_ids = 1;
|
2020-03-19 23:20:47 +01:00
|
|
|
}
|
2020-03-20 22:54:43 +01:00
|
|
|
|
|
|
|
message SortOrder {
|
2021-01-09 06:50:24 +01:00
|
|
|
oneof value {
|
|
|
|
Empty from_config = 1;
|
|
|
|
Empty none = 2;
|
|
|
|
string custom = 3;
|
|
|
|
BuiltinSearchOrder builtin = 4;
|
|
|
|
}
|
2020-03-20 22:54:43 +01:00
|
|
|
}
|
2020-03-21 00:00:05 +01:00
|
|
|
|
|
|
|
message SearchNotesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string search = 1;
|
2020-03-21 00:00:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message SearchNotesOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 note_ids = 2;
|
2020-03-21 00:00:05 +01:00
|
|
|
}
|
2020-03-22 03:59:24 +01:00
|
|
|
|
|
|
|
message BuiltinSearchOrder {
|
2021-01-09 06:50:24 +01: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;
|
|
|
|
}
|
|
|
|
BuiltinSortKind kind = 1;
|
|
|
|
bool reverse = 2;
|
2020-03-22 03:59:24 +01:00
|
|
|
}
|
|
|
|
|
2021-01-06 14:03:43 +01:00
|
|
|
message ConcatenateSearchesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Separator {
|
|
|
|
AND = 0;
|
|
|
|
OR = 1;
|
|
|
|
}
|
|
|
|
Separator sep = 1;
|
|
|
|
repeated string searches = 2;
|
2021-01-06 14:03:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message ReplaceSearchTermIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string search = 1;
|
|
|
|
string replacement = 2;
|
2021-01-06 14:03:43 +01:00
|
|
|
}
|
|
|
|
|
2020-03-30 12:01:16 +02:00
|
|
|
message CloseCollectionIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
bool downgrade_to_schema11 = 1;
|
2020-03-30 12:01:16 +02:00
|
|
|
}
|
2020-04-03 05:54:52 +02:00
|
|
|
|
2020-05-23 07:09:16 +02:00
|
|
|
message AddOrUpdateDeckConfigLegacyIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes config = 1;
|
|
|
|
bool preserve_usn_and_mtime = 2;
|
2020-04-03 05:54:52 +02:00
|
|
|
}
|
2020-04-03 11:30:42 +02:00
|
|
|
|
|
|
|
message RegisterTagsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string tags = 1;
|
|
|
|
bool preserve_usn = 2;
|
|
|
|
int32 usn = 3;
|
|
|
|
bool clear_first = 4;
|
2020-04-03 11:30:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message AllTagsOut {
|
2021-01-09 15:48:34 +01:00
|
|
|
repeated Tag tags = 1;
|
2020-04-03 11:30:42 +02:00
|
|
|
}
|
|
|
|
|
2021-01-09 14:55:08 +01:00
|
|
|
message SetTagCollapsedIn {
|
2021-01-09 15:48:34 +01:00
|
|
|
string name = 1;
|
|
|
|
bool collapsed = 2;
|
2021-01-09 14:55:08 +01:00
|
|
|
}
|
|
|
|
|
2021-01-06 15:04:03 +01:00
|
|
|
message TagConfig {
|
2021-01-09 15:48:34 +01:00
|
|
|
bool browser_collapsed = 1;
|
2021-01-06 15:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message Tag {
|
2021-01-09 15:48:34 +01:00
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
sint32 usn = 3;
|
|
|
|
TagConfig config = 4;
|
2020-04-03 11:30:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetChangedTagsOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated string tags = 1;
|
2020-04-03 11:30:42 +02:00
|
|
|
}
|
|
|
|
|
2021-01-06 15:04:03 +01:00
|
|
|
message TagTreeNode {
|
2021-01-09 15:48:34 +01:00
|
|
|
int64 tag_id = 1;
|
|
|
|
string name = 2;
|
|
|
|
repeated TagTreeNode children = 3;
|
|
|
|
uint32 level = 5;
|
|
|
|
bool collapsed = 4;
|
2021-01-06 15:04:03 +01:00
|
|
|
}
|
|
|
|
|
2020-05-24 00:36:50 +02:00
|
|
|
message SetConfigJsonIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string key = 1;
|
|
|
|
bytes value_json = 2;
|
2020-04-05 13:38:58 +02:00
|
|
|
}
|
2020-04-12 09:45:21 +02:00
|
|
|
|
2020-04-13 11:14:30 +02:00
|
|
|
enum StockNoteType {
|
2021-01-09 06:50:24 +01:00
|
|
|
STOCK_NOTE_TYPE_BASIC = 0;
|
|
|
|
STOCK_NOTE_TYPE_BASIC_AND_REVERSED = 1;
|
|
|
|
STOCK_NOTE_TYPE_BASIC_OPTIONAL_REVERSED = 2;
|
|
|
|
STOCK_NOTE_TYPE_BASIC_TYPING = 3;
|
|
|
|
STOCK_NOTE_TYPE_CLOZE = 4;
|
2020-04-13 11:14:30 +02:00
|
|
|
}
|
2020-04-13 23:30:33 +02:00
|
|
|
|
2020-05-23 12:43:55 +02:00
|
|
|
message GetStockNotetypeIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
StockNoteType kind = 1;
|
2020-05-23 12:43:55 +02:00
|
|
|
}
|
|
|
|
|
2020-04-23 02:10:28 +02:00
|
|
|
message NoteTypeNames {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated NoteTypeNameID entries = 1;
|
2020-04-23 02:10:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeUseCounts {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated NoteTypeNameIDUseCount entries = 1;
|
2020-04-23 02:10:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeNameID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
2020-04-23 02:10:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteTypeNameIDUseCount {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
uint32 use_count = 3;
|
2020-04-23 02:10:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message AddOrUpdateNotetypeIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes json = 1;
|
|
|
|
bool preserve_usn_and_mtime = 2;
|
2020-04-23 02:10:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message AddNoteIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
Note note = 1;
|
|
|
|
int64 deck_id = 2;
|
2020-04-23 02:10:28 +02:00
|
|
|
}
|
2020-04-25 10:25:56 +02:00
|
|
|
|
|
|
|
message EmptyCardsReport {
|
2021-01-09 06:50:24 +01:00
|
|
|
string report = 1;
|
|
|
|
repeated NoteWithEmptyCards notes = 2;
|
2020-04-25 10:25:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message NoteWithEmptyCards {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 note_id = 1;
|
|
|
|
repeated int64 card_ids = 2;
|
|
|
|
bool will_delete_note = 3;
|
2020-04-25 10:25:56 +02:00
|
|
|
}
|
2020-05-02 04:41:53 +02:00
|
|
|
|
|
|
|
message DeckNames {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated DeckNameID entries = 1;
|
2020-05-02 04:41:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeckNameID {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 id = 1;
|
|
|
|
string name = 2;
|
2020-05-02 04:41:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message AddOrUpdateDeckLegacyIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
bytes deck = 1;
|
|
|
|
bool preserve_usn_and_mtime = 2;
|
2020-05-02 04:41:53 +02:00
|
|
|
}
|
2020-05-03 00:43:22 +02:00
|
|
|
|
2020-05-05 12:50:17 +02:00
|
|
|
message FieldNamesForNotesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 nids = 1;
|
2020-05-05 12:50:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message FieldNamesForNotesOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated string fields = 1;
|
2020-05-05 12:50:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message FindAndReplaceIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 nids = 1;
|
|
|
|
string search = 2;
|
|
|
|
string replacement = 3;
|
|
|
|
bool regex = 4;
|
|
|
|
bool match_case = 5;
|
|
|
|
string field_name = 6;
|
2020-05-05 12:50:17 +02:00
|
|
|
}
|
2020-05-06 05:14:57 +02:00
|
|
|
|
|
|
|
message AfterNoteUpdatesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 nids = 1;
|
|
|
|
bool mark_notes_modified = 2;
|
|
|
|
bool generate_cards = 3;
|
2020-05-06 05:14:57 +02:00
|
|
|
}
|
2020-05-07 09:54:23 +02:00
|
|
|
|
|
|
|
message AddNoteTagsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 nids = 1;
|
|
|
|
string tags = 2;
|
2020-05-07 09:54:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message UpdateNoteTagsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 nids = 1;
|
|
|
|
string tags = 2;
|
|
|
|
string replacement = 3;
|
|
|
|
bool regex = 4;
|
2020-05-07 09:54:23 +02:00
|
|
|
}
|
2020-05-10 05:50:04 +02:00
|
|
|
|
2021-01-06 15:04:03 +01:00
|
|
|
message GetNoteTagsIn {
|
2021-01-09 15:48:34 +01:00
|
|
|
repeated int64 nids = 1;
|
2021-01-06 15:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetNoteTagsOut {
|
2021-01-09 15:48:34 +01:00
|
|
|
repeated string tags = 1;
|
2021-01-06 15:04:03 +01:00
|
|
|
}
|
|
|
|
|
2020-05-10 05:50:04 +02:00
|
|
|
message CheckDatabaseOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated string problems = 1;
|
2020-05-10 05:50:04 +02:00
|
|
|
}
|
2020-05-11 10:35:15 +02:00
|
|
|
|
|
|
|
message CollectionSchedulingSettings {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum NewReviewMix {
|
|
|
|
DISTRIBUTE = 0;
|
|
|
|
REVIEWS_FIRST = 1;
|
|
|
|
NEW_FIRST = 2;
|
|
|
|
}
|
2020-05-11 10:35:15 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 scheduler_version = 1;
|
|
|
|
uint32 rollover = 2;
|
|
|
|
uint32 learn_ahead_secs = 3;
|
|
|
|
NewReviewMix new_review_mix = 4;
|
|
|
|
bool show_remaining_due_counts = 5;
|
|
|
|
bool show_intervals_on_buttons = 6;
|
|
|
|
uint32 time_limit_secs = 7;
|
2020-05-11 10:35:15 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
// v2 only
|
|
|
|
bool new_timezone = 8;
|
|
|
|
bool day_learn_first = 9;
|
2020-05-11 10:35:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message Preferences {
|
2021-01-09 06:50:24 +01:00
|
|
|
CollectionSchedulingSettings sched = 1;
|
2020-05-11 10:35:15 +02:00
|
|
|
}
|
2020-05-14 04:14:00 +02:00
|
|
|
|
|
|
|
message ClozeNumbersInNoteOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated uint32 numbers = 1;
|
2020-05-14 04:14:00 +02:00
|
|
|
}
|
2020-05-15 13:21:10 +02:00
|
|
|
|
|
|
|
message GetDeckNamesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
bool skip_empty_default = 1;
|
|
|
|
// if unset, implies skip_empty_default
|
|
|
|
bool include_filtered = 2;
|
2020-05-15 13:21:10 +02:00
|
|
|
}
|
2020-05-24 11:48:56 +02:00
|
|
|
|
|
|
|
message NoteIsDuplicateOrEmptyOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum State {
|
|
|
|
NORMAL = 0;
|
|
|
|
EMPTY = 1;
|
|
|
|
DUPLICATE = 2;
|
|
|
|
}
|
|
|
|
State state = 1;
|
2020-05-24 11:48:56 +02:00
|
|
|
}
|
2020-05-28 11:49:44 +02:00
|
|
|
|
|
|
|
message SyncLoginIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string username = 1;
|
|
|
|
string password = 2;
|
2020-05-28 11:49:44 +02:00
|
|
|
}
|
|
|
|
|
2020-06-02 05:23:01 +02:00
|
|
|
message SyncStatusOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Required {
|
|
|
|
NO_CHANGES = 0;
|
|
|
|
NORMAL_SYNC = 1;
|
|
|
|
FULL_SYNC = 2;
|
|
|
|
}
|
|
|
|
Required required = 1;
|
2020-06-02 05:23:01 +02:00
|
|
|
}
|
|
|
|
|
2020-05-28 11:49:44 +02:00
|
|
|
message SyncCollectionOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum ChangesRequired {
|
|
|
|
NO_CHANGES = 0;
|
|
|
|
NORMAL_SYNC = 1;
|
|
|
|
FULL_SYNC = 2;
|
|
|
|
// local collection has no cards; upload not an option
|
|
|
|
FULL_DOWNLOAD = 3;
|
|
|
|
// remote collection has no cards; download not an option
|
|
|
|
FULL_UPLOAD = 4;
|
|
|
|
}
|
2020-05-28 11:49:44 +02:00
|
|
|
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 host_number = 1;
|
|
|
|
string server_message = 2;
|
|
|
|
ChangesRequired required = 3;
|
2020-05-28 11:49:44 +02:00
|
|
|
}
|
2020-05-29 08:45:27 +02:00
|
|
|
|
|
|
|
message SyncAuth {
|
2021-01-09 06:50:24 +01:00
|
|
|
string hkey = 1;
|
|
|
|
uint32 host_number = 2;
|
2020-05-29 08:45:27 +02:00
|
|
|
}
|
2020-06-04 10:21:04 +02:00
|
|
|
|
|
|
|
message RemoveNotesIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 note_ids = 1;
|
|
|
|
repeated int64 card_ids = 2;
|
2020-06-04 10:21:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message RemoveCardsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 card_ids = 1;
|
2020-06-04 10:21:04 +02:00
|
|
|
}
|
2020-06-05 11:49:53 +02:00
|
|
|
|
|
|
|
message UpdateStatsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 deck_id = 1;
|
|
|
|
int32 new_delta = 2;
|
|
|
|
int32 review_delta = 4;
|
|
|
|
int32 millisecond_delta = 5;
|
2020-06-05 11:49:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message ExtendLimitsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 deck_id = 1;
|
|
|
|
int32 new_delta = 2;
|
|
|
|
int32 review_delta = 3;
|
2020-06-05 11:49:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message CountsForDeckTodayOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
int32 new = 1;
|
|
|
|
int32 review = 2;
|
2020-06-05 11:49:53 +02:00
|
|
|
}
|
2020-06-17 10:55:16 +02:00
|
|
|
|
|
|
|
message GraphsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
string search = 1;
|
|
|
|
uint32 days = 2;
|
2020-06-17 10:55:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message GraphsOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated Card cards = 1;
|
|
|
|
repeated RevlogEntry revlog = 2;
|
|
|
|
uint32 days_elapsed = 3;
|
|
|
|
// Based on rollover hour
|
|
|
|
uint32 next_day_at_secs = 4;
|
|
|
|
uint32 scheduler_version = 5;
|
|
|
|
/// Seconds to add to UTC timestamps to get local time.
|
|
|
|
int32 local_offset_secs = 7;
|
2020-06-17 10:55:16 +02:00
|
|
|
}
|
2020-06-22 05:33:53 +02:00
|
|
|
|
|
|
|
message RevlogEntry {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum ReviewKind {
|
|
|
|
LEARNING = 0;
|
|
|
|
REVIEW = 1;
|
|
|
|
RELEARNING = 2;
|
|
|
|
EARLY_REVIEW = 3;
|
|
|
|
MANUAL = 4;
|
|
|
|
}
|
|
|
|
int64 id = 1;
|
|
|
|
int64 cid = 2;
|
|
|
|
int32 usn = 3;
|
|
|
|
uint32 button_chosen = 4;
|
|
|
|
int32 interval = 5;
|
|
|
|
int32 last_interval = 6;
|
|
|
|
uint32 ease_factor = 7;
|
|
|
|
uint32 taken_millis = 8;
|
|
|
|
ReviewKind review_kind = 9;
|
2020-06-22 05:33:53 +02:00
|
|
|
}
|
2020-08-27 13:46:34 +02:00
|
|
|
|
|
|
|
message CongratsInfoOut {
|
2021-01-09 06:50:24 +01:00
|
|
|
uint32 learn_remaining = 1;
|
|
|
|
uint32 secs_until_next_learn = 2;
|
|
|
|
bool review_remaining = 3;
|
|
|
|
bool new_remaining = 4;
|
|
|
|
bool have_sched_buried = 5;
|
|
|
|
bool have_user_buried = 6;
|
|
|
|
bool is_filtered_deck = 7;
|
|
|
|
bool bridge_commands_supported = 8;
|
2020-08-27 13:46:34 +02:00
|
|
|
}
|
2020-08-29 14:02:22 +02:00
|
|
|
|
|
|
|
message UnburyCardsInCurrentDeckIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Mode {
|
|
|
|
ALL = 0;
|
|
|
|
SCHED_ONLY = 1;
|
|
|
|
USER_ONLY = 2;
|
|
|
|
}
|
|
|
|
Mode mode = 1;
|
2020-08-29 14:02:22 +02:00
|
|
|
}
|
2020-08-31 08:14:04 +02:00
|
|
|
|
|
|
|
message BuryOrSuspendCardsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
enum Mode {
|
|
|
|
SUSPEND = 0;
|
|
|
|
BURY_SCHED = 1;
|
|
|
|
BURY_USER = 2;
|
|
|
|
}
|
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
Mode mode = 2;
|
2020-08-31 08:14:04 +02:00
|
|
|
}
|
2020-09-02 06:41:46 +02:00
|
|
|
|
|
|
|
message ScheduleCardsAsReviewsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
uint32 min_interval = 2;
|
|
|
|
uint32 max_interval = 3;
|
2020-09-02 06:41:46 +02:00
|
|
|
}
|
2020-09-03 07:44:14 +02:00
|
|
|
|
2021-01-05 02:07:09 +01:00
|
|
|
message ScheduleCardsAsNewIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
bool log = 2;
|
2021-01-05 02:07:09 +01:00
|
|
|
}
|
|
|
|
|
2020-09-03 07:44:14 +02:00
|
|
|
message SortCardsIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
uint32 starting_from = 2;
|
|
|
|
uint32 step_size = 3;
|
|
|
|
bool randomize = 4;
|
|
|
|
bool shift_existing = 5;
|
2020-09-03 07:44:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message SortDeckIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
int64 deck_id = 1;
|
|
|
|
bool randomize = 2;
|
2020-09-03 07:44:14 +02:00
|
|
|
}
|
2020-09-03 09:42:46 +02:00
|
|
|
|
|
|
|
message SetDeckIn {
|
2021-01-09 06:50:24 +01:00
|
|
|
repeated int64 card_ids = 1;
|
|
|
|
int64 deck_id = 2;
|
2020-09-03 09:42:46 +02:00
|
|
|
}
|