Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ 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.3.0] - TBD
## [0.4.0] - TBD

### Added
- Initial release of Appwrite Rust SDK
- Full support for Appwrite API 1.9.1
- Full support for Appwrite API 1.9.2
- Async/await support with tokio runtime
- Built-in error handling with custom error types
- File upload support with automatic chunking
Expand All @@ -32,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Health service with 24 methods
- Locale service with 8 methods
- Messaging service with 56 methods
- Project service with 26 methods
- Project service with 39 methods
- Sites service with 25 methods
- Storage service with 13 methods
- TablesDB service with 69 methods
Expand Down Expand Up @@ -453,8 +453,23 @@ The Project service allows you to manage all the projects in your Appwrite serve
- `update_windows_platform()` - Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name.
- `get_platform()` - Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations.
- `delete_platform()` - Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project.
- `update_protocol_status()` - Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project.
- `update_service_status()` - Update the status of a specific service. Use this endpoint to enable or disable a service in your project.
- `update_membership_privacy_policy()` - Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members..
- `update_password_dictionary_policy()` - Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary.
- `update_password_history_policy()` - Updates one of password strength policies. Based on total length configured, previous password hashes are stored, and users cannot choose a new password that is already stored in the passwird history list, when updating an user password, or setting new one through password recovery.

Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled.
- `update_password_personal_data_policy()` - Updating this policy allows you to control if password strength is checked against personal data. When enabled, and user sets or changes their password, the password must not contain user ID, name, email or phone number.
- `update_session_alert_policy()` - Updating this policy allows you to control if email alert is sent upon session creation. When enabled, and user signs into their account, they will be sent an email notification. There is an exception, the first session after a new sign up does not trigger an alert, even if the policy is enabled.
- `update_session_duration_policy()` - Update maximum duration how long sessions created within a project should stay active for.
- `update_session_invalidation_policy()` - Updating this policy allows you to control if existing sessions should be invalidated when a password of a user is changed. When enabled, and user changes their password, they will be logged out of all their devices.
- `update_session_limit_policy()` - Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one.
- `update_user_limit_policy()` - Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited.
- `update_protocol()` - Update properties of a specific protocol. Use this endpoint to enable or disable a protocol in your project.
- `update_service()` - Update properties of a specific service. Use this endpoint to enable or disable a service in your project.
- `update_smtp()` - Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails.
- `create_smtp_test()` - Send a test email to verify SMTP configuration.
- `update_email_template()` - Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.
- `get_email_template()` - Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details.
- `list_variables()` - Get a list of all project environment variables.
- `create_variable()` - Create a new project environment variable. These variables can be accessed by all functions and sites in the project.
- `get_variable()` - Get a variable by its unique ID.
Expand Down Expand Up @@ -854,6 +869,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
- `HealthTime` - Health Time
- `Headers` - Headers
- `Specification` - Specification
- `EmailTemplate` - EmailTemplate
- `MfaChallenge` - MFA Challenge
- `MfaRecoveryCodes` - MFA Recovery Codes
- `MfaType` - MFAType
Expand Down Expand Up @@ -889,4 +905,4 @@ If you want to generate a token for a custom authentication flow, use the [POST
- File upload examples
- Query builder documentation

[0.3.0]: https://github.com/appwrite/sdk-for-rust/releases/tag/0.3.0
[0.4.0]: https://github.com/appwrite/sdk-for-rust/releases/tag/0.4.0
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "appwrite"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
rust-version = "1.83"
authors = ["appwrite"]
Expand All @@ -21,8 +21,10 @@ serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
reqwest = { version = "0.12.28", features = ["json", "multipart", "stream"] }
tokio = { version = "1.48.0", features = ["full"] }
indexmap = ">=2, <2.12"
url = ">=2.4.1, <2.5"
indexmap = ">=2, <2.14"
url = ">=2.5.4, <2.6"
idna = ">=1.0.3, <1.2"
idna_adapter = ">=1.0.0, <1.1"
mime = "0.3.17"
fastrand = "=2.0.2"
thiserror = "1.0.69"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Rust SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-rust.svg)
![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg)
![Version](https://img.shields.io/badge/api%20version-1.9.2-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)

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-boolean-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
false,
Some(false),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-datetime-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"2020-10-15T06:38:00.000+00:00",
Some("2020-10-15T06:38:00.000+00:00"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-email-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"email@example.com",
Some("email@example.com"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-enum-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"",
vec![],
false,
"<DEFAULT>",
Some("<DEFAULT>"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
0,
Some(0),
Some(0), // optional
Some(0), // optional
Some("") // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
0,
Some(0),
Some(0), // optional
Some(0), // optional
Some("") // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-ip-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"",
Some(""),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-longtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"<DEFAULT>",
Some("<DEFAULT>"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-mediumtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"<DEFAULT>",
Some("<DEFAULT>"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-string-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"<DEFAULT>",
Some("<DEFAULT>"),
Some(1), // optional
Some("") // optional
).await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-text-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"<DEFAULT>",
Some("<DEFAULT>"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-url-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"https://example.com",
Some("https://example.com"),
Some("") // optional
).await?;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/update-varchar-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"<COLLECTION_ID>",
"",
false,
"<DEFAULT>",
Some("<DEFAULT>"),
Some(1), // optional
Some("") // optional
).await?;
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/project/create-smtp-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

project.create_smtp_test(
vec![]
).await?;

Ok(())
}
```
23 changes: 23 additions & 0 deletions docs/examples/project/get-email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

let result = project.get_email_template(
appwrite::enums::EmailTemplateType::Verification,
Some(appwrite::enums::EmailTemplateLocale::Af) // optional
).await?;

let _ = result;

Ok(())
}
```
29 changes: 29 additions & 0 deletions docs/examples/project/update-email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

let result = project.update_email_template(
appwrite::enums::EmailTemplateType::Verification,
Some(appwrite::enums::EmailTemplateLocale::Af), // optional
Some("<SUBJECT>"), // optional
Some("<MESSAGE>"), // optional
Some("<SENDER_NAME>"), // optional
Some("email@example.com"), // optional
Some("email@example.com"), // optional
Some("<REPLY_TO_NAME>") // optional
).await?;

let _ = result;

Ok(())
}
```
26 changes: 26 additions & 0 deletions docs/examples/project/update-membership-privacy-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

let result = project.update_membership_privacy_policy(
Some(false), // optional
Some(false), // optional
Some(false), // optional
Some(false), // optional
Some(false) // optional
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/project/update-password-dictionary-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

let result = project.update_password_dictionary_policy(
false
).await?;

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/project/update-password-history-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

let result = project.update_password_history_policy(
Some(1)
).await?;
Comment thread
greptile-apps[bot] marked this conversation as resolved.

let _ = result;

Ok(())
}
```
22 changes: 22 additions & 0 deletions docs/examples/project/update-password-personal-data-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```rust
use appwrite::Client;
use appwrite::services::Project;

#[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_key("<YOUR_API_KEY>"); // Your secret API key

let project = Project::new(&client);

let result = project.update_password_personal_data_policy(
false
).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 project = Project::new(&client);

let result = project.update_protocol_status(
let result = project.update_protocol(
appwrite::enums::ProtocolId::Rest,
false
).await?;
Expand Down
Loading