format backend.proto with standard Google style

This commit is contained in:
Damien Elmes 2021-01-09 15:50:24 +10:00
parent c3b1266f47
commit e0c3949ef9

View file

@ -70,153 +70,154 @@ message DeckConfigID {
///////////////////////////////////////////////////////////
service BackendService {
rpc LatestProgress (Empty) returns (Progress);
rpc SetWantsAbort (Empty) returns (Empty);
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);
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);
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);
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 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);
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);
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);
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);
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 ClozeNumbersInNote (Note) returns (ClozeNumbersInNoteOut);
rpc AfterNoteUpdates (AfterNoteUpdatesIn) returns (Empty);
rpc FieldNamesForNotes (FieldNamesForNotesIn) returns (FieldNamesForNotesOut);
rpc NoteIsDuplicateOrEmpty (Note) returns (NoteIsDuplicateOrEmptyOut);
rpc CardsOfNote (NoteID) returns (CardIDs);
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 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);
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);
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);
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);
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 RegisterTags(RegisterTagsIn) returns (Bool);
rpc AllTags(Empty) returns (AllTagsOut);
// 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);
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);
}
// Protobuf stored in .anki2 files
@ -340,7 +341,7 @@ message CardTemplateConfig {
string q_format = 1;
string a_format = 2;
string q_format_browser = 3;
string a_format_browser= 4;
string a_format_browser = 4;
int64 target_deck_id = 5;
string browser_font_name = 6;
uint32 browser_font_size = 7;
@ -552,11 +553,9 @@ message DatabaseCheckProgress {
uint32 stage_current = 3;
}
// Messages
///////////////////////////////////////////////////////////
message SchedTimingTodayOut {
uint32 days_elapsed = 1;
int64 next_day_at = 2;
@ -671,7 +670,7 @@ message TrashMediaFilesIn {
message TranslateStringIn {
int32 key = 2;
map<string,TranslateArgValue> args = 3;
map<string, TranslateArgValue> args = 3;
}
message TranslateArgValue {
@ -716,7 +715,6 @@ message SearchCardsIn {
message SearchCardsOut {
repeated int64 card_ids = 1;
}
message SortOrder {
@ -827,7 +825,6 @@ message NoteTypeUseCounts {
message NoteTypeNameID {
int64 id = 1;
string name = 2;
}
message NoteTypeNameIDUseCount {