Skip to content
Merged
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
20 changes: 12 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.0] - TBD
## [0.2.0] - TBD

### Added
- Initial release of Appwrite Rust SDK
Expand All @@ -29,9 +29,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Databases service with 69 methods
- Functions service with 26 methods
- Graphql service with 2 methods
- Health service with 29 methods
- Health service with 24 methods
- Locale service with 8 methods
- Messaging service with 56 methods
- Project service with 5 methods
- Sites service with 25 methods
- Storage service with 13 methods
- TablesDB service with 69 methods
Expand Down Expand Up @@ -331,10 +332,7 @@ The Health service allows you to both validate and monitor your Appwrite server&
- `get_db()` - Check the Appwrite database servers are up and connection is successful.
- `get_pub_sub()` - Check the Appwrite pub-sub servers are up and connection is successful.
- `get_queue_audits()` - Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_billing_project_aggregation()` - Get billing project aggregation queue.
- `get_queue_billing_team_aggregation()` - Get billing team aggregation queue.
- `get_queue_builds()` - Get the number of builds that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_priority_builds()` - Get the priority builds queue size.
- `get_queue_certificates()` - Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.
- `get_queue_databases()` - Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_deletes()` - Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.
Expand All @@ -345,10 +343,8 @@ The Health service allows you to both validate and monitor your Appwrite server&
- `get_queue_mails()` - Get the number of mails that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_messaging()` - Get the number of messages that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_migrations()` - Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_region_manager()` - Get region manager queue.
- `get_queue_stats_resources()` - Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.
- `get_queue_usage()` - Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.
- `get_queue_threats()` - Get threats queue.
- `get_queue_webhooks()` - Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.
- `get_storage()` - Check the Appwrite storage device is up and connection is successful.
- `get_storage_local()` - Check the Appwrite local storage device is up and connection is successful.
Expand Down Expand Up @@ -435,6 +431,14 @@ The Messaging service allows you to send messages to any provider type (SMTP, pu

- `delete_subscriber()` - Delete a subscriber by its unique ID.

#### Project
The Project service allows you to manage all the projects in your Appwrite server.
- `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.
- `update_variable()` - Update variable by its unique ID.
- `delete_variable()` - Delete a variable by its unique ID.

#### Sites
The Sites Service allows you view, create and manage your web applications.
- `list()` - Get a list of all the project's sites. You can use the query params to filter your results.
Expand Down Expand Up @@ -849,4 +853,4 @@ If you want to generate a token for a custom authentication flow, use the [POST
- File upload examples
- Query builder documentation

[0.1.0]: https://github.com/appwrite/sdk-for-rust/releases/tag/0.1.0
[0.2.0]: https://github.com/appwrite/sdk-for-rust/releases/tag/0.2.0
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.1.0"
version = "0.2.0"
edition = "2021"
rust-version = "1.83"
authors = ["appwrite"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![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 is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-rust/releases).**
**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-rust/releases).**

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.1.0"
appwrite = "0.2.0"
tokio = { version = "1.48", features = ["full"] }
```

Expand Down
10 changes: 3 additions & 7 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ impl Client {
pub fn new() -> Self {
let mut headers = HeaderMap::new();
headers.insert("X-Appwrite-Response-Format", "1.9.0".parse().unwrap());
headers.insert("user-agent", format!("AppwriteRustSDK/0.1.0 ({}; {})", std::env::consts::OS, std::env::consts::ARCH).parse().unwrap());
headers.insert("user-agent", format!("AppwriteRustSDK/0.2.0 ({}; {})", std::env::consts::OS, std::env::consts::ARCH).parse().unwrap());
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.1.0".parse().unwrap());
headers.insert("x-sdk-version", "0.2.0".parse().unwrap());

let config = Config {
endpoint: "https://cloud.appwrite.io/v1".to_string(),
Expand Down Expand Up @@ -618,11 +618,7 @@ impl Client {

if file_size <= chunk_size as u64 {
let state = self.state.load_full();
let url = if let Some(id) = &options.upload_id {
format!("{}{}/{}", state.config.endpoint, path, id)
} else {
format!("{}{}", state.config.endpoint, path)
};
let url = format!("{}{}", state.config.endpoint, path);

let result = self.single_file_upload(&url, headers, params, param_name, &input_file).await?;

Expand Down
9 changes: 9 additions & 0 deletions src/enums/backup_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ pub enum BackupServices {
#[serde(rename = "databases")]
#[default]
Databases,
#[serde(rename = "tablesdb")]
Tablesdb,
#[serde(rename = "documentsdb")]
Documentsdb,
#[serde(rename = "vectorsdb")]
Vectorsdb,
#[serde(rename = "functions")]
Functions,
#[serde(rename = "storage")]
Expand All @@ -16,6 +22,9 @@ impl BackupServices {
pub fn as_str(&self) -> &str {
match self {
BackupServices::Databases => "databases",
BackupServices::Tablesdb => "tablesdb",
BackupServices::Documentsdb => "documentsdb",
BackupServices::Vectorsdb => "vectorsdb",
BackupServices::Functions => "functions",
BackupServices::Storage => "storage",
}
Expand Down
Loading