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 { service BackendService {
rpc LatestProgress (Empty) returns (Progress); rpc LatestProgress(Empty) returns (Progress);
rpc SetWantsAbort (Empty) returns (Empty); rpc SetWantsAbort(Empty) returns (Empty);
// card rendering // card rendering
rpc ExtractAVTags (ExtractAVTagsIn) returns (ExtractAVTagsOut); rpc ExtractAVTags(ExtractAVTagsIn) returns (ExtractAVTagsOut);
rpc ExtractLatex (ExtractLatexIn) returns (ExtractLatexOut); rpc ExtractLatex(ExtractLatexIn) returns (ExtractLatexOut);
rpc GetEmptyCards (Empty) returns (EmptyCardsReport); rpc GetEmptyCards(Empty) returns (EmptyCardsReport);
rpc RenderExistingCard (RenderExistingCardIn) returns (RenderCardOut); rpc RenderExistingCard(RenderExistingCardIn) returns (RenderCardOut);
rpc RenderUncommittedCard (RenderUncommittedCardIn) returns (RenderCardOut); rpc RenderUncommittedCard(RenderUncommittedCardIn) returns (RenderCardOut);
rpc StripAVTags (String) returns (String); rpc StripAVTags(String) returns (String);
// searching // searching
rpc NormalizeSearch (String) returns (String); rpc NormalizeSearch(String) returns (String);
rpc SearchCards (SearchCardsIn) returns (SearchCardsOut); rpc SearchCards(SearchCardsIn) returns (SearchCardsOut);
rpc SearchNotes (SearchNotesIn) returns (SearchNotesOut); rpc SearchNotes(SearchNotesIn) returns (SearchNotesOut);
rpc NegateSearch (String) returns (String); rpc NegateSearch(String) returns (String);
rpc ConcatenateSearches (ConcatenateSearchesIn) returns (String); rpc ConcatenateSearches(ConcatenateSearchesIn) returns (String);
rpc ReplaceSearchTerm (ReplaceSearchTermIn) returns (String); rpc ReplaceSearchTerm(ReplaceSearchTermIn) returns (String);
rpc FindAndReplace (FindAndReplaceIn) returns (UInt32); rpc FindAndReplace(FindAndReplaceIn) returns (UInt32);
// scheduling // scheduling
rpc LocalMinutesWest (Int64) returns (Int32); rpc LocalMinutesWest(Int64) returns (Int32);
rpc SetLocalMinutesWest (Int32) returns (Empty); rpc SetLocalMinutesWest(Int32) returns (Empty);
rpc SchedTimingToday (Empty) returns (SchedTimingTodayOut); rpc SchedTimingToday(Empty) returns (SchedTimingTodayOut);
rpc StudiedToday (Empty) returns (String); rpc StudiedToday(Empty) returns (String);
rpc StudiedTodayMessage (StudiedTodayMessageIn) returns (String); rpc StudiedTodayMessage(StudiedTodayMessageIn) returns (String);
rpc UpdateStats (UpdateStatsIn) returns (Empty); rpc UpdateStats(UpdateStatsIn) returns (Empty);
rpc ExtendLimits (ExtendLimitsIn) returns (Empty); rpc ExtendLimits(ExtendLimitsIn) returns (Empty);
rpc CountsForDeckToday (DeckID) returns (CountsForDeckTodayOut); rpc CountsForDeckToday(DeckID) returns (CountsForDeckTodayOut);
rpc CongratsInfo (Empty) returns (CongratsInfoOut); rpc CongratsInfo(Empty) returns (CongratsInfoOut);
rpc RestoreBuriedAndSuspendedCards (CardIDs) returns (Empty); rpc RestoreBuriedAndSuspendedCards(CardIDs) returns (Empty);
rpc UnburyCardsInCurrentDeck (UnburyCardsInCurrentDeckIn) returns (Empty); rpc UnburyCardsInCurrentDeck(UnburyCardsInCurrentDeckIn) returns (Empty);
rpc BuryOrSuspendCards (BuryOrSuspendCardsIn) returns (Empty); rpc BuryOrSuspendCards(BuryOrSuspendCardsIn) returns (Empty);
rpc EmptyFilteredDeck (DeckID) returns (Empty); rpc EmptyFilteredDeck(DeckID) returns (Empty);
rpc RebuildFilteredDeck (DeckID) returns (UInt32); rpc RebuildFilteredDeck(DeckID) returns (UInt32);
rpc ScheduleCardsAsReviews (ScheduleCardsAsReviewsIn) returns (Empty); rpc ScheduleCardsAsReviews(ScheduleCardsAsReviewsIn) returns (Empty);
rpc ScheduleCardsAsNew (ScheduleCardsAsNewIn) returns (Empty); rpc ScheduleCardsAsNew(ScheduleCardsAsNewIn) returns (Empty);
rpc SortCards (SortCardsIn) returns (Empty); rpc SortCards(SortCardsIn) returns (Empty);
rpc SortDeck (SortDeckIn) returns (Empty); rpc SortDeck(SortDeckIn) returns (Empty);
// stats // stats
rpc CardStats (CardID) returns (String); rpc CardStats(CardID) returns (String);
rpc Graphs(GraphsIn) returns (GraphsOut); rpc Graphs(GraphsIn) returns (GraphsOut);
// media // media
rpc CheckMedia (Empty) returns (CheckMediaOut); rpc CheckMedia(Empty) returns (CheckMediaOut);
rpc TrashMediaFiles (TrashMediaFilesIn) returns (Empty); rpc TrashMediaFiles(TrashMediaFilesIn) returns (Empty);
rpc AddMediaFile (AddMediaFileIn) returns (String); rpc AddMediaFile(AddMediaFileIn) returns (String);
rpc EmptyTrash (Empty) returns (Empty); rpc EmptyTrash(Empty) returns (Empty);
rpc RestoreTrash (Empty) returns (Empty); rpc RestoreTrash(Empty) returns (Empty);
// decks // decks
rpc AddOrUpdateDeckLegacy (AddOrUpdateDeckLegacyIn) returns (DeckID); rpc AddOrUpdateDeckLegacy(AddOrUpdateDeckLegacyIn) returns (DeckID);
rpc DeckTree (DeckTreeIn) returns (DeckTreeNode); rpc DeckTree(DeckTreeIn) returns (DeckTreeNode);
rpc DeckTreeLegacy (Empty) returns (Json); rpc DeckTreeLegacy(Empty) returns (Json);
rpc GetAllDecksLegacy (Empty) returns (Json); rpc GetAllDecksLegacy(Empty) returns (Json);
rpc GetDeckIDByName (String) returns (DeckID); rpc GetDeckIDByName(String) returns (DeckID);
rpc GetDeckLegacy (DeckID) returns (Json); rpc GetDeckLegacy(DeckID) returns (Json);
rpc GetDeckNames (GetDeckNamesIn) returns (DeckNames); rpc GetDeckNames(GetDeckNamesIn) returns (DeckNames);
rpc NewDeckLegacy (Bool) returns (Json); rpc NewDeckLegacy(Bool) returns (Json);
rpc RemoveDeck (DeckID) returns (Empty); rpc RemoveDeck(DeckID) returns (Empty);
// deck config // deck config
rpc AddOrUpdateDeckConfigLegacy (AddOrUpdateDeckConfigLegacyIn) returns (DeckConfigID); rpc AddOrUpdateDeckConfigLegacy(AddOrUpdateDeckConfigLegacyIn)
rpc AllDeckConfigLegacy (Empty) returns (Json); returns (DeckConfigID);
rpc GetDeckConfigLegacy (DeckConfigID) returns (Json); rpc AllDeckConfigLegacy(Empty) returns (Json);
rpc NewDeckConfigLegacy (Empty) returns (Json); rpc GetDeckConfigLegacy(DeckConfigID) returns (Json);
rpc RemoveDeckConfig (DeckConfigID) returns (Empty); rpc NewDeckConfigLegacy(Empty) returns (Json);
rpc RemoveDeckConfig(DeckConfigID) returns (Empty);
// cards // cards
rpc GetCard (CardID) returns (Card); rpc GetCard(CardID) returns (Card);
rpc UpdateCard (Card) returns (Empty); rpc UpdateCard(Card) returns (Empty);
rpc AddCard (Card) returns (CardID); rpc AddCard(Card) returns (CardID);
rpc RemoveCards (RemoveCardsIn) returns (Empty); rpc RemoveCards(RemoveCardsIn) returns (Empty);
rpc SetDeck (SetDeckIn) returns (Empty); rpc SetDeck(SetDeckIn) returns (Empty);
// notes // notes
rpc NewNote (NoteTypeID) returns (Note); rpc NewNote(NoteTypeID) returns (Note);
rpc AddNote (AddNoteIn) returns (NoteID); rpc AddNote(AddNoteIn) returns (NoteID);
rpc UpdateNote (Note) returns (Empty); rpc UpdateNote(Note) returns (Empty);
rpc GetNote (NoteID) returns (Note); rpc GetNote(NoteID) returns (Note);
rpc RemoveNotes (RemoveNotesIn) returns (Empty); rpc RemoveNotes(RemoveNotesIn) returns (Empty);
rpc AddNoteTags (AddNoteTagsIn) returns (UInt32); rpc AddNoteTags(AddNoteTagsIn) returns (UInt32);
rpc UpdateNoteTags (UpdateNoteTagsIn) returns (UInt32); rpc UpdateNoteTags(UpdateNoteTagsIn) returns (UInt32);
rpc ClozeNumbersInNote (Note) returns (ClozeNumbersInNoteOut); rpc ClozeNumbersInNote(Note) returns (ClozeNumbersInNoteOut);
rpc AfterNoteUpdates (AfterNoteUpdatesIn) returns (Empty); rpc AfterNoteUpdates(AfterNoteUpdatesIn) returns (Empty);
rpc FieldNamesForNotes (FieldNamesForNotesIn) returns (FieldNamesForNotesOut); rpc FieldNamesForNotes(FieldNamesForNotesIn) returns (FieldNamesForNotesOut);
rpc NoteIsDuplicateOrEmpty (Note) returns (NoteIsDuplicateOrEmptyOut); rpc NoteIsDuplicateOrEmpty(Note) returns (NoteIsDuplicateOrEmptyOut);
rpc CardsOfNote (NoteID) returns (CardIDs); rpc CardsOfNote(NoteID) returns (CardIDs);
// note types // note types
rpc AddOrUpdateNotetype (AddOrUpdateNotetypeIn) returns (NoteTypeID); rpc AddOrUpdateNotetype(AddOrUpdateNotetypeIn) returns (NoteTypeID);
rpc GetStockNotetypeLegacy (GetStockNotetypeIn) returns (Json); rpc GetStockNotetypeLegacy(GetStockNotetypeIn) returns (Json);
rpc GetNotetypeLegacy (NoteTypeID) returns (Json); rpc GetNotetypeLegacy(NoteTypeID) returns (Json);
rpc GetNotetypeNames (Empty) returns (NoteTypeNames); rpc GetNotetypeNames(Empty) returns (NoteTypeNames);
rpc GetNotetypeNamesAndCounts (Empty) returns (NoteTypeUseCounts); rpc GetNotetypeNamesAndCounts(Empty) returns (NoteTypeUseCounts);
rpc GetNotetypeIDByName (String) returns (NoteTypeID); rpc GetNotetypeIDByName(String) returns (NoteTypeID);
rpc RemoveNotetype (NoteTypeID) returns (Empty); rpc RemoveNotetype(NoteTypeID) returns (Empty);
// collection // collection
rpc OpenCollection (OpenCollectionIn) returns (Empty); rpc OpenCollection(OpenCollectionIn) returns (Empty);
rpc CloseCollection (CloseCollectionIn) returns (Empty); rpc CloseCollection(CloseCollectionIn) returns (Empty);
rpc CheckDatabase (Empty) returns (CheckDatabaseOut); rpc CheckDatabase(Empty) returns (CheckDatabaseOut);
// sync // sync
rpc SyncMedia (SyncAuth) returns (Empty); rpc SyncMedia(SyncAuth) returns (Empty);
rpc AbortSync (Empty) returns (Empty); rpc AbortSync(Empty) returns (Empty);
rpc AbortMediaSync (Empty) returns (Empty); rpc AbortMediaSync(Empty) returns (Empty);
rpc BeforeUpload (Empty) returns (Empty); rpc BeforeUpload(Empty) returns (Empty);
rpc SyncLogin (SyncLoginIn) returns (SyncAuth); rpc SyncLogin(SyncLoginIn) returns (SyncAuth);
rpc SyncStatus (SyncAuth) returns (SyncStatusOut); rpc SyncStatus(SyncAuth) returns (SyncStatusOut);
rpc SyncCollection (SyncAuth) returns (SyncCollectionOut); rpc SyncCollection(SyncAuth) returns (SyncCollectionOut);
rpc FullUpload (SyncAuth) returns (Empty); rpc FullUpload(SyncAuth) returns (Empty);
rpc FullDownload (SyncAuth) returns (Empty); rpc FullDownload(SyncAuth) returns (Empty);
// translation/messages // translation/messages
rpc TranslateString (TranslateStringIn) returns (String); rpc TranslateString(TranslateStringIn) returns (String);
rpc FormatTimespan (FormatTimespanIn) returns (String); rpc FormatTimespan(FormatTimespanIn) returns (String);
rpc I18nResources (Empty) returns (Json); rpc I18nResources(Empty) returns (Json);
// tags // tags
rpc RegisterTags (RegisterTagsIn) returns (Bool); rpc RegisterTags(RegisterTagsIn) returns (Bool);
rpc AllTags (Empty) returns (AllTagsOut); rpc AllTags(Empty) returns (AllTagsOut);
// config/preferences // config/preferences
rpc GetConfigJson (String) returns (Json); rpc GetConfigJson(String) returns (Json);
rpc SetConfigJson (SetConfigJsonIn) returns (Empty); rpc SetConfigJson(SetConfigJsonIn) returns (Empty);
rpc RemoveConfig (String) returns (Empty); rpc RemoveConfig(String) returns (Empty);
rpc SetAllConfig (Json) returns (Empty); rpc SetAllConfig(Json) returns (Empty);
rpc GetAllConfig (Empty) returns (Json); rpc GetAllConfig(Empty) returns (Json);
rpc GetPreferences (Empty) returns (Preferences); rpc GetPreferences(Empty) returns (Preferences);
rpc SetPreferences (Preferences) returns (Empty); rpc SetPreferences(Preferences) returns (Empty);
} }
// Protobuf stored in .anki2 files // Protobuf stored in .anki2 files
@ -340,7 +341,7 @@ message CardTemplateConfig {
string q_format = 1; string q_format = 1;
string a_format = 2; string a_format = 2;
string q_format_browser = 3; string q_format_browser = 3;
string a_format_browser= 4; string a_format_browser = 4;
int64 target_deck_id = 5; int64 target_deck_id = 5;
string browser_font_name = 6; string browser_font_name = 6;
uint32 browser_font_size = 7; uint32 browser_font_size = 7;
@ -552,11 +553,9 @@ message DatabaseCheckProgress {
uint32 stage_current = 3; uint32 stage_current = 3;
} }
// Messages // Messages
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
message SchedTimingTodayOut { message SchedTimingTodayOut {
uint32 days_elapsed = 1; uint32 days_elapsed = 1;
int64 next_day_at = 2; int64 next_day_at = 2;
@ -671,7 +670,7 @@ message TrashMediaFilesIn {
message TranslateStringIn { message TranslateStringIn {
int32 key = 2; int32 key = 2;
map<string,TranslateArgValue> args = 3; map<string, TranslateArgValue> args = 3;
} }
message TranslateArgValue { message TranslateArgValue {
@ -716,7 +715,6 @@ message SearchCardsIn {
message SearchCardsOut { message SearchCardsOut {
repeated int64 card_ids = 1; repeated int64 card_ids = 1;
} }
message SortOrder { message SortOrder {
@ -827,7 +825,6 @@ message NoteTypeUseCounts {
message NoteTypeNameID { message NoteTypeNameID {
int64 id = 1; int64 id = 1;
string name = 2; string name = 2;
} }
message NoteTypeNameIDUseCount { message NoteTypeNameIDUseCount {