Commit Graph

11 Commits

Author SHA1 Message Date
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
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
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
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
3986349c08 🐛 fix(processor): correct typo in error message
- fix typo "LableNotFoundInMailbox" to "LabelNotFoundInMailbox"
2025-10-11 09:35:12 +01:00
Jeremiah Russell
01b9e7677d 🐛 fix(processor): execute delete messages
- execute final delete messages only when execute flag is true
2025-10-11 09:35:12 +01:00
Jeremiah Russell
7cf475ce39 🐛 fix(processor): handle None query in eol_query
- fix issue where eol_query could return None, causing a panic
- handle the None case by returning an error
2025-10-11 09:35:12 +01:00
Jeremiah Russell
e0d319698f feat(processor): add label existence check before processing
- check if the label exists in the mailbox before proceeding to trash or delete messages
- return an error if the label is not found, preventing further processing
2025-10-11 09:35:12 +01:00
Jeremiah Russell
c7eb6a5581 feat(processor): add trash and delete message functionality
- implements trash and delete messages functionality
- adds EolAction enum to define action type
- adds action method to the processor
2025-10-11 09:35:12 +01:00
Jeremiah Russell
629c9d2e46 feat(processor): implement message deletion functionality
- add `delete_messages` function to delete messages based on label and query
- add execute flag to processor struct to control the execution of deletion
2025-10-11 09:35:12 +01:00
Jeremiah Russell
6ba563dacf feat(processor): implement rule processor
- implements struct `Processor` to manage rules for trashing messages
- adds method `trash_messages` to list and trash messages with labels and queries
2025-10-11 09:35:12 +01:00