Releases: panghu-huang/octocrate
Releases · panghu-huang/octocrate
v2.2.0
🎉 Features
- Support using files as request body or sending
multipart/form-data
requests
use octocrate::{repos, APIConfig, GitHubAPI, PersonalAccessToken};
use tokio::fs::File;
#[tokio::main]
async fn main() {
let file_path = std::path::Path::new("test.txt");
// File is from tokio::fs module
let file = File::open(file_path).await.unwrap();
// Get the file's length
let content_length = file.metadata().await.unwrap().len();
let query = repos::upload_release_asset::Query::builder()
.name("test.txt")
.build();
let release_asset = github_api
.repos
.upload_release_asset("panghu-huang", "octocrate", release.id)
.query(&query)
// Set the content type of the file
.header("Content-Type", "text/plain")
// Set the content length of the file
.header("Content-Length", content_length.to_string())
// Set the file content
.file(file)
.send()
.await
.unwrap();
// ..
}
Full Changelog: v2.0.1...v2.2.0
v2.0.1
🎉 Features
- Optimizing the way of importing types (
Query
/Request
/Response
) by @panghu-huang in #36
// Before
let request = IssuesCreateCommentRequest {
// ..
};
let query = PullsListQuery::builder()
.state(PullsListQueryState::Open)
.per_page(10)
.build()
// After
let request = issues::create_comment::Request {
// ...
};
let query = pulls::list::Query::builder()
.state(pulls::list::QueryState::Open)
.per_page(10)
.build()
🔧 Fixes
- Fix installation token not impl
ExpirableToken
Full Changelog: v0.3.8...v2.0.1
v0.3.8
🎉 Features
- Add webhooks features by @panghu-huang in #23
- Make enum copiable by @panghu-huang in #28
- Expose the
reqwest/rustls-tls
feature by @dholroyd in #30
🔧 Fixes
- Webhooks and APIs can't share types fix by @panghu-huang in #27
- Parameter schema definition fix by @panghu-huang in #31
Full Changelog: v0.3.7...v0.3.8