mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00

* Implement import log screen in Svelte * Show filename in import log screen title * Remove unused NoteRow property * Show number of imported notes * Use a single nid expression * Use 'count' as variable name for consistency * Import from @tslib/backend instead * Fix summary_template typing * Fix clippy warning * Apply suggestions from code review * Fix imports * Contents -> Fields * Increase max length of browser search bar https://github.com/ankitects/anki/pull/2568/files#r1255227035 * Fix race condition in Bootstrap tooltip destruction https://github.com/twbs/bootstrap/issues/37474 * summary_template -> summaryTemplate * Make show link a button * Run import ops on Svelte side * Fix geometry not being restored in CSV Import page * Make VirtualTable fill available height * Keep CSV dialog modal * Reword importing-existing-notes-skipped * Avoid mentioning matching based on first field * Change tick and cross icons * List skipped notes last * Pure CSS spinner * Move set_wants_abort() call to relevant dialogs * Show number of imported cards * Remove bold from first sentence and indent summaries * Update UI after import operations * Add close button to import log page Also make virtual table react to resize event. * Fix typing * Make CSV dialog non-modal again Otherwise user can't interact with browser window. * Update window modality after import * Commit DB and update undo actions after import op * Split frontend proto into separate file, so backend can ignore it Currently the automatically-generated frontend RPC methods get placed in 'backend.js' with all the backend methods; we could optionally split them into a separate 'frontend.js' file in the future. * Migrate import_done from a bridgecmd to a HTTP request * Update plural form of importing-notes-added * Move import response handling to mediasrv * Move task callback to script section * Avoid unnecessary :global() * .log cannot be missing if result exists * Move import log search handling to mediasrv * Type common params of ImportLogDialog * Use else if * Remove console.log() * Add way to test apkg imports in new log screen * Remove unused import * Get actual card count for CSV imports * Use import type * Fix typing error * Ignore import log when checking for changes in Python layer * Apply suggestions from code review * Remove imported card count for now * Avoid non-null assertion in assignment * Change showInBrowser to take an array of notes * Use dataclasses for import log args * Simplify ResultWithChanges in TS * Only abort import when window is modal * Fix ResultWithChanges typing * Fix Rust warnings * Only log one duplicate per incoming note * Update wording about note updates * Remove caveat about found_notes * Reduce font size * Remove redundant map * Give credit to loading.io * Remove unused line --------- Co-authored-by: RumovZ <gp5glkw78@relay.firefox.com>
146 lines
3.7 KiB
Protocol Buffer
146 lines
3.7 KiB
Protocol Buffer
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
syntax = "proto3";
|
|
|
|
option java_multiple_files = true;
|
|
|
|
package anki.collection;
|
|
|
|
import "anki/generic.proto";
|
|
|
|
service CollectionService {
|
|
rpc CheckDatabase(generic.Empty) returns (CheckDatabaseResponse);
|
|
rpc GetUndoStatus(generic.Empty) returns (UndoStatus);
|
|
rpc Undo(generic.Empty) returns (OpChangesAfterUndo);
|
|
rpc Redo(generic.Empty) returns (OpChangesAfterUndo);
|
|
rpc AddCustomUndoEntry(generic.String) returns (generic.UInt32);
|
|
rpc MergeUndoEntries(generic.UInt32) returns (OpChanges);
|
|
rpc LatestProgress(generic.Empty) returns (Progress);
|
|
rpc SetWantsAbort(generic.Empty) returns (generic.Empty);
|
|
}
|
|
|
|
// Implicitly includes any of the above methods that are not listed in the
|
|
// backend service.
|
|
service BackendCollectionService {
|
|
rpc OpenCollection(OpenCollectionRequest) returns (generic.Empty);
|
|
rpc CloseCollection(CloseCollectionRequest) returns (generic.Empty);
|
|
// Create a no-media backup. Caller must ensure there is no active
|
|
// transaction. Unlike a collection export, does not require reopening the DB,
|
|
// as there is no downgrade step.
|
|
// Returns false if it's not time to make a backup yet.
|
|
rpc CreateBackup(CreateBackupRequest) returns (generic.Bool);
|
|
// If a backup is running, wait for it to complete. Will return an error
|
|
// if the backup encountered an error.
|
|
rpc AwaitBackupCompletion(generic.Empty) returns (generic.Empty);
|
|
rpc LatestProgress(generic.Empty) returns (Progress);
|
|
rpc SetWantsAbort(generic.Empty) returns (generic.Empty);
|
|
}
|
|
|
|
message OpenCollectionRequest {
|
|
string collection_path = 1;
|
|
string media_folder_path = 2;
|
|
string media_db_path = 3;
|
|
|
|
// temporary option for AnkiDroid
|
|
bool force_schema11 = 99;
|
|
}
|
|
|
|
message CloseCollectionRequest {
|
|
bool downgrade_to_schema11 = 1;
|
|
}
|
|
|
|
message CheckDatabaseResponse {
|
|
repeated string problems = 1;
|
|
}
|
|
|
|
message OpChanges {
|
|
bool card = 1;
|
|
bool note = 2;
|
|
bool deck = 3;
|
|
bool tag = 4;
|
|
bool notetype = 5;
|
|
bool config = 6;
|
|
bool deck_config = 11;
|
|
bool mtime = 12;
|
|
|
|
bool browser_table = 7;
|
|
bool browser_sidebar = 8;
|
|
// editor and displayed card in review screen
|
|
bool note_text = 9;
|
|
// whether to call .reset() and getCard()
|
|
bool study_queues = 10;
|
|
}
|
|
|
|
// Allows frontend code to extract changes from other messages like
|
|
// ImportResponse without decoding other potentially large fields.
|
|
message OpChangesOnly {
|
|
collection.OpChanges changes = 1;
|
|
}
|
|
|
|
message OpChangesWithCount {
|
|
OpChanges changes = 1;
|
|
uint32 count = 2;
|
|
}
|
|
|
|
message OpChangesWithId {
|
|
OpChanges changes = 1;
|
|
int64 id = 2;
|
|
}
|
|
|
|
message UndoStatus {
|
|
string undo = 1;
|
|
string redo = 2;
|
|
uint32 last_step = 3;
|
|
}
|
|
|
|
message OpChangesAfterUndo {
|
|
OpChanges changes = 1;
|
|
string operation = 2;
|
|
int64 reverted_to_timestamp = 3;
|
|
UndoStatus new_status = 4;
|
|
uint32 counter = 5;
|
|
}
|
|
|
|
message Progress {
|
|
message MediaSync {
|
|
string checked = 1;
|
|
string added = 2;
|
|
string removed = 3;
|
|
}
|
|
|
|
message FullSync {
|
|
uint32 transferred = 1;
|
|
uint32 total = 2;
|
|
}
|
|
|
|
message NormalSync {
|
|
string stage = 1;
|
|
string added = 2;
|
|
string removed = 3;
|
|
}
|
|
|
|
message DatabaseCheck {
|
|
string stage = 1;
|
|
uint32 stage_total = 2;
|
|
uint32 stage_current = 3;
|
|
}
|
|
|
|
oneof value {
|
|
generic.Empty none = 1;
|
|
MediaSync media_sync = 2;
|
|
string media_check = 3;
|
|
FullSync full_sync = 4;
|
|
NormalSync normal_sync = 5;
|
|
DatabaseCheck database_check = 6;
|
|
string importing = 7;
|
|
string exporting = 8;
|
|
}
|
|
}
|
|
|
|
message CreateBackupRequest {
|
|
string backup_folder = 1;
|
|
// Create a backup even if the configured interval hasn't elapsed yet.
|
|
bool force = 2;
|
|
bool wait_for_completion = 3;
|
|
}
|