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

## 22.0.0

* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents
* [BREAKING] Renamed `IndexType` enum: split into `DatabasesIndexType` (for Databases) and `TablesDBIndexType` (for TablesDB)
* [BREAKING] Replaced `specification` parameter with `build_specification` and `runtime_specification` in `Functions#create`, `Functions#update`, `Sites#create`, `Sites#update`
* Added new `Project` service with full CRUD for project-level environment variables
* Added new `Webhooks` service with full CRUD for project webhooks (including `update_signature`)
* Added `Webhook` and `WebhookList` models
* Added `Users#update_impersonator` method for enabling/disabling user impersonation
* Added impersonation support: `set_impersonate_user_id`, `set_impersonate_user_email`, `set_impersonate_user_phone` on `Client`
* Added `impersonator` and `impersonator_user_id` fields to `User` model
* Added `deployment_retention` parameter to Functions and Sites create/update
* Added `start_command` parameter to Sites create/update
* Added `Documentsdb`, `Vectorsdb` values to `BackupServices` and `DatabaseType` enums
* Added `WebhooksRead`, `WebhooksWrite`, `ProjectRead`, `ProjectWrite` scopes
* Removed `get_queue_billing_project_aggregation`, `get_queue_billing_team_aggregation`, `get_queue_priority_builds`, `get_queue_region_manager`, `get_queue_threats` from `Health` service
* Updated `Log` model field descriptions to clarify impersonation behavior
* Updated `X-Appwrite-Response-Format` header to `1.9.0`
* Updated README badge to API version `1.9.0` and compatibility to server version `1.9.x`

## 21.1.0

* Added get_console_pausing health endpoint to monitor console pausing.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Ruby SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/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-ruby/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 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,7 +1,7 @@
Gem::Specification.new do |spec|

spec.name = 'appwrite'
spec.version = '21.1.0'
spec.version = '22.0.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/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ result = databases.create_index(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
type: IndexType::KEY,
type: DatabasesIndexType::KEY,
attributes: [],
orders: [OrderBy::ASC], # optional
lengths: [] # optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ result = functions.create(
provider_branch: '<PROVIDER_BRANCH>', # optional
provider_silent_mode: false, # optional
provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional
specification: '' # optional
build_specification: '', # optional
runtime_specification: '', # optional
deployment_retention: 0 # optional
)
```
4 changes: 3 additions & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ result = functions.update(
provider_branch: '<PROVIDER_BRANCH>', # optional
provider_silent_mode: false, # optional
provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional
specification: '' # optional
build_specification: '', # optional
runtime_specification: '', # optional
deployment_retention: 0 # optional
)
```
19 changes: 19 additions & 0 deletions docs/examples/project/create-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```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

project = Project.new(client)

result = project.create_variable(
variable_id: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/delete-variable.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

project = Project.new(client)

result = project.delete_variable(
variable_id: '<VARIABLE_ID>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/get-variable.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

project = Project.new(client)

result = project.get_variable(
variable_id: '<VARIABLE_ID>'
)
```
17 changes: 17 additions & 0 deletions docs/examples/project/list-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```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

project = Project.new(client)

result = project.list_variables(
queries: [], # optional
total: false # optional
)
```
19 changes: 19 additions & 0 deletions docs/examples/project/update-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```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

project = Project.new(client)

result = project.update_variable(
variable_id: '<VARIABLE_ID>',
key: '<KEY>', # optional
value: '<VALUE>', # optional
secret: false # optional
)
```
5 changes: 4 additions & 1 deletion docs/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ result = sites.create(
timeout: 1, # optional
install_command: '<INSTALL_COMMAND>', # optional
build_command: '<BUILD_COMMAND>', # optional
start_command: '<START_COMMAND>', # optional
output_directory: '<OUTPUT_DIRECTORY>', # optional
adapter: Adapter::STATIC, # optional
installation_id: '<INSTALLATION_ID>', # optional
Expand All @@ -29,6 +30,8 @@ result = sites.create(
provider_branch: '<PROVIDER_BRANCH>', # optional
provider_silent_mode: false, # optional
provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional
specification: '' # optional
build_specification: '', # optional
runtime_specification: '', # optional
deployment_retention: 0 # optional
)
```
5 changes: 4 additions & 1 deletion docs/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ result = sites.update(
timeout: 1, # optional
install_command: '<INSTALL_COMMAND>', # optional
build_command: '<BUILD_COMMAND>', # optional
start_command: '<START_COMMAND>', # optional
output_directory: '<OUTPUT_DIRECTORY>', # optional
build_runtime: BuildRuntime::NODE_14_5, # optional
adapter: Adapter::STATIC, # optional
Expand All @@ -29,6 +30,8 @@ result = sites.update(
provider_branch: '<PROVIDER_BRANCH>', # optional
provider_silent_mode: false, # optional
provider_root_directory: '<PROVIDER_ROOT_DIRECTORY>', # optional
specification: '' # optional
build_specification: '', # optional
runtime_specification: '', # optional
deployment_retention: 0 # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ result = tables_db.create_index(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
type: IndexType::KEY,
type: TablesDBIndexType::KEY,
columns: [],
orders: [OrderBy::ASC], # optional
lengths: [] # optional
Expand Down
17 changes: 17 additions & 0 deletions docs/examples/users/update-impersonator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```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

users = Users.new(client)

result = users.update_impersonator(
user_id: '<USER_ID>',
impersonator: false
)
```
23 changes: 23 additions & 0 deletions docs/examples/webhooks/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```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

webhooks = Webhooks.new(client)

result = webhooks.create(
webhook_id: '<WEBHOOK_ID>',
url: '',
name: '<NAME>',
events: [],
enabled: false, # optional
security: false, # optional
http_user: '<HTTP_USER>', # optional
http_pass: '<HTTP_PASS>' # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/webhooks/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

webhooks = Webhooks.new(client)

result = webhooks.delete(
webhook_id: '<WEBHOOK_ID>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/webhooks/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

webhooks = Webhooks.new(client)

result = webhooks.get(
webhook_id: '<WEBHOOK_ID>'
)
```
17 changes: 17 additions & 0 deletions docs/examples/webhooks/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```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

webhooks = Webhooks.new(client)

result = webhooks.list(
queries: [], # optional
total: false # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/webhooks/update-signature.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

webhooks = Webhooks.new(client)

result = webhooks.update_signature(
webhook_id: '<WEBHOOK_ID>'
)
```
23 changes: 23 additions & 0 deletions docs/examples/webhooks/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```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

webhooks = Webhooks.new(client)

result = webhooks.update(
webhook_id: '<WEBHOOK_ID>',
name: '<NAME>',
url: '',
events: [],
enabled: false, # optional
security: false, # optional
http_user: '<HTTP_USER>', # optional
http_pass: '<HTTP_PASS>' # optional
)
```
7 changes: 6 additions & 1 deletion lib/appwrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
require_relative 'appwrite/models/runtime_list'
require_relative 'appwrite/models/deployment_list'
require_relative 'appwrite/models/execution_list'
require_relative 'appwrite/models/webhook_list'
require_relative 'appwrite/models/country_list'
require_relative 'appwrite/models/continent_list'
require_relative 'appwrite/models/language_list'
Expand Down Expand Up @@ -121,6 +122,7 @@
require_relative 'appwrite/models/framework_adapter'
require_relative 'appwrite/models/deployment'
require_relative 'appwrite/models/execution'
require_relative 'appwrite/models/webhook'
require_relative 'appwrite/models/variable'
require_relative 'appwrite/models/country'
require_relative 'appwrite/models/continent'
Expand Down Expand Up @@ -166,7 +168,7 @@
require_relative 'appwrite/enums/backup_services'
require_relative 'appwrite/enums/relationship_type'
require_relative 'appwrite/enums/relation_mutate'
require_relative 'appwrite/enums/index_type'
require_relative 'appwrite/enums/databases_index_type'
require_relative 'appwrite/enums/order_by'
require_relative 'appwrite/enums/runtime'
require_relative 'appwrite/enums/scopes'
Expand All @@ -182,6 +184,7 @@
require_relative 'appwrite/enums/adapter'
require_relative 'appwrite/enums/compression'
require_relative 'appwrite/enums/image_gravity'
require_relative 'appwrite/enums/tables_db_index_type'
require_relative 'appwrite/enums/password_hash'
require_relative 'appwrite/enums/messaging_provider_type'
require_relative 'appwrite/enums/database_type'
Expand All @@ -205,9 +208,11 @@
require_relative 'appwrite/services/health'
require_relative 'appwrite/services/locale'
require_relative 'appwrite/services/messaging'
require_relative 'appwrite/services/project'
require_relative 'appwrite/services/sites'
require_relative 'appwrite/services/storage'
require_relative 'appwrite/services/tables_db'
require_relative 'appwrite/services/teams'
require_relative 'appwrite/services/tokens'
require_relative 'appwrite/services/users'
require_relative 'appwrite/services/webhooks'
Loading