Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
298 changes: 261 additions & 37 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "appwrite"
version = "0.16.0"
version = "0.17.0"
edition = "2021"
rust-version = "1.83"
authors = ["appwrite"]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Appwrite Rust SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-rust.svg)
![Version](https://img.shields.io/badge/api%20version-2.0.0-blue.svg)
![Version](https://img.shields.io/badge/api%20version-2.4.0-blue.svg)
[![Crates.io](https://img.shields.io/crates/v/appwrite.svg)](https://crates.io/crates/appwrite)
[![Documentation](https://docs.rs/appwrite/badge.svg)](https://docs.rs/appwrite)

**This SDK targets Appwrite server version 1.9.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-rust/releases) when APIs differ.
**This SDK targets Appwrite server version 2.4.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-rust/releases) when APIs differ.

Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Rust SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand All @@ -17,7 +17,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
appwrite = "0.16.0"
appwrite = "0.17.0"
tokio = { version = "1.48", features = ["full"] }
```

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let result = account.create_email_password_session(
"email@example.com",
"password"
"password",
Some(60) // optional
).await?;

let _ = result;
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/account/create-email-verification-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_email_verification_otp(
Some(false) // optional
).await?;

let _ = result;

Ok(())
}
```
27 changes: 27 additions & 0 deletions docs/examples/account/create-id-token-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_id_token_session(
appwrite::enums::IdTokenProvider::Apple,
"<ID_TOKEN>",
Some("<NONCE>"), // optional
Some("<ACCESS_TOKEN>"), // optional
Some(0), // optional
Some("<NAME>") // optional
).await?;

let _ = result;

Ok(())
}
```
20 changes: 20 additions & 0 deletions docs/examples/account/create-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_passkey_token().await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/create-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_passkey(
Some("<PASSKEY_ID>"), // optional
Some("<NAME>") // optional
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/create-recovery-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.create_recovery_otp(
"email@example.com",
Some(false) // optional
).await?;

let _ = result;

Ok(())
}
```
4 changes: 1 addition & 3 deletions docs/examples/account/delete-consent-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

let result = account.delete_consent_token(
account.delete_consent_token(
"<CONSENT_ID>",
"<TOKEN_ID>"
).await?;

let _ = result;

Ok(())
}
```
4 changes: 1 addition & 3 deletions docs/examples/account/delete-consent.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

let result = account.delete_consent(
account.delete_consent(
"<CONSENT_ID>"
).await?;

let _ = result;

Ok(())
}
```
20 changes: 20 additions & 0 deletions docs/examples/account/delete-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

account.delete_passkey(
"<PASSKEY_ID>"
).await?;

Ok(())
}
```
4 changes: 3 additions & 1 deletion docs/examples/account/delete-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

account.delete_sessions().await?;
account.delete_sessions(
Some(false) // optional
).await?;

Ok(())
}
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/account/get-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.get_passkey(
"<PASSKEY_ID>"
).await?;

let _ = result;

Ok(())
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

let result = account.list_logs(
let result = account.list_passkeys(
Some(vec![]), // optional
Some(false) // optional
).await?;
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/account/list-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let account = Account::new(&client);

let result = account.list_sessions().await?;
let result = account.list_sessions(
Some(false) // optional
).await?;

let _ = result;

Expand Down
23 changes: 23 additions & 0 deletions docs/examples/account/update-email-verification-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_email_verification_otp(
"<USER_ID>",
"<SECRET>"
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/update-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_passkey_token(
"<CHALLENGE_ID>",
serde_json::json!({})
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/update-passkey-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_passkey_verification(
"<PASSKEY_ID>",
serde_json::json!({})
).await?;

let _ = result;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/account/update-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_passkey(
"<PASSKEY_ID>",
"<NAME>"
).await?;

let _ = result;

Ok(())
}
```
24 changes: 24 additions & 0 deletions docs/examples/account/update-recovery-otp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```rust
use appwrite::Client;
use appwrite::services::Account;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
client.set_session(""); // The user session to authenticate with

let account = Account::new(&client);

let result = account.update_recovery_otp(
"<USER_ID>",
"<SECRET>",
"password"
).await?;

let _ = result;

Ok(())
}
```
Loading