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
Jeremiah Russell
fea5c91dcb
♻️ refactor(utils): remove unused get_start_boundary function
...
- remove the `get_start_boundary` function as it is no longer used
2025-10-11 23:07:43 +01:00
Jeremiah Russell
6f2262cdb3
🐛 fix(utils): correct string elision boundary calculation
...
- fix an issue where the elision range could start mid-character
- ensure the elision range always starts at a char boundary
2025-10-11 23:07:43 +01:00
Jerus Bot
7ffa25295c
chore: update prlog for pr
2025-10-11 23:07:43 +01:00
Jeremiah Russell
558b2cfd7f
🐛 fix(utils): correct string elision boundary calculation
...
- ensure elision respects character boundaries for utf-8 strings
- prevent panics when eliding near multi-byte characters
2025-10-11 23:07:43 +01:00
Jerus Bot
4e4e11f20d
chore: update prlog for pr
2025-10-11 10:00:31 +01:00
Jeremiah Russell
bda012e7e7
✨ feat(message_list): increase default max results
...
- increase default max results to 200
2025-10-11 10:00:31 +01:00
Jeremiah Russell
2110d56331
♻️ refactor(cli): extract action execution to separate function
...
- move action execution logic into its own function
- improve readability and maintainability
2025-10-11 09:35:12 +01:00
Jeremiah Russell
d951826c51
♻️ refactor(config): extract common logic to reduce duplication
...
- extract common logic for determining action, period, and count into separate function
- reduce duplication in `fmt::Display` and `describe` methods
2025-10-11 09:35:12 +01:00
Jeremiah Russell
88e1da65c0
♻️ refactor(eol_rule): simplify eol_rule tests
...
- introduce a builder function to reduce duplication in test setup
- remove unnecessary rule id assignment in tests, using default value
2025-10-11 09:35:12 +01:00
Jeremiah Russell
6eb86c5d36
✨ feat(cli): add skip action flags to cli
...
- add flags `--skip-trash` and `--skip-delete` to skip trash and delete actions
- add display order and help heading for better cli usage
2025-10-11 09:35:12 +01:00
Jeremiah Russell
edcc1bbe45
✨ feat(cli): add skip-delete flag to cli
...
- introduce a new flag `--skip-delete`
- add a new option to skip rules with `delete` action
2025-10-11 09:35:12 +01:00
Jeremiah Russell
1997fd2142
✨ feat(cli): add option to skip trash actions
...
- introduce `--skip-trash` flag to prevent trashing messages
- add warning log when a trash action is skipped due to the flag
2025-10-11 09:35:12 +01:00
Jeremiah Russell
81157e6ce9
✨ feat(config): add date calculation for EOL queries
...
- introduce calculate_for_date function to allow EOL query generation for specific dates
- add test cases for EOL query generation with different time spans
2025-10-11 09:35:12 +01:00
Jeremiah Russell
c25f925373
📝 docs(config): fix typo in EolRule::describe documentation
...
- fix typo "peformed" to "performed" in the documentation for the `EolRule::describe` function
2025-10-11 09:35:12 +01:00
Jeremiah Russell
8003cdd76a
🐛 fix(error): correct spelling error in error message
...
- fix typo "LableNotFoundInMailbox" to "LabelNotFoundInMailbox"
2025-10-11 09:35:12 +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
0bab707b02
♻️ refactor(trash): refactor trash command
...
- separates list preparation and trash execution for better modularity
- improves code readability and maintainability
2025-10-11 09:35:12 +01:00
Jeremiah Russell
dbc023d761
♻️ refactor(trash): separate trash preparation and execution
...
- split the run function into prepare and batch_trash
- prepare is for fetching the list, batch_trash will execute the move to trash
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
49e7ff5617
🐛 fix(message_age): correct data type for message age count
...
- change the data type of count from usize to i64 to allow negative values
- add parse method to parse message age from string
2025-10-11 09:35:12 +01:00
Jeremiah Russell
d48abdc3ad
✨ feat(config): add retention period to eol rule
...
- add retention functionality to EolRule
- parse retention string to calculate EOL deadline
- generate 'before:' query based on retention period
2025-10-11 09:35:12 +01:00
Jeremiah Russell
9fa268340f
🐛 fix(cli): correct count type in add_cli
...
- fix: change count type from usize to i64 to allow negative values
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
7ab715c848
🐛 fix(error): add error type for no query string calculated
...
- add `NoQueryStringCalculated` error to handle cases where a query string could not be calculated for a given rule
2025-10-11 09:35:12 +01:00
Jeremiah Russell
244158f538
🐛 fix(error): add specific error for missing label in mailbox
...
- add `LableNotFoundInMailbox` error to handle cases where a label is not found in the mailbox
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
1c2e2da031
✨ feat(cli): implement trash and delete actions
...
- add processor struct to handle gmail api interactions
- implement trash_messages and delete_messages functions in processor
- integrate processor into run_cli to perform actions on messages
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
66edab897f
✨ feat(config): add eol query function
...
- add `eol_query` function to `EolRule` struct
- function returns a string with the current date formatted as "YYYY-MM-DD"
2025-10-11 09:35:12 +01:00
Jeremiah Russell
749616d5ff
♻️ refactor(config): make EolRule public
...
- make `EolRule` public so that it can be used in other crates
2025-10-11 09:35:12 +01:00
Jeremiah Russell
ee085db201
📦 build(deps): update dependencies in Cargo.lock
...
- update chrono to the latest version
- update clap to the latest version
- update clap-verbosity-flag to the latest version
- update env_logger to the latest version
- update googleapis to the latest version
- update iana-time-zone to the latest version
- update js-sys to the latest version
- update num-traits to the latest version
- update serde to the latest version
- update wasm-bindgen to the latest version
- update windows-link to the latest version
2025-10-11 09:35:12 +01:00
Jeremiah Russell
3cbe7eb4ed
✨ feat(cli): add chrono crate as a dependency
...
- add chrono crate for date and time handling
2025-10-11 09:35:12 +01:00
Jeremiah Russell
0d98604fe5
✨ feat(core): introduce message processor module
...
- add `processor.rs` for handling message processing logic
- export `Processor` struct for external use
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
Jeremiah Russell
04308dbbef
📝 docs(config): document labels function in EolRule
...
- add documentation for the labels function in the EolRule struct
2025-10-11 09:35:12 +01:00
Jeremiah Russell
e291eaf001
✨ feat(eol_rule): add describe function for eol rule
...
- add describe function to report the action
- improve code readability
2025-10-11 09:35:12 +01:00
Jeremiah Russell
fb7154f752
✨ feat(cli): implement rule execution logic
...
- add logic to iterate through labels and execute associated rules
- retrieve rules based on label and perform actions like trashing/deleting messages
- log warnings for missing rules or invalid actions
2025-10-11 09:35:12 +01:00
Jeremiah Russell
6a7c67cffc
♻️ refactor(cli): inject config into run command
...
- inject config into run command for better access to settings
2025-10-11 09:35:12 +01:00
Jeremiah Russell
9c237d8681
✨ feat(eol_action): add parse method to EolAction
...
- implement `parse` method for `EolAction` to convert strings to `EolAction` variants
- support "trash" and "delete" strings, return `None` for others
2025-10-11 09:35:12 +01:00