Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse: add feature to parse and upload msg files #233

Merged
merged 7 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Show Global Permissions in `get users`
- Upgrade `ordered-float` version, which is exposed in the public crate api.
- Add ability to filter users by project and permission
- Add feature to parse unicode msg files

## v0.19.0

Expand Down
23 changes: 21 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ reinfer-client = { version = "0.19.0", path = "../api" }
dialoguer = "0.10.4"
scoped_threadpool = "0.1.9"
backoff = "0.4.0"
cfb = "0.9.0"
encoding_rs = "0.8.33"

[dev-dependencies]
pretty_assertions = "1.3.0"
Expand Down
9 changes: 8 additions & 1 deletion cli/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
commands::{
config::ConfigArgs, create::CreateArgs, delete::DeleteArgs, get::GetArgs,
config::ConfigArgs, create::CreateArgs, delete::DeleteArgs, get::GetArgs, parse::ParseArgs,
update::UpdateArgs,
},
printer::OutputFormat,
Expand Down Expand Up @@ -104,6 +104,13 @@ pub enum Command {
#[structopt(subcommand)]
get_args: GetArgs,
},

#[structopt(name = "parse")]
/// Upload data from various file types
Parse {
#[structopt(subcommand)]
parse_args: ParseArgs,
},
}

#[derive(Debug)]
Expand Down
1 change: 1 addition & 0 deletions cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod config;
pub mod create;
pub mod delete;
pub mod get;
pub mod parse;
pub mod update;

pub fn ensure_uip_user_consents_to_ai_unit_charge(base_url: &Url) -> Result<()> {
Expand Down
21 changes: 21 additions & 0 deletions cli/src/commands/parse/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mod msgs;

use anyhow::Result;
use reinfer_client::Client;
use structopt::StructOpt;

use self::msgs::ParseMsgArgs;

#[derive(Debug, StructOpt)]
pub enum ParseArgs {
#[structopt(name = "msgs")]
/// Parse unicode msg files. Note: Currently the body is processed as plain text.
/// Html bodies are not supported.
Msgs(ParseMsgArgs),
}

pub fn run(args: &ParseArgs, client: Client) -> Result<()> {
match args {
ParseArgs::Msgs(parse_msg_args) => msgs::parse(&client, parse_msg_args),
}
}
Loading
Loading