Cleanup of cli

This commit is contained in:
2023-06-09 00:54:34 -04:00
parent 9307ba330c
commit 03c1dac2f2
36 changed files with 614 additions and 272 deletions

View File

@ -7,8 +7,14 @@
* [ ] Download `attachments` (*encrypted* & *decrypted*).
## CLI
* [x] Get `mailboxes` from **[API]** then run `grab messages` job in **[API]** for each one.
* [x] Get `pending attachments` jobs from **[API]** and run.
#### Automatic
* [x] `mailboxes:check`: Get *registered* `mailboxes` and schedule `messages:grab` for `mailbox_id`.
* [x] `attachments:check`: Check *saved* `attachments` and schedule `attachments:decrypt` for `attachment_id`.
* [x] `jobs:check`: Get *pending* `jobs` and run them.
#### Scheduled
* [x] `messages:grab`: Grab `messages` for `mailbox`. Arguments: `mailbox_id`.
* [x] `attachments:grab`: Grab `attachments` for `message`. Arguments: `message_id`.
* [x] `attachments:decrypt`: Decrypt `attachment`. Arguments: `attachment_id`.
## API
* [x] Grab all `mailboxes` from `Email Provider`, identifying those that are registered.
@ -21,18 +27,17 @@
## Workflow
* **[User]** Choose `mailboxes` to register or unregister
-> **[API]** Register selected `mailboxes` and get `messages` for recently registered.
* **[Cron]** Get registered `mailboxes` -> **[API]** Get `messages`
* **[User]** Check messages found -> **[API]** Schedule `attachments`
* **[Cron]** Get `attachment download` jobs -> **[API]** grab `attachments`
* **[User]** Choose `mailboxes` to register or unregister.
-> **[API]** Register selected `mailboxes`, register new `messages:grab` job.
* **[Cron]** Get `jobs`, run `jobs`.
* **[User]** Check messages found -> **[API]** Schedule `attachments`.
### Jobs
## Jobs
#### Automatic
* [ ] Check registered `mailboxes` for new `messages`, logging last check.
* [ ] Check if `attachments` are `encrypted`.
* [ ] Check for new scheduled jobs.
* [x] Check *registered* `mailboxes` for new `messages`. Every weekday.
* [x] Check if `attachments` are *encrypted*. Every weekday.
* [x] Check for new *scheduled* `jobs`. Every minute.
#### Scheduled
* [ ] Grab `messages`.
* [ ] Grab `attachments`.
* [ ] Decrypt `attachments`.
* [ ] Grab `messages` for `mailbox` id.
* [ ] Grab `attachments` for `message` id.
* [ ] Decrypt `attachment`.