Commit Graph

693 Commits

Author SHA1 Message Date
Jeremiah Russell
e488cd25cf ♻️ refactor(cli): streamline message retrieval and parameter setting
- extract parameter setting logic into a separate function `set_parameters`
- consolidate label adding, query setting, and max results setting into `set_parameters`
- rename `run` to `get_messages` for clarity
- add methods for retrieving labels, query, and max_results
2025-10-14 07:41:39 +01:00
Jeremiah Russell
fe4a85f5e3 ♻️ refactor(cli): extract parameter setting logic
- move parameter setting into a separate function
- create getter functions for struct members
2025-10-14 07:41:39 +01:00
Jeremiah Russell
b1fc7f713a 🐛 fix(rule_processor): fix label creation and message retrieval
- fix label creation by removing async
- fix message retrieval by renaming run to get_messages
2025-10-14 07:41:39 +01:00
Jeremiah Russell
50a3b394de ♻️ refactor(message_list): rename run to get_messages
- rename run to get_messages for better clarity
- remove async from add_labels trait and implementation
2025-10-14 07:41:39 +01:00
Jeremiah Russell
7e1d07b3ab feat(cli): add message trait for cli subcommands
- introduce a trait to handle message-related operations
- implement the trait for config, delete, label, message, run, and trash subcommands
2025-10-14 07:41:39 +01:00
Jerus Bot
6d8ebb6faa chore: update prlog for pr 2025-10-14 07:41:39 +01:00
Jeremiah Russell
ec5b7493c5 feat(cli): implement batch actions for trashing and deleting
- refactor `execute_action` to use `batch_trash` and `batch_delete`
- remove individual message trashing/deletion in favor of batch processing
- streamline action execution based on `self.execute` flag
2025-10-14 07:41:39 +01:00
Jeremiah Russell
011da42664 ♻️ refactor(cli): remove unused Delete import
- remove unused `Delete` import from `cull_gmail`
2025-10-14 07:41:39 +01:00
Jeremiah Russell
882fb60100 🔥 chore(core): remove trash functionality
- removes unused trash module and related code
- simplifies codebase by removing unnecessary feature
2025-10-14 07:41:39 +01:00
Jeremiah Russell
74d1488ecd feat(rule_processor): implement rule processing for Gmail
- implements RuleProcessor trait for GmailClient
- adds functionality to find rules, prepare and execute actions on messages
- supports batch delete and trash operations
2025-10-14 07:41:39 +01:00
Jeremiah Russell
e02f0ee3d1 ♻️ refactor(cli): remove unused Delete, Trash trait
- Remove Delete and Trash traits from cull_gmail
- Use RuleProcessor instead of Delete and Trash traits
2025-10-14 07:41:39 +01:00
Jeremiah Russell
739176048e ♻️ refactor(core): remove processor.rs
- remove unused processor.rs file
2025-10-14 07:41:39 +01:00
Jeremiah Russell
b4cf8d916a ♻️ refactor(message): remove delete functionality
- delete.rs is removed as a part of refactoring
- the delete functionality will be moved to another module
2025-10-14 07:41:39 +01:00
Jeremiah Russell
9674974ffe ♻️ refactor(core): restructure modules for clarity
- rename and relocate modules for better organization
- replace `processor` with `rule_processor`
- remove `delete` and `trash` modules
2025-10-14 07:41:39 +01:00
Jeremiah Russell
e3c78bc058 feat(gmail_client): add execute flag and EolRule
- add execute flag to control actual execution
- support EolRule to handle end-of-line characters
2025-10-14 07:41:39 +01:00
Jeremiah Russell
20fbae74e6 feat(processor): add execute flag to GmailClient
- add the execute flag to control the execution of the GmailClient
- implement setter function for the execute flag
2025-10-14 07:41:39 +01:00
Jeremiah Russell
35235afc26 🐛 fix(cli): fix rule execution and client handling
- modify the `run` function to accept a mutable `GmailClient` reference
- set the rule and execute flag on the client before executing the action
- remove the `RuleProcessor` and directly use the `GmailClient` for actions
- this simplifies the code and ensures the client is properly configured for each rule
2025-10-14 07:41:39 +01:00
Jeremiah Russell
4eea2c6135 ♻️ refactor(processor): implement RuleProcessor trait for GmailClient
- move rule processing logic into the GmailClient struct
- implement RuleProcessor trait for GmailClient to handle trash and delete actions
- add set_rule method to set the rule for processing
- update trash_messages and delete_messages to use the GmailClient's internal state
2025-10-14 07:41:39 +01:00
Jeremiah Russell
7c397c84d9 ♻️ refactor(cli): rename Processor to RuleProcessor
- rename `Processor` struct to `RuleProcessor` for better clarity
- update all references to reflect the change
2025-10-14 07:41:39 +01:00
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