Commit Graph

374 Commits

Author SHA1 Message Date
Jeremiah Russell
5331551eea ♻️ refactor(cli): use mutable client for subcommands
- change `client` to mutable to allow modification in subcommands
- update subcommands to use the mutable `client`
2025-10-14 07:41:39 +01:00
Jeremiah Russell
92729c9ef4 ♻️ refactor(core): rename Processor to RuleProcessor
- clarifies the purpose of the struct
- avoids naming conflicts
2025-10-14 07:41:39 +01:00
Jeremiah Russell
3d7f76b876 feat(gmail_client): add rule field to GmailClient struct
- Add rule field to GmailClient struct to store EolAction.
2025-10-14 07:41:39 +01:00
Jeremiah Russell
5a1f834a4f feat(eol_action): add clone derive to eolaction enum
- add clone derive to eolaction enum for easier usage and manipulation
2025-10-14 07:41:39 +01:00
Jeremiah Russell
c42f19d19a 🐛 fix(trash): fix trash command with new gmail client
- adapt trash command to use new gmail client methods
- remove unused `Trash` struct
2025-10-14 07:41:39 +01:00
Jeremiah Russell
bc2b4dab0f ♻️ refactor(message_cli): simplify message processing
- remove MessageList struct and move its functionality to GmailClient
- this reduces complexity and streamlines the message processing flow
2025-10-14 07:41:39 +01:00
Jeremiah Russell
0269668c8b ♻️ refactor(delete): streamline delete command execution
- modify delete command to directly use `GmailClient` methods
- remove intermediate `Delete` struct
- simplify command execution flow
2025-10-14 07:41:39 +01:00
Jeremiah Russell
cdcbab0e81 ♻️ refactor(gmail_client): change MessageSummary's visibility
- make MessageSummary public for external usage
2025-10-14 07:41:39 +01:00
Jeremiah Russell
1ff7929095 📝 docs(trash): add documentation to trash methods
- add documentation to trash trait and methods
2025-10-14 07:41:39 +01:00
Jeremiah Russell
b2a2de0981 feat(message_list): enhance message list trait with documentation and functionalities
- add documentation to all methods
- add `hub`, `label_ids`, `message_ids`, `messages`, `set_query`, `add_labels_ids`, `add_labels`, `max_results`, `set_max_results` methods to the `MessageList` trait
2025-10-14 07:41:39 +01:00
Jeremiah Russell
42ac485354 📝 docs(delete): add documentation for delete trait
- add documentation to explain the purpose of the trait
- add documentation for `batch_delete` method
- add documentation for `prepare` method
2025-10-14 07:41:39 +01:00
Jeremiah Russell
947de73d64 feat(core): add message management structs
- introduce Delete, MessageList, and Trash structs for managing messages
- provide basic structure for future message handling implementations
2025-10-14 07:41:39 +01:00
Jeremiah Russell
e45d6cdb9e ♻️ refactor(processor): simplify trash_messages function
- move label adding logic to GmailClient
- remove Trash struct and use GmailClient directly
2025-10-14 07:41:39 +01:00
Jeremiah Russell
1af61d0ed0 ♻️ refactor(core): remove unused trash module
- removes the trash module
- simplifies the crate structure
2025-10-14 07:41:39 +01:00
Jeremiah Russell
f0a268861f ♻️ refactor(trash): refactor trash module to trait implementation
- remove the `Trash` struct
- implement `Trash` as a trait for `GmailClient`
- move `batch_move_to_trash` and `batch_trash` functions to the `Trash` trait implementation
- update function calls to use the new trait implementation
2025-10-14 07:41:39 +01:00
Jeremiah Russell
9625e64979 ♻️ refactor(message_list): remove client parameter from add_labels
- remove client parameter from `add_labels` function to use self
- simplify the function signature and improve code readability
2025-10-14 07:41:39 +01:00
Jeremiah Russell
0ebfde4912 ♻️ refactor(delete): restructure delete functionality
- remove Delete struct
- implement Delete trait for GmailClient
- move prepare and batch_delete functions to GmailClient
- update imports to reflect changes
2025-10-14 07:41:39 +01:00
Jeremiah Russell
2ef8f2f7f3 ♻️ refactor(core): remove unused Delete module
- Delete module is no longer needed.
2025-10-14 07:41:39 +01:00
Jeremiah Russell
33cf154791 ♻️ refactor(processor): consolidate message operations in GmailClient
- move label adding and message deletion logic to GmailClient
- reduce code duplication and improve code structure
- simplify processor methods by reusing GmailClient functions
2025-10-14 07:41:39 +01:00
Jeremiah Russell
8094e46f0f feat(gmail_client): integrate message summary
- introduce message summary struct for efficient data handling
2025-10-14 07:41:39 +01:00
Jeremiah Russell
edc27739f8 ♻️ refactor(gmail_client): move message_summary to gmail_client
- move `message_summary.rs` from `message_list` to `gmail_client` for better organization
- derive `Clone` for `MessageSummary` struct
2025-10-14 07:41:39 +01:00
Jeremiah Russell
247f8e6b00 ♻️ refactor(message_list): implement MessageList trait for GmailClient
- move MessageList trait and implementation to message_list.rs
- implement MessageList trait for GmailClient struct
- remove unused MessageList struct
- update function signatures to use GmailClient instead of MessageList struct
2025-10-14 07:41:39 +01:00
Jeremiah Russell
940daca729 feat(gmail): create gmail client struct
- create gmail client struct
- add label map
- add max results
- add label ids
- add query
- add messages
2025-10-14 07:41:39 +01:00
Jeremiah Russell
4d452ab5b0 ♻️ refactor(cli): use GmailClient instead of credential file
- use GmailClient to reduce redundant credential file passing
2025-10-14 07:41:39 +01:00
Jeremiah Russell
88fbf74587 ♻️ refactor(cli): use client for trash subcommand
- use the api client for the trash subcommand
2025-10-14 07:41:39 +01:00
Jeremiah Russell
cfd33540aa ♻️ refactor(cli): use gmail client in run_cli
- use gmail client in `run_cli` to avoid passing credentials around
2025-10-14 07:41:39 +01:00
Jeremiah Russell
f79fd2d48c ♻️ refactor(cli): pass client to run command
- pass client to run command to enable api calls
2025-10-14 07:41:39 +01:00
Jeremiah Russell
9018fa02d4 ♻️ refactor(processor): use reference for GmailClient in processor builder
- modify the `builder` function to accept a reference to `GmailClient` rather than cloning it
- this avoids unnecessary cloning of the `GmailClient`
2025-10-14 07:41:39 +01:00
Jeremiah Russell
9bdb559104 ♻️ refactor(cli): use client instance for message subcommand
- use client instance for message subcommand to avoid redundant credential file access
2025-10-14 07:41:39 +01:00
Jeremiah Russell
7eeebddf2e ♻️ refactor(cli): use GmailClient for MessageList
- use GmailClient instance instead of credential file path
- pass GmailClient to add_labels
2025-10-14 07:41:39 +01:00
Jeremiah Russell
704b2b023e 🐛 fix(cli): fix delete command
- pass the client to the delete command
2025-10-14 07:41:39 +01:00
Jeremiah Russell
22e1916262 ♻️ refactor(cli): use GmailClient in delete_cli
- use GmailClient struct instead of credential_file path
- simplifies client handling and avoids redundant credential loading
2025-10-14 07:41:39 +01:00
Jeremiah Russell
04478a13f8 ♻️ refactor(cli): use gmail client for label operations
- replace credential file with gmail client for label operations
- use gmail client to list labels
2025-10-14 07:41:39 +01:00
Jeremiah Russell
da8304e02f ♻️ refactor(trash): use GmailClient instead of credential string
- use GmailClient to manage gmail API interactions
- remove credential string
2025-10-14 07:41:39 +01:00
Jeremiah Russell
a22ce8e882 ♻️ refactor(delete): use GmailClient for message list creation
- use GmailClient struct for creating a new message list
- this change improve code maintainability and testability
2025-10-14 07:41:39 +01:00
Jeremiah Russell
3dab10fdfe ♻️ refactor(message_list): update add_labels function to accept &GmailClient
- modify add_labels function to accept a reference to GmailClient
2025-10-14 07:41:39 +01:00
Jeremiah Russell
0dc8f8c47b ♻️ refactor(gmail): improve gmail client structure
- add clone derive to GmailClient struct
- rename get_messages to get_message_list for clarity
2025-10-14 07:41:39 +01:00
Jeremiah Russell
e5b93c0bdd ♻️ refactor(processor): use GmailClient instead of credential_file
- replace credential_file with GmailClient in Processor and ProcessorBuilder
- update builder method to accept GmailClient
- update trash_messages and delete_messages methods to use GmailClient
2025-10-14 07:41:39 +01:00
Jeremiah Russell
4ba9d672a6 ♻️ refactor(cli): remove unused credential file
- remove credential file parameters
- use GmailClient instance instead
2025-10-14 07:41:39 +01:00
Jeremiah Russell
455deb8420 feat(gmail): add get messages functionality
- implement get_messages function to retrieve a list of messages from Gmail
- create a hub function to get the Gmail hub from the client
2025-10-14 07:41:39 +01:00
Jeremiah Russell
ceb4548649 ♻️ refactor(message_list): use gmail client for label retrieval
- removes credential file and Labels struct from add_labels function
- uses GmailClient to get label id
- simplifies label adding process
2025-10-14 07:41:39 +01:00
Jeremiah Russell
ebd5d56603 ♻️ refactor(core): rename labels module to gmail_client
- rename labels module to gmail_client for better clarity and context
2025-10-14 07:41:39 +01:00
Jeremiah Russell
c5ba366ade feat(error): add NoLabelsFound error
- add `NoLabelsFound` error type to handle cases where no labels are found in the mailbox
2025-10-14 07:41:39 +01:00
Jeremiah Russell
946398380b ♻️ refactor(gmail): rename labels.rs to gmail_client.rs
- Renamed `labels.rs` to `gmail_client.rs` for better clarity
- Refactor `Labels` struct to `GmailClient` for better naming
- Update `get_label_map` to use BTreeMap for label storage
- Remove the show flag functionality
2025-10-14 07:41:39 +01:00
Jerus Bot
c76cd42c1d chore: Release cull-gmail v0.0.7 2025-10-12 07:19:53 +00:00
Jeremiah Russell
a3ef97aef2 feat(processor): introduce processor builder
- add ProcessorBuilder for flexible Processor construction
- deprecate Processor::new in favor of Processor::builder
2025-10-12 07:37:54 +01:00
Jeremiah Russell
4592daa1cc feat(cli): add execute option to processor
- allow users to skip execution of actions with a new `execute` option
2025-10-12 07:37:54 +01:00
Jerus Bot
f5c929d1a5 chore: update prlog for pr 2025-10-12 07:37:54 +01:00
Jeremiah Russell
aa1074d4bb feat(processor): add execute flag for dry run
- introduce execute flag to control actual execution of actions
- add set_execute method to modify the execute flag
- log warning message when execution is stopped for dry run
2025-10-12 07:37:54 +01:00
Jeremiah Russell
89dd35d487 feat(cli): add execute flag to run action
- introduce execute flag to control action execution
- add skip_trash flag to skip rules with trash action
- add skip_delete flag to skip rules with delete action
2025-10-12 07:37:54 +01:00