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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## 30.1.0

* Added: `migrations` service to run Appwrite, Firebase, NHost, Supabase, CSV and JSON migrations, plus retries and listing
* Added: `Migration`, `MigrationList` and `MigrationReport` models and the `AppwriteMigrationResource`, `FirebaseMigrationResource`, `NHostMigrationResource`, `SupabaseMigrationResource` and `OnDuplicate` enums
* Added: `project.update_deny_realtime_guests_policy`, the `PolicyDenyRealtimeGuests` model and `ProjectPolicyId::DENY_REALTIME_GUESTS`
* Added: `project.delete_sessions` to sign out every user in the project
* Added: `BillingPlan#deployment_retention`, `#deployment_retention_max` and `#deployments_retention_count`
* Added: `python-3.15`, `deno-2.9`, `go-1.27` and `rust-1.99` to `Runtime` and `BuildRuntime`
* Updated: requests send `X-Appwrite-Response-Format: 2.6.2`; README targets Appwrite 2.6.x
* Updated: redirects are no longer followed; a 3xx raises `Appwrite::Exception` naming the `Location`
* Fixed: path parameters are percent-encoded as one segment; `.` and `..` raise `Appwrite::Exception`
* Fixed: `set_self_signed` keeps TLS on and only skips certificate verification
* Fixed: multipart uploads use a random boundary and escape field and file names

## 30.0.1

* Fixed: the SDK loads on Ruby 4.0; `mime-types` is now `~> 3.6` instead of `~> 3.4.1`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Appwrite Ruby SDK

![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.5.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.6.2-blue.svg?style=flat-square)
[![X Account](https://img.shields.io/badge/follow-%40appwrite-000000?logo=x&style=flat-square)](https://x.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK targets Appwrite server version 2.5.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-ruby/releases) when APIs differ.
**This SDK targets Appwrite server version 2.6.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-ruby/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 Ruby 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 Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'appwrite'
spec.version = '30.0.1'
spec.version = '30.1.0'
spec.license = 'BSD-3-Clause'
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API'
spec.author = 'Appwrite Team'
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/backups/update-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ result = backups.update_policy(
policy_id: '<POLICY_ID>',
name: '<NAME>', # optional
retention: 1, # optional
schedule: '', # optional
schedule: nil, # optional
enabled: false # optional
)
```
21 changes: 21 additions & 0 deletions docs/examples/migrations/create-appwrite-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_appwrite_migration(
resources: [AppwriteMigrationResource::USER],
endpoint: 'https://example.com',
project_id: '<PROJECT_ID>',
api_key: '<API_KEY>',
on_duplicate: OnDuplicate::FAIL # optional
)
```
25 changes: 25 additions & 0 deletions docs/examples/migrations/create-csv-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_csv_export(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
filename: '<FILENAME>',
columns: [], # optional
queries: [], # optional
delimiter: '<DELIMITER>', # optional
enclosure: '<ENCLOSURE>', # optional
escape: '<ESCAPE>', # optional
header: false, # optional
notify: false # optional
)
```
22 changes: 22 additions & 0 deletions docs/examples/migrations/create-csv-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_csv_import(
bucket_id: '<BUCKET_ID>',
file_id: '<FILE_ID>',
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
internal_file: false, # optional
on_duplicate: OnDuplicate::FAIL # optional
)
```
18 changes: 18 additions & 0 deletions docs/examples/migrations/create-firebase-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_firebase_migration(
resources: [FirebaseMigrationResource::USER],
service_account: '<SERVICE_ACCOUNT>'
)
```
21 changes: 21 additions & 0 deletions docs/examples/migrations/create-json-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_json_export(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
filename: '<FILENAME>',
columns: [], # optional
queries: [], # optional
notify: false # optional
)
```
22 changes: 22 additions & 0 deletions docs/examples/migrations/create-json-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_json_import(
bucket_id: '<BUCKET_ID>',
file_id: '<FILE_ID>',
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
internal_file: false, # optional
on_duplicate: OnDuplicate::FAIL # optional
)
```
24 changes: 24 additions & 0 deletions docs/examples/migrations/create-n-host-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_n_host_migration(
resources: [NHostMigrationResource::USER],
subdomain: '<SUBDOMAIN>',
region: '<REGION>',
admin_secret: '<ADMIN_SECRET>',
database: '<DATABASE>',
username: '<USERNAME>',
password: 'password',
port: 5432 # optional
)
```
23 changes: 23 additions & 0 deletions docs/examples/migrations/create-supabase-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```ruby
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.create_supabase_migration(
resources: [SupabaseMigrationResource::USER],
endpoint: 'https://example.com',
api_key: '<API_KEY>',
database_host: '<DATABASE_HOST>',
username: '<USERNAME>',
password: 'password',
port: 5432 # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/migrations/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.delete(
migration_id: '<MIGRATION_ID>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/migrations/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.get(
migration_id: '<MIGRATION_ID>'
)
```
18 changes: 18 additions & 0 deletions docs/examples/migrations/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.list(
queries: [], # optional
search: '<SEARCH>', # optional
total: false # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/migrations/retry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

migrations = Migrations.new(client)

result = migrations.retry(
migration_id: '<MIGRATION_ID>'
)
```
2 changes: 1 addition & 1 deletion docs/examples/mongo/update-backup-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ result = mongo.update_backup_policy(
database_id: '<DATABASE_ID>',
policy_id: '<POLICY_ID>',
name: '<NAME>', # optional
schedule: '', # optional
schedule: nil, # optional
retention: 1, # optional
enabled: false # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/mongo/update-backup-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ result = mongo.update_backup_storage(
secret_key: '<SECRET_KEY>',
region: '<REGION>', # optional
prefix: '<PREFIX>', # optional
endpoint: '<ENDPOINT>' # optional
endpoint: 'https://example.com' # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/mysql/update-backup-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ result = mysql.update_backup_policy(
database_id: '<DATABASE_ID>',
policy_id: '<POLICY_ID>',
name: '<NAME>', # optional
schedule: '', # optional
schedule: nil, # optional
retention: 1, # optional
enabled: false # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/mysql/update-backup-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ result = mysql.update_backup_storage(
secret_key: '<SECRET_KEY>',
region: '<REGION>', # optional
prefix: '<PREFIX>', # optional
endpoint: '<ENDPOINT>' # optional
endpoint: 'https://example.com' # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/oauth2/authorize-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ oauth2 = Oauth2.new(client)
result = oauth2.authorize_post(
client_id: '<CLIENT_ID>', # optional
redirect_uri: 'https://example.com', # optional
response_type: '', # optional
response_type: nil, # optional
scope: '<SCOPE>', # optional
state: '<STATE>', # optional
nonce: '<NONCE>', # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/oauth2/authorize.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ oauth2 = Oauth2.new(client)
result = oauth2.authorize(
client_id: '<CLIENT_ID>', # optional
redirect_uri: 'https://example.com', # optional
response_type: '', # optional
response_type: nil, # optional
scope: '<SCOPE>', # optional
state: '<STATE>', # optional
nonce: '<NONCE>', # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/postgresql/update-backup-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ result = postgresql.update_backup_policy(
database_id: '<DATABASE_ID>',
policy_id: '<POLICY_ID>',
name: '<NAME>', # optional
schedule: '', # optional
schedule: nil, # optional
retention: 1, # optional
enabled: false # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/postgresql/update-backup-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ result = postgresql.update_backup_storage(
secret_key: '<SECRET_KEY>',
region: '<REGION>', # optional
prefix: '<PREFIX>', # optional
endpoint: '<ENDPOINT>' # optional
endpoint: 'https://example.com' # optional
)
```
4 changes: 3 additions & 1 deletion docs/examples/project/create-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand All @@ -12,6 +13,7 @@ project = Project.new(client)

result = project.create_environment(
environment_id: '<ENVIRONMENT_ID>',
name: '<NAME>'
name: '<NAME>',
resources: [EnvironmentResource::DATABASE, EnvironmentResource::TABLE, EnvironmentResource::COLUMN, EnvironmentResource::INDEX, EnvironmentResource::BUCKET, EnvironmentResource::TEAM, EnvironmentResource::FUNCTION, EnvironmentResource::ENVIRONMENT_VARIABLE] # optional
)
```
Loading