From 74b84f6de0bad1b6fec9f8f69f0ae39ae011060a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 10 Jul 2024 10:07:21 -0700 Subject: [PATCH 1/3] typo --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7e7b636..d258ee8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -522,7 +522,7 @@ async fn cookie_from_args(literal:Option,environment:Option,file (Some(cookie_literal),None,None)=>cookie_literal, (None,Some(cookie_environment),None)=>std::env::var(cookie_environment)?, (None,None,Some(cookie_file))=>tokio::fs::read_to_string(cookie_file).await?, - _=>Err(anyhow::Error::msg("Illegal api key argument triple"))?, + _=>Err(anyhow::Error::msg("Illegal cookie argument triple"))?, }; Ok(Cookie::new(format!(".ROBLOSECURITY={cookie}"))) } From 4c00d7fe1ab3e355b550f0b4271fe8e38cbbe128 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 10 Jul 2024 10:14:35 -0700 Subject: [PATCH 2/3] use old asset api for compile-upload-asset --- src/main.rs | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main.rs b/src/main.rs index d258ee8..b014d63 100644 --- a/src/main.rs +++ b/src/main.rs @@ -193,12 +193,14 @@ struct CompileSubcommand{ struct CompileUploadAssetSubcommand{ #[arg(long)] asset_id:AssetID, - #[arg(long,group="api_key",required=true)] - api_key_literal:Option, - #[arg(long,group="api_key",required=true)] - api_key_envvar:Option, - #[arg(long,group="api_key",required=true)] - api_key_file:Option, + #[arg(long,group="cookie",required=true)] + cookie_literal:Option, + #[arg(long,group="cookie",required=true)] + cookie_envvar:Option, + #[arg(long,group="cookie",required=true)] + cookie_file:Option, + #[arg(long)] + group_id:Option, #[arg(long)] input_folder:Option, #[arg(long)] @@ -462,12 +464,13 @@ async fn main()->AResult<()>{ input_folder:subcommand.input_folder.unwrap_or_else(||std::env::current_dir().unwrap()), template:subcommand.template, style:subcommand.style.map(|s|s.rox()), - api_key:api_key_from_args( - subcommand.api_key_literal, - subcommand.api_key_envvar, - subcommand.api_key_file, + cookie:cookie_from_args( + subcommand.cookie_literal, + subcommand.cookie_envvar, + subcommand.cookie_file, ).await?, asset_id:subcommand.asset_id, + group_id:subcommand.group_id, }).await, Commands::CompileUploadPlace(subcommand)=>compile_upload_place(CompileUploadPlaceConfig{ input_folder:subcommand.input_folder.unwrap_or_else(||std::env::current_dir().unwrap()), @@ -1137,7 +1140,8 @@ struct CompileUploadAssetConfig{ input_folder:PathBuf, template:Option, style:Option, - api_key:ApiKey, + cookie:Cookie, + group_id:Option, asset_id:AssetID, } async fn compile_upload_asset(config:CompileUploadAssetConfig)->AResult<()>{ @@ -1157,11 +1161,14 @@ async fn compile_upload_asset(config:CompileUploadAssetConfig)->AResult<()>{ rbx_binary::to_writer(std::io::Cursor::new(&mut data),&dom,dom.root().children())?; //upload it - let context=CloudContext::new(config.api_key); - let resp=context.update_asset(rbx_asset::cloud::UpdateAssetRequest{ - assetId:config.asset_id, - displayName:None, + let context=CookieContext::new(config.cookie); + let resp=context.upload(rbx_asset::cookie::UploadRequest{ + groupId:config.group_id, + assetid:config.asset_id, + name:None, description:None, + ispublic:None, + allowComments:None, },data).await?; println!("UploadResponse={:?}",resp); Ok(()) From 7ab064e61e56037486fa2e4dc1f4e80de0e848cb Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 10 Jul 2024 10:16:11 -0700 Subject: [PATCH 3/3] v0.4.3 use old api for compile-upload-asset --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f5bcaf..6c2967b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,7 +110,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asset-tool" -version = "0.4.2" +version = "0.4.3" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index a51cd1d..a8d9edb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ workspace = { members = ["rbx_asset", "rox_compiler"] } [package] name = "asset-tool" -version = "0.4.2" +version = "0.4.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html