Skip to content

Commit

Permalink
bump version, add headers for replying in thread
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaffrey committed Aug 20, 2024
1 parent 33f26fd commit 17467a2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "gmail"
edition = "2021"
version = "0.15.8"
version = "0.15.9"
description = "A fluent library for the Gmail API, based on OpenAPI spec"
homepage = "https://github.com/libninjacom/gmail-rs"
documentation = "https://docs.rs/gmail"
Expand All @@ -15,6 +15,7 @@ members = [".", "transform"]
[dependencies]
base64 = "0.22.1"
futures = "0.3.25"
http = "1.1.0"
httpclient = "0.23.0"
httpclient_oauth2 = "0.4"
serde_json = "1.0.81"
Expand Down
18 changes: 18 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,21 @@ transform:
generate:
test -e transform.yaml || just transform
libninja gen -v -lrust --version 0.12.0 gmail transform.yaml

# Bump version. level=major,minor,patch
version level:
git diff-index --exit-code HEAD > /dev/null || ! echo You have untracked changes. Commit your changes before bumping the version.
cargo set-version --bump {{level}}
cargo update # This bumps Cargo.lock
VERSION=$(rg "version = \"([0-9.]+)\"" -or '$1' Cargo.toml | head -n1) && \
git commit -am "Bump version {{level}} to $VERSION" && \
git tag v$VERSION && \
git push origin v$VERSION
git push

publish:
cargo publish

patch: test
just version patch
just publish
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ use httpclient::multipart::Form;
use httpclient_oauth2::RefreshData;
use crate::batch::Batch;
use crate::model::*;

pub mod header_ext {
use http::HeaderName;

pub const IN_REPLY_TO: HeaderName = HeaderName::from_static("in-reply-to");
pub const REFERENCES: HeaderName = HeaderName::from_static("references");
pub const THREAD_ID: HeaderName = HeaderName::from_static("threadid");
}

static SHARED_HTTPCLIENT: OnceLock<httpclient::Client> = OnceLock::new();
pub fn default_http_client() -> httpclient::Client {
httpclient::Client::new().base_url("https://gmail.googleapis.com")
Expand Down
4 changes: 2 additions & 2 deletions transform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "transform"
version = "0.1.0"
version = "0.1.2"
edition = "2021"

[dependencies]
serde_yaml = "0.9.27"
openapiv3-extended = "5.1"
openapiv3-extended = "5.1"

0 comments on commit 17467a2

Please sign in to comment.