From a61b8a94433191bc4e9864e57775f1674ab23b38 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 6 Oct 2026 15:54:23 +0100 Subject: [PATCH] feat: SDK update for version 0.15.0 Adds the optional state parameter to createOAuth2Token (appwrite/appwrite#14157). --- CHANGELOG.md | 4 ++-- Cargo.toml | 2 +- README.md | 2 +- docs/examples/account/create-o-auth-2-token.md | 3 ++- src/client.rs | 4 ++-- src/lib.rs | 4 ++-- src/services/account.rs | 4 ++++ 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c07fabc..72e891a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.14.0] - TBD +## [0.15.0] - TBD ### Added - Initial release of Appwrite Rust SDK @@ -1453,4 +1453,4 @@ The Webhooks service allows you to manage your project webhooks. - File upload examples - Query builder documentation -[0.14.0]: https://github.com/appwrite/sdk-for-rust/releases/tag/0.14.0 +[0.15.0]: https://github.com/appwrite/sdk-for-rust/releases/tag/0.15.0 diff --git a/Cargo.toml b/Cargo.toml index 30e8eea..b4df390 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "appwrite" -version = "0.14.0" +version = "0.15.0" edition = "2021" rust-version = "1.83" authors = ["appwrite"] diff --git a/README.md b/README.md index 36cfa07..515ce02 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -appwrite = "0.14.0" +appwrite = "0.15.0" tokio = { version = "1.48", features = ["full"] } ``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 3fdb0c5..373bef3 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -15,7 +15,8 @@ async fn main() -> Result<(), Box> { appwrite::enums::OAuthProvider::Amazon, Some("https://example.com"), // optional Some("https://example.com"), // optional - Some(vec![]) // optional + Some(vec![]), // optional + Some("") // optional ).await?; let _ = result; diff --git a/src/client.rs b/src/client.rs index 6fd2c32..72dce7f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -95,7 +95,7 @@ impl Client { headers.insert( "user-agent", format!( - "AppwriteRustSDK/0.14.0 ({}; {})", + "AppwriteRustSDK/0.15.0 ({}; {})", std::env::consts::OS, std::env::consts::ARCH ) @@ -105,7 +105,7 @@ impl Client { headers.insert("x-sdk-name", "Rust".parse().unwrap()); headers.insert("x-sdk-platform", "server".parse().unwrap()); headers.insert("x-sdk-language", "rust".parse().unwrap()); - headers.insert("x-sdk-version", "0.14.0".parse().unwrap()); + headers.insert("x-sdk-version", "0.15.0".parse().unwrap()); let config = Config { endpoint: "https://cloud.appwrite.io/v1".to_string(), diff --git a/src/lib.rs b/src/lib.rs index 02e29cb..f046fc6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ //! //! ```toml //! [dependencies] -//! appwrite = "0.14.0" +//! appwrite = "0.15.0" //! ``` //! //! ## Usage @@ -51,7 +51,7 @@ pub use input_file::InputFile; pub type Result = std::result::Result; /// SDK version -pub const VERSION: &str = "0.14.0"; +pub const VERSION: &str = "0.15.0"; /// SDK name pub const SDK_NAME: &str = "Rust"; diff --git a/src/services/account.rs b/src/services/account.rs index 2b88ff2..c3f5004 100644 --- a/src/services/account.rs +++ b/src/services/account.rs @@ -966,6 +966,7 @@ impl Account { success: Option<&str>, failure: Option<&str>, scopes: Option>, + state: Option<&str>, ) -> crate::error::Result { let mut params = HashMap::new(); if let Some(value) = success { @@ -980,6 +981,9 @@ impl Account { json!(value.into_iter().map(|s| s.into()).collect::>()), ); } + if let Some(value) = state { + params.insert("state".to_string(), json!(value)); + } let mut api_headers = HashMap::new(); api_headers.insert("accept".to_string(), "text/html".to_string());