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

## 20.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `create_template_deployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
* Add `get_screenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums

## 19.3.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
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 = '19.3.0'
spec.version = '20.0.0'
spec.license = 'BSD-3-Clause'
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API'
spec.author = 'Appwrite Team'
Expand Down
37 changes: 37 additions & 0 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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_session('') # The user session to authenticate with

avatars = Avatars.new(client)

result = avatars.get_screenshot(
url: 'https://example.com',
headers: {
"Authorization" => "Bearer token123",
"X-Custom-Header" => "value"
}, # optional
viewport_width: 1920, # optional
viewport_height: 1080, # optional
scale: 2, # optional
theme: Theme::LIGHT, # optional
user_agent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', # optional
fullpage: true, # optional
locale: 'en-US', # optional
timezone: Timezone::AFRICA_ABIDJAN, # optional
latitude: 37.7749, # optional
longitude: -122.4194, # optional
accuracy: 100, # optional
touch: true, # optional
permissions: ["geolocation","notifications"], # optional
sleep: 3, # optional
width: 800, # optional
height: 600, # optional
quality: 85, # optional
output: Output::JPG # optional
)
1 change: 1 addition & 0 deletions docs/examples/databases/update-relationship-attribute.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/functions/create-execution.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/create-template-deployment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand All @@ -14,6 +15,7 @@ result = functions.create_template_deployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
root_directory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: TemplateReferenceType::COMMIT,
reference: '<REFERENCE>',
activate: false # optional
)
2 changes: 1 addition & 1 deletion docs/examples/functions/create-vcs-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ functions = Functions.new(client)

result = functions.create_vcs_deployment(
function_id: '<FUNCTION_ID>',
type: VCSDeploymentType::BRANCH,
type: VCSReferenceType::BRANCH,
reference: '<REFERENCE>',
activate: false # optional
)
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ functions = Functions.new(client)
result = functions.create(
function_id: '<FUNCTION_ID>',
name: '<NAME>',
runtime: ::NODE_14_5,
runtime: Runtime::NODE_14_5,
execute: ["any"], # optional
events: [], # optional
schedule: '', # optional
Expand Down
1 change: 1 addition & 0 deletions docs/examples/functions/get-deployment-download.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,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,7 +13,7 @@ functions = Functions.new(client)
result = functions.update(
function_id: '<FUNCTION_ID>',
name: '<NAME>',
runtime: ::NODE_14_5, # optional
runtime: Runtime::NODE_14_5, # optional
execute: ["any"], # optional
events: [], # optional
schedule: '', # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/health/get-failed-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ client = Client.new
health = Health.new(client)

result = health.get_failed_jobs(
name: ::V1_DATABASE,
name: Name::V1_DATABASE,
threshold: null # optional
)
1 change: 1 addition & 0 deletions docs/examples/messaging/create-push.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/messaging/create-smtp-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/messaging/update-push.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/messaging/update-smtp-provider.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/sites/create-template-deployment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand All @@ -14,6 +15,7 @@ result = sites.create_template_deployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
root_directory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: TemplateReferenceType::BRANCH,
reference: '<REFERENCE>',
activate: false # optional
)
2 changes: 1 addition & 1 deletion docs/examples/sites/create-vcs-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sites = Sites.new(client)

result = sites.create_vcs_deployment(
site_id: '<SITE_ID>',
type: VCSDeploymentType::BRANCH,
type: VCSReferenceType::BRANCH,
reference: '<REFERENCE>',
activate: false # optional
)
6 changes: 3 additions & 3 deletions docs/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sites = Sites.new(client)
result = sites.create(
site_id: '<SITE_ID>',
name: '<NAME>',
framework: ::ANALOG,
build_runtime: ::NODE_14_5,
framework: Framework::ANALOG,
build_runtime: BuildRuntime::NODE_14_5,
enabled: false, # optional
logging: false, # optional
timeout: 1, # optional
install_command: '<INSTALL_COMMAND>', # optional
build_command: '<BUILD_COMMAND>', # optional
output_directory: '<OUTPUT_DIRECTORY>', # optional
adapter: ::STATIC, # optional
adapter: Adapter::STATIC, # optional
installation_id: '<INSTALLATION_ID>', # optional
fallback_file: '<FALLBACK_FILE>', # optional
provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional
Expand Down
1 change: 1 addition & 0 deletions docs/examples/sites/get-deployment-download.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sites = Sites.new(client)
result = sites.update(
site_id: '<SITE_ID>',
name: '<NAME>',
framework: ::ANALOG,
framework: Framework::ANALOG,
enabled: false, # optional
logging: false, # optional
timeout: 1, # optional
install_command: '<INSTALL_COMMAND>', # optional
build_command: '<BUILD_COMMAND>', # optional
output_directory: '<OUTPUT_DIRECTORY>', # optional
build_runtime: ::NODE_14_5, # optional
adapter: ::STATIC, # optional
build_runtime: BuildRuntime::NODE_14_5, # optional
adapter: Adapter::STATIC, # optional
fallback_file: '<FALLBACK_FILE>', # optional
installation_id: '<INSTALLATION_ID>', # optional
provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/storage/create-bucket.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums
include Appwrite::Permission
include Appwrite::Role

Expand All @@ -19,7 +20,8 @@ result = storage.create_bucket(
enabled: false, # optional
maximum_file_size: 1, # optional
allowed_file_extensions: [], # optional
compression: ::NONE, # optional
compression: Compression::NONE, # optional
encryption: false, # optional
antivirus: false # optional
antivirus: false, # optional
transformations: false # optional
)
1 change: 1 addition & 0 deletions docs/examples/storage/get-file-preview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/storage/update-bucket.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums
include Appwrite::Permission
include Appwrite::Role

Expand All @@ -19,7 +20,8 @@ result = storage.update_bucket(
enabled: false, # optional
maximum_file_size: 1, # optional
allowed_file_extensions: [], # optional
compression: ::NONE, # optional
compression: Compression::NONE, # optional
encryption: false, # optional
antivirus: false # optional
antivirus: false, # optional
transformations: false # optional
)
1 change: 1 addition & 0 deletions docs/examples/tablesdb/update-relationship-column.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/users/create-sha-user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'appwrite'

include Appwrite
include Appwrite::Enums

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
Expand Down
6 changes: 5 additions & 1 deletion lib/appwrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@
require_relative 'appwrite/enums/browser'
require_relative 'appwrite/enums/credit_card'
require_relative 'appwrite/enums/flag'
require_relative 'appwrite/enums/theme'
require_relative 'appwrite/enums/timezone'
require_relative 'appwrite/enums/output'
require_relative 'appwrite/enums/relationship_type'
require_relative 'appwrite/enums/relation_mutate'
require_relative 'appwrite/enums/index_type'
require_relative 'appwrite/enums/runtime'
require_relative 'appwrite/enums/vcs_deployment_type'
require_relative 'appwrite/enums/template_reference_type'
require_relative 'appwrite/enums/vcs_reference_type'
require_relative 'appwrite/enums/deployment_download_type'
require_relative 'appwrite/enums/execution_method'
require_relative 'appwrite/enums/name'
Expand Down
2 changes: 1 addition & 1 deletion lib/appwrite/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize
'x-sdk-name'=> 'Ruby',
'x-sdk-platform'=> 'server',
'x-sdk-language'=> 'ruby',
'x-sdk-version'=> '19.3.0',
'x-sdk-version'=> '20.0.0',
'X-Appwrite-Response-Format' => '1.8.0'
}
@endpoint = 'https://cloud.appwrite.io/v1'
Expand Down
2 changes: 2 additions & 0 deletions lib/appwrite/enums/build_runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module BuildRuntime
DART_3_3 = 'dart-3.3'
DART_3_5 = 'dart-3.5'
DART_3_8 = 'dart-3.8'
DART_3_9 = 'dart-3.9'
DOTNET_6_0 = 'dotnet-6.0'
DOTNET_7_0 = 'dotnet-7.0'
DOTNET_8_0 = 'dotnet-8.0'
Expand Down Expand Up @@ -66,6 +67,7 @@ module BuildRuntime
FLUTTER_3_27 = 'flutter-3.27'
FLUTTER_3_29 = 'flutter-3.29'
FLUTTER_3_32 = 'flutter-3.32'
FLUTTER_3_35 = 'flutter-3.35'
end
end
end
13 changes: 13 additions & 0 deletions lib/appwrite/enums/output.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Appwrite
module Enums
module Output
JPG = 'jpg'
JPEG = 'jpeg'
PNG = 'png'
WEBP = 'webp'
HEIC = 'heic'
AVIF = 'avif'
GIF = 'gif'
end
end
end
2 changes: 2 additions & 0 deletions lib/appwrite/enums/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module Runtime
DART_3_3 = 'dart-3.3'
DART_3_5 = 'dart-3.5'
DART_3_8 = 'dart-3.8'
DART_3_9 = 'dart-3.9'
DOTNET_6_0 = 'dotnet-6.0'
DOTNET_7_0 = 'dotnet-7.0'
DOTNET_8_0 = 'dotnet-8.0'
Expand Down Expand Up @@ -66,6 +67,7 @@ module Runtime
FLUTTER_3_27 = 'flutter-3.27'
FLUTTER_3_29 = 'flutter-3.29'
FLUTTER_3_32 = 'flutter-3.32'
FLUTTER_3_35 = 'flutter-3.35'
end
end
end
9 changes: 9 additions & 0 deletions lib/appwrite/enums/template_reference_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Appwrite
module Enums
module TemplateReferenceType
BRANCH = 'branch'
COMMIT = 'commit'
TAG = 'tag'
end
end
end
Loading