Commit Graph

716 Commits

Author SHA1 Message Date
Jeremiah Russell
3beab7d82d ♻️ refactor(cli): restructure cli commands for better organization
- rename `label_cli.rs` to `labels_cli.rs`
- rename `message_cli.rs` to `messages_cli.rs`
- move config related commands to `rules config` subcommand
- introduce `rules run` subcommand
2025-10-15 11:00:14 +01:00
Jerus Bot
7c2bcd37b4 chore: update prlog for pr 2025-10-15 07:21:07 +01:00
Jeremiah Russell
e51cd18f17 ♻️ refactor(message_list): rename messages_list to list_messages
- rename `messages_list` to `list_messages` for clarity
- update all instances of the function call
2025-10-15 07:21:07 +01:00
Jerus Bot
251baa0191 chore: update prlog for pr 2025-10-15 06:36:06 +01:00
Jeremiah Russell
73fa010974 ♻️ refactor(rule_processor): remove unused delete functions
- remove delete_messages and trash_messages functions from GmailClient struct
- these functions were commented out and not used in the current implementation
2025-10-15 06:36:06 +01:00
Jerus Bot
005b2992e2 chore: update prlog for pr 2025-10-15 06:28:07 +01:00
Jeremiah Russell
66b1263c99 🐛 fix(rule_processor): update Gmail API scope
- modify scope to allow broader access to Gmail
2025-10-15 06:28:07 +01:00
Jerus Bot
eeeca08e92 chore: Release cull-gmail v0.0.9 2025-10-14 16:22:52 +00:00
Jeremiah Russell
d31f067a13 🐛 fix(gmail_client): resolve ownership issue in message summary
- clone subject to avoid ownership transfer in format! macro
2025-10-14 17:10:21 +01:00
Jeremiah Russell
37d02bd0bf 🐛 fix(gmail): display message date and subject
- Refactor log_message_subjects to log_messages for clarity
- Simplify date and subject retrieval in log_messages
- Use MessageSummary's list_date_and_subject for logging
- Elide subject in MessageSummary for consistent display
2025-10-14 17:10:21 +01:00
Jeremiah Russell
f9e86bf8d9 ♻️ refactor(cli): rename run_cli to rules_cli
- rename run_cli files to rules_cli
- reflect changes in module imports and subcommand names
2025-10-14 17:10:21 +01:00
Jeremiah Russell
f7db97dd07 ♻️ refactor(cli): consolidate message handling and remove delete command
- 【Refactor】: Move `set_parameters` function from `Message` trait implementation for `DeleteCli` to `MessageCli` to avoid duplication.
- 【Feature】: Add `Delete` action to `MessageAction` enum to allow direct deletion of messages.
- 【Cleanup】: Remove `delete_cli.rs` and `message_trait.rs` as their functionalities are now integrated into `message_cli.rs`.
2025-10-14 17:10:21 +01:00
Jeremiah Russell
1feeccdebe feat(gmail_client): add date to message summary
- add date field to MessageSummary struct
- implement methods to set and retrieve the date
- implement method to list the date and subject
2025-10-14 17:10:21 +01:00
Jeremiah Russell
9f4b2fa6ae feat(gmail): enhance message metadata retrieval
- add date header to message metadata retrieval
- retrieve date and subject from email headers
- set date and subject for each message in the list
2025-10-14 17:10:21 +01:00
Jeremiah Russell
f3a1edaf1f ♻️ refactor(cli): refactor message handling and remove trash command
- 【Refactor】: Moved trash functionality into the message subcommand for better organization.
- 【Refactor】: Removed the separate `trash_cli` module.
- 【Feature】: Added a `Trash` action to the `MessageAction` enum.
- 【Refactor】: Modified `MessageCli::run` to handle the new `Trash` action.
2025-10-14 17:10:21 +01:00
Jeremiah Russell
1052eeb22e feat(cli): enhance cli subcommand ordering and grouping
- improve subcommand organization for better user experience
- implement display_order attribute for logical ordering of subcommands
- introduce next_help_heading for grouping subcommands under meaningful titles
2025-10-14 17:10:21 +01:00
Jerus Bot
af9ced8416 chore: update prlog for pr 2025-10-14 17:10:21 +01:00
Jeremiah Russell
ef88b88ab1 ️ perf(gmail): remove logging message subjects
- remove logging message subjects to improve performance
2025-10-14 17:10:21 +01:00
Jeremiah Russell
02e58275e7 feat(cli): add message list subcommand
- add subcommand to list messages from gmail
- implement message listing functionality
- add ability to specify query and number of pages
2025-10-14 17:10:21 +01:00
Jeremiah Russell
1eefad2cff feat(cli): add configuration options for message listing
- Add max_results, pages, labels, and query options to message CLI
- Allow users to customize message retrieval with flags
2025-10-14 17:10:21 +01:00
Jerus Bot
68a7931308 chore: Release cull-gmail v0.0.8 2025-10-14 06:50:44 +00:00
Jeremiah Russell
b6a53461ce 🐛 fix(cli): correct label adding to use non-async function
- fix label adding to use non-async function
2025-10-14 07:41:39 +01:00
Jeremiah Russell
7b9be5f243 feat(cli): create message trait to share list parameters
- create message trait to share list parameters
- implement message trait for message and delete cli
2025-10-14 07:41:39 +01:00
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