Skip to content

Releases: panghu-huang/octocrate

v2.2.0

23 Feb 04:25
fe2b45b
Compare
Choose a tag to compare

🎉 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

07 Jan 23:48
Compare
Choose a tag to compare

🎉 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

06 May 11:10
1cd78ab
Compare
Choose a tag to compare

🎉 Features

🔧 Fixes

Full Changelog: v0.3.7...v0.3.8

v0.3.7

06 May 11:07
76c1db5
Compare
Choose a tag to compare

🎉 Features

  • Wrap data in a GitHubResponse struct by @ifiokjr in #13
  • Move models and webhooks to octocrate-types by @ifiokjr in #9
  • Add support for pagination by @ifiokjr in #15
  • Switch from derive_builder to typed-builder by @ifiokjr in #11