From dcd77749dd1fdf6b0c8183bfbdf4f97bf238ebe4 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 20 Mar 2023 09:26:54 +0000 Subject: Add history deletion (#791) * Drop events. I'd still like to do them, but differently * Start adding delete api stuff * Set mailmap * Delete delete delete * Fix tests * Make clippy happy --- atuin-common/src/api.rs | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'atuin-common/src/api.rs') diff --git a/atuin-common/src/api.rs b/atuin-common/src/api.rs index f5d5daa6..6f18d18c 100644 --- a/atuin-common/src/api.rs +++ b/atuin-common/src/api.rs @@ -66,31 +66,18 @@ pub struct IndexResponse { pub version: String, } -// Doubled up with the history sync stuff, because atm we need to support BOTH. -// People are still running old clients, and in some cases _very_ old clients. #[derive(Debug, Serialize, Deserialize)] -pub enum AddEventRequest { - Create(AddHistoryRequest), - - Delete { - id: String, - timestamp: chrono::DateTime, - hostname: chrono::DateTime, - - // When we delete a history item, we push up an event marking its client - // id as being deleted. - history_id: String, - }, +pub struct StatusResponse { + pub count: i64, + pub deleted: Vec, } #[derive(Debug, Serialize, Deserialize)] -pub struct SyncEventRequest { - pub sync_ts: chrono::DateTime, - pub event_ts: chrono::DateTime, - pub host: String, +pub struct DeleteHistoryRequest { + pub client_id: String, } #[derive(Debug, Serialize, Deserialize)] -pub struct SyncEventResponse { - pub events: Vec, +pub struct MessageResponse { + pub message: String, } -- cgit v1.3.1