Jeremiah Russell
4830d95a76
✨ feat(rules_cli): add optional label for retention rules
...
- allows users to specify a custom label when adding a retention rule
- if no label is provided, a unique one will be generated automatically
2025-10-08 11:40:55 +01:00
Jeremiah Russell
432c1635af
✨ feat(config): add labels method to EolRule
...
- add `labels` method to `EolRule` to access labels vector
2025-10-08 11:40:55 +01:00
Jeremiah Russell
cf3d93cf13
✨ feat(config): add support for labels to retention rules
...
- allow associating labels with retention rules for more granular control
- add label parameter to `add_rule` function
- check for duplicate rules and labels before adding new ones
2025-10-08 11:40:55 +01:00
Jerus Bot
5da589678e
chore: update prlog for pr
2025-10-08 10:39:38 +01:00
Jeremiah Russell
5c42c0f66d
✨ feat(config): add retention attribute to EolRule
...
- introduce retention attribute in EolRule struct
- implement getter method for accessing retention value
2025-10-08 10:39:38 +01:00
Jeremiah Russell
7610f2a9dc
✨ feat(config): enhance rule management with BTreeMap
...
- migrate rules from Vec to BTreeMap for efficient access
- add rule existence check to prevent duplicates
- improve rule listing by iterating over values
2025-10-08 10:39:38 +01:00
Jerus Bot
b637d249a9
chore: update prlog for pr
2025-10-08 07:56:41 +01:00
Jeremiah Russell
c1ab9a5333
✨ feat(rules_cli): implement add command
...
- add `add` subcommand to create new retention rules
- allow specifying period and count for message age
- support generating labels for new rules
2025-10-08 07:56:41 +01:00
Jeremiah Russell
7b08bfe13a
✨ feat(retention): add message age enum creation
...
- implement `new` function for MessageAge enum
- allow creating MessageAge from string period and count
2025-10-08 07:56:41 +01:00
Jeremiah Russell
b729ee6a10
✨ feat(rules): add subcommand for rule management
...
- introduce RulesCli to handle rule management commands
- implement `add` subcommand with `AddCli` to add rules to the config
2025-10-08 07:56:41 +01:00
Jeremiah Russell
92e88c4261
📝 docs(retention): add documentation for the retention struct
...
- add documentation for the `new` function
2025-10-08 07:56:41 +01:00
Jeremiah Russell
19513f51a9
🐛 fix(rules): fix config_cli.run to return a Result
...
- fix the config_cli.run function to return a Result to handle potential errors
2025-10-08 07:56:41 +01:00
Jeremiah Russell
c1e42dfa50
✨ feat(config): add result type to list_rules function
...
- modify list_rules to return a Result type
- allows for error handling during rule listing
2025-10-08 07:56:41 +01:00
Jeremiah Russell
6b1dedc10a
🐛 fix(config): correct pluralization of time periods in EolRule display
...
- fix pluralization logic for day, week, month, and year
- avoid redundant match arms by pushing 's' when count > 1
2025-10-08 06:42:29 +01:00
Jerus Bot
739f7e69f5
chore: update prlog for pr
2025-10-08 06:42:29 +01:00
Jeremiah Russell
bebf00acb4
♻️ refactor(cli): restructure cli commands and config handling
...
- rename config cli to rules cli for better clarity
- move config loading to rules cli for better modularity
- update command matching to use the new rules cli
2025-10-08 06:42:29 +01:00
Jeremiah Russell
90383226aa
🐛 fix(message_age): correct retention label formatting
...
- fix format string for weeks, months and years
2025-10-08 06:42:29 +01:00
Jeremiah Russell
9e547b62e7
✨ feat(config): implement display for eolrule struct
...
- add display trait implementation for eolrule struct to provide a user-friendly representation of the rule's configuration
- the display format includes the rule id, labels, and retention period, making it easier to understand the rule's settings
2025-10-08 06:42:29 +01:00
Jeremiah Russell
6ef1a337a2
✨ feat(config): add function to list rules
...
- implement list_rules function in Config struct
- iterate through rules and print each rule
2025-10-08 06:42:29 +01:00
Jeremiah Russell
33027a6c34
♻️ refactor(cli): rename config_cli to rules_cli
...
- rename config_cli to rules_cli for better clarity
- rename ConfigCommands to RulesCommands for better clarity
- rename ConfigCli to RulesCli for better clarity
2025-10-08 06:42:29 +01:00
Jerus Bot
39da683fc0
chore: update prlog for pr
2025-10-07 17:34:19 +01:00
Jeremiah Russell
7a1a8f6a1a
🐛 fix(ui): correct grammar errors in eol command and trash messages
...
- fix typo in `Delete` variant description from "immediatly" to "immediately"
- correct grammar in trash log message from "move to trash" to "moved to trash"
2025-10-07 17:34:19 +01:00
Jerus Bot
ed00ab698e
chore: update prlog for pr
2025-10-07 15:59:18 +01:00
Jeremiah Russell
050f00940b
✨ feat(config): implement configuration file management
...
- add config.rs to handle program configuration
- create default configuration with retention rules
- implement save and load functions for persistent storage
- add credential file setting
2025-10-07 15:59:18 +01:00
Jeremiah Russell
17dc58c4a7
✨ feat(retention): introduce message age enum
...
- add MessageAge enum to represent retention periods in days, weeks, months, or years
- implement Display trait for MessageAge to format retention periods
- implement label function to generate retention label
2025-10-07 15:59:18 +01:00
Jeremiah Russell
e77b372413
✨ feat(config): add EolRule struct for managing end-of-life rules
...
- introduce EolRule struct with fields for id, retention, labels, query, and command
- implement methods for creating new rules, setting retention, and adding labels
- add default implementation for EolRule
2025-10-07 15:59:18 +01:00
Jeremiah Russell
f63a0f888d
✨ feat(retention): implement data retention policy
...
- introduce `Retention` struct to define data retention period and label generation flag
- add `MessageAge` enum to represent different retention time units (days, months, years)
- implement default values for retention policy (5 years, generate label)
2025-10-07 15:59:18 +01:00
Jeremiah Russell
4390fe4c2d
✨ feat(cli): load configuration for message command
...
- load config file instead of hardcoding credential path
- create default config if not exist
2025-10-07 15:59:18 +01:00
Jeremiah Russell
ab8df6bdd9
✨ feat(lib): add config and retention modules
...
- add config module for managing application settings
- add retention module for message age management
2025-10-07 15:59:18 +01:00
Jeremiah Russell
c4e4e28f66
🐛 fix(error): refine error handling with granular variants
...
- introduce specific error variants for std::io::Error and toml::de::Error
- remove commented-out error variants to streamline error reporting
2025-10-07 15:59:18 +01:00
Jeremiah Russell
1bbc75206a
✨ feat(eol_cmd): introduce EolCmd enum for message disposal
...
- add Trash and Delete variants for specifying end-of-life actions
- implement Display trait for EolCmd to provide string representation
2025-10-07 15:59:18 +01:00
Jeremiah Russell
9c4e1c989d
🔧 chore(vscode): update disabled rules for ltex extension
...
- add new rules to improve code quality and consistency
2025-10-07 15:59:18 +01:00
Jeremiah Russell
b960436a9f
📦 build(deps): add toml dependency
...
- add toml crate for configuration file parsing
2025-10-07 15:59:18 +01:00
Jeremiah Russell
122d000d6b
✨ feat(build): add toml dependency
...
- add toml crate for configuration file parsing
2025-10-07 15:59:18 +01:00
Jerus Bot
f36b962867
chore: update prlog for pr
2025-10-07 09:54:54 +01:00
Jeremiah Russell
8bab1e3dec
📝 docs(changelog): update changelog for new cli feature
...
- update changelog to reflect the addition of the config subcommand for end-of-life rules in the cli
2025-10-07 09:54:54 +01:00
Jeremiah Russell
9713e42d61
📝 docs(PRLOG): update changelog format
...
- change "Add" to "### Add" for better readability
2025-10-07 09:54:54 +01:00
Jeremiah Russell
a8ac4b1f2a
📝 docs(PRLOG): update PRLOG with unreleased changes
...
- add new "Add" section to highlight new features
- include feat(cli): add config subcommand for end-of-life rules(pr [#34 ])
- remove redundant merge commit entry
2025-10-07 09:54:54 +01:00
Jerus Bot
77b81bdbc3
chore: update prlog for pr
2025-10-07 09:32:58 +01:00
Jeremiah Russell
782cfc4baf
Merge branch 'implement-config-subcommand' of github.com:jerus-org/cull-gmail
2025-10-07 09:32:58 +01:00
Jerus Bot
c68d34867e
chore: update prlog for pr
2025-10-07 07:50:47 +01:00
Jeremiah Russell
2731ee673e
📝 docs(PRLOG): update PRLOG.md
...
- add new feature and change logs
- update unreleased link to HEAD
2025-10-07 07:50:47 +01:00
Jerus Bot
e2087c07a0
chore: Release cull-gmail v0.0.4
2025-10-07 05:23:38 +00:00
Jerus Bot
8f2d9687fe
chore: update prlog for pr
2025-10-06 17:09:47 +01:00
Jeremiah Russell
a0b365a455
✨ feat(message_list): create message summary struct
...
- introduce MessageSummary struct to encapsulate message id and subject
- implement methods to set and retrieve subject, with default if missing
2025-10-06 17:09:47 +01:00
Jeremiah Russell
65f8bf7fc5
✨ feat(utils): implement string elision trait
...
- introduce `Elide` trait for string truncation
- add `elide` function to truncate strings longer than a specified length, adding " ..." at the end
2025-10-06 17:09:47 +01:00
Jeremiah Russell
f42718328e
♻️ refactor(trash): improve trash operation logging
...
- change debug log level to trace for batch request
- remove debug log for response
- log message subject instead of id after trashing
2025-10-06 17:09:47 +01:00
Jeremiah Russell
adaf2b1e30
✨ feat(message_list): improve message handling and logging
...
- create MessageSummary struct to hold message id and subject
- update MessageList to use MessageSummary instead of just message ids
- implement log_message_subjects to fetch and log message subjects
- add elide function to truncate long subjects for better logging
2025-10-06 17:09:47 +01:00
Jeremiah Russell
bfa719959c
🔧 chore(vscode): add cSpell settings
...
- add cSpell settings for vscode
- configure cSpell to include the word "trdir"
2025-10-06 17:09:47 +01:00
Jerus Bot
9c59c8c24b
chore: update prlog for pr
2025-10-06 10:38:30 +01:00