From 2520f03112e8f9f2f96372f455228025b5c25103 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 28 Nov 2025 19:05:26 +0000 Subject: [PATCH 1/3] feat: add method to service --- CHANGELOG.md | 4 + appwrite.gemspec | 2 +- docs/examples/avatars/get-screenshot.md | 34 ++ .../update-relationship-attribute.md | 1 + docs/examples/functions/create-execution.md | 1 + .../functions/create-template-deployment.md | 4 +- .../functions/create-vcs-deployment.md | 2 +- docs/examples/functions/create.md | 2 +- .../functions/get-deployment-download.md | 1 + docs/examples/functions/update.md | 3 +- docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/messaging/create-push.md | 1 + .../messaging/create-smtp-provider.md | 1 + docs/examples/messaging/update-push.md | 1 + .../messaging/update-smtp-provider.md | 1 + .../sites/create-template-deployment.md | 4 +- docs/examples/sites/create-vcs-deployment.md | 2 +- docs/examples/sites/create.md | 6 +- .../examples/sites/get-deployment-download.md | 1 + docs/examples/sites/update.md | 6 +- docs/examples/storage/create-bucket.md | 6 +- docs/examples/storage/get-file-preview.md | 1 + docs/examples/storage/update-bucket.md | 6 +- .../tablesdb/update-relationship-column.md | 1 + docs/examples/users/create-sha-user.md | 1 + lib/appwrite.rb | 6 +- lib/appwrite/client.rb | 2 +- lib/appwrite/enums/build_runtime.rb | 2 + lib/appwrite/enums/output.rb | 13 + lib/appwrite/enums/runtime.rb | 2 + lib/appwrite/enums/template_reference_type.rb | 9 + lib/appwrite/enums/theme.rb | 8 + lib/appwrite/enums/timezone.rb | 425 ++++++++++++++++++ ...ployment_type.rb => vcs_reference_type.rb} | 2 +- lib/appwrite/models/bucket.rb | 11 +- lib/appwrite/services/avatars.rb | 74 +++ lib/appwrite/services/functions.rb | 18 +- lib/appwrite/services/sites.rb | 20 +- lib/appwrite/services/storage.rb | 10 +- lib/appwrite/services/tables_db.rb | 2 +- 40 files changed, 657 insertions(+), 41 deletions(-) create mode 100644 docs/examples/avatars/get-screenshot.md create mode 100644 lib/appwrite/enums/output.rb create mode 100644 lib/appwrite/enums/template_reference_type.rb create mode 100644 lib/appwrite/enums/theme.rb create mode 100644 lib/appwrite/enums/timezone.rb rename lib/appwrite/enums/{vcs_deployment_type.rb => vcs_reference_type.rb} (80%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4b0df5..6a32cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 19.4.0 + +* Add `get_screenshot` method to `Avatars` service + ## 19.3.0 * Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance diff --git a/appwrite.gemspec b/appwrite.gemspec index 2ccee57..59750a9 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '19.3.0' + spec.version = '19.4.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' diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md new file mode 100644 index 0000000..f66fae3 --- /dev/null +++ b/docs/examples/avatars/get-screenshot.md @@ -0,0 +1,34 @@ +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_session('') # The user session to authenticate with + +avatars = Avatars.new(client) + +result = avatars.get_screenshot( + url: 'https://example.com', + headers: {}, # optional + viewport_width: 1, # optional + viewport_height: 1, # optional + scale: 0.1, # optional + theme: Theme::LIGHT, # optional + user_agent: '', # optional + fullpage: false, # optional + locale: '', # optional + timezone: Timezone::AFRICA_ABIDJAN, # optional + latitude: -90, # optional + longitude: -180, # optional + accuracy: 0, # optional + touch: false, # optional + permissions: [], # optional + sleep: 0, # optional + width: 0, # optional + height: 0, # optional + quality: -1, # optional + output: Output::JPG # optional +) diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 679edb8..6fddac2 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 666b995..521ee7c 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index a447b6e..e4c759f 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -14,6 +15,7 @@ result = functions.create_template_deployment( repository: '', owner: '', root_directory: '', - version: '', + type: TemplateReferenceType::COMMIT, + reference: '', activate: false # optional ) diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 75bd3c4..930ec6d 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -12,7 +12,7 @@ functions = Functions.new(client) result = functions.create_vcs_deployment( function_id: '', - type: VCSDeploymentType::BRANCH, + type: VCSReferenceType::BRANCH, reference: '', activate: false # optional ) diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index cad021b..ce16a2b 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -13,7 +13,7 @@ functions = Functions.new(client) result = functions.create( function_id: '', name: '', - runtime: ::NODE_14_5, + runtime: Runtime::NODE_14_5, execute: ["any"], # optional events: [], # optional schedule: '', # optional diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index a1a50a5..06faa7e 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 45b6e32..91d8436 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +13,7 @@ functions = Functions.new(client) result = functions.update( function_id: '', name: '', - runtime: ::NODE_14_5, # optional + runtime: Runtime::NODE_14_5, # optional execute: ["any"], # optional events: [], # optional schedule: '', # optional diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 73e1983..b15f6cc 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -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 ) diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index f4555aa..547c179 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index b062e57..c33f772 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 19b273b..b365069 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index bbaebf3..ab0e1b4 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 7df9665..4fb8177 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -14,6 +15,7 @@ result = sites.create_template_deployment( repository: '', owner: '', root_directory: '', - version: '', + type: TemplateReferenceType::BRANCH, + reference: '', activate: false # optional ) diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 2e72b6e..e0a6ff3 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -12,7 +12,7 @@ sites = Sites.new(client) result = sites.create_vcs_deployment( site_id: '', - type: VCSDeploymentType::BRANCH, + type: VCSReferenceType::BRANCH, reference: '', activate: false # optional ) diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 2243185..7dc004c 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -13,15 +13,15 @@ sites = Sites.new(client) result = sites.create( site_id: '', 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: '', # optional build_command: '', # optional output_directory: '', # optional - adapter: ::STATIC, # optional + adapter: Adapter::STATIC, # optional installation_id: '', # optional fallback_file: '', # optional provider_repository_id: '', # optional diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 8516262..c82ab98 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 922255a..0d73293 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -13,15 +13,15 @@ sites = Sites.new(client) result = sites.update( site_id: '', name: '', - framework: ::ANALOG, + framework: Framework::ANALOG, enabled: false, # optional logging: false, # optional timeout: 1, # optional install_command: '', # optional build_command: '', # optional 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: '', # optional installation_id: '', # optional provider_repository_id: '', # optional diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 4a12518..f6899ef 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums include Appwrite::Permission include Appwrite::Role @@ -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 ) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 2325461..4b154c7 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 2e44aad..84c50ef 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums include Appwrite::Permission include Appwrite::Role @@ -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 ) diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index 3951cbc..81de2d7 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index f3951d9..d19db05 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -1,6 +1,7 @@ require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint diff --git a/lib/appwrite.rb b/lib/appwrite.rb index 096946a..e3243c4 100644 --- a/lib/appwrite.rb +++ b/lib/appwrite.rb @@ -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' diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 7a4709d..0f652c6 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -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'=> '19.4.0', 'X-Appwrite-Response-Format' => '1.8.0' } @endpoint = 'https://cloud.appwrite.io/v1' diff --git a/lib/appwrite/enums/build_runtime.rb b/lib/appwrite/enums/build_runtime.rb index 1101024..a9a862d 100644 --- a/lib/appwrite/enums/build_runtime.rb +++ b/lib/appwrite/enums/build_runtime.rb @@ -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' @@ -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 \ No newline at end of file diff --git a/lib/appwrite/enums/output.rb b/lib/appwrite/enums/output.rb new file mode 100644 index 0000000..fa255a8 --- /dev/null +++ b/lib/appwrite/enums/output.rb @@ -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 \ No newline at end of file diff --git a/lib/appwrite/enums/runtime.rb b/lib/appwrite/enums/runtime.rb index 96d3b45..7bfa368 100644 --- a/lib/appwrite/enums/runtime.rb +++ b/lib/appwrite/enums/runtime.rb @@ -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' @@ -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 \ No newline at end of file diff --git a/lib/appwrite/enums/template_reference_type.rb b/lib/appwrite/enums/template_reference_type.rb new file mode 100644 index 0000000..fc75cc7 --- /dev/null +++ b/lib/appwrite/enums/template_reference_type.rb @@ -0,0 +1,9 @@ +module Appwrite + module Enums + module TemplateReferenceType + BRANCH = 'branch' + COMMIT = 'commit' + TAG = 'tag' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/theme.rb b/lib/appwrite/enums/theme.rb new file mode 100644 index 0000000..486e488 --- /dev/null +++ b/lib/appwrite/enums/theme.rb @@ -0,0 +1,8 @@ +module Appwrite + module Enums + module Theme + LIGHT = 'light' + DARK = 'dark' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/timezone.rb b/lib/appwrite/enums/timezone.rb new file mode 100644 index 0000000..be558b6 --- /dev/null +++ b/lib/appwrite/enums/timezone.rb @@ -0,0 +1,425 @@ +module Appwrite + module Enums + module Timezone + AFRICA_ABIDJAN = 'africa/abidjan' + AFRICA_ACCRA = 'africa/accra' + AFRICA_ADDIS_ABABA = 'africa/addis_ababa' + AFRICA_ALGIERS = 'africa/algiers' + AFRICA_ASMARA = 'africa/asmara' + AFRICA_BAMAKO = 'africa/bamako' + AFRICA_BANGUI = 'africa/bangui' + AFRICA_BANJUL = 'africa/banjul' + AFRICA_BISSAU = 'africa/bissau' + AFRICA_BLANTYRE = 'africa/blantyre' + AFRICA_BRAZZAVILLE = 'africa/brazzaville' + AFRICA_BUJUMBURA = 'africa/bujumbura' + AFRICA_CAIRO = 'africa/cairo' + AFRICA_CASABLANCA = 'africa/casablanca' + AFRICA_CEUTA = 'africa/ceuta' + AFRICA_CONAKRY = 'africa/conakry' + AFRICA_DAKAR = 'africa/dakar' + AFRICA_DAR_ES_SALAAM = 'africa/dar_es_salaam' + AFRICA_DJIBOUTI = 'africa/djibouti' + AFRICA_DOUALA = 'africa/douala' + AFRICA_EL_AAIUN = 'africa/el_aaiun' + AFRICA_FREETOWN = 'africa/freetown' + AFRICA_GABORONE = 'africa/gaborone' + AFRICA_HARARE = 'africa/harare' + AFRICA_JOHANNESBURG = 'africa/johannesburg' + AFRICA_JUBA = 'africa/juba' + AFRICA_KAMPALA = 'africa/kampala' + AFRICA_KHARTOUM = 'africa/khartoum' + AFRICA_KIGALI = 'africa/kigali' + AFRICA_KINSHASA = 'africa/kinshasa' + AFRICA_LAGOS = 'africa/lagos' + AFRICA_LIBREVILLE = 'africa/libreville' + AFRICA_LOME = 'africa/lome' + AFRICA_LUANDA = 'africa/luanda' + AFRICA_LUBUMBASHI = 'africa/lubumbashi' + AFRICA_LUSAKA = 'africa/lusaka' + AFRICA_MALABO = 'africa/malabo' + AFRICA_MAPUTO = 'africa/maputo' + AFRICA_MASERU = 'africa/maseru' + AFRICA_MBABANE = 'africa/mbabane' + AFRICA_MOGADISHU = 'africa/mogadishu' + AFRICA_MONROVIA = 'africa/monrovia' + AFRICA_NAIROBI = 'africa/nairobi' + AFRICA_NDJAMENA = 'africa/ndjamena' + AFRICA_NIAMEY = 'africa/niamey' + AFRICA_NOUAKCHOTT = 'africa/nouakchott' + AFRICA_OUAGADOUGOU = 'africa/ouagadougou' + AFRICA_PORTO_NOVO = 'africa/porto-novo' + AFRICA_SAO_TOME = 'africa/sao_tome' + AFRICA_TRIPOLI = 'africa/tripoli' + AFRICA_TUNIS = 'africa/tunis' + AFRICA_WINDHOEK = 'africa/windhoek' + AMERICA_ADAK = 'america/adak' + AMERICA_ANCHORAGE = 'america/anchorage' + AMERICA_ANGUILLA = 'america/anguilla' + AMERICA_ANTIGUA = 'america/antigua' + AMERICA_ARAGUAINA = 'america/araguaina' + AMERICA_ARGENTINA_BUENOS_AIRES = 'america/argentina/buenos_aires' + AMERICA_ARGENTINA_CATAMARCA = 'america/argentina/catamarca' + AMERICA_ARGENTINA_CORDOBA = 'america/argentina/cordoba' + AMERICA_ARGENTINA_JUJUY = 'america/argentina/jujuy' + AMERICA_ARGENTINA_LA_RIOJA = 'america/argentina/la_rioja' + AMERICA_ARGENTINA_MENDOZA = 'america/argentina/mendoza' + AMERICA_ARGENTINA_RIO_GALLEGOS = 'america/argentina/rio_gallegos' + AMERICA_ARGENTINA_SALTA = 'america/argentina/salta' + AMERICA_ARGENTINA_SAN_JUAN = 'america/argentina/san_juan' + AMERICA_ARGENTINA_SAN_LUIS = 'america/argentina/san_luis' + AMERICA_ARGENTINA_TUCUMAN = 'america/argentina/tucuman' + AMERICA_ARGENTINA_USHUAIA = 'america/argentina/ushuaia' + AMERICA_ARUBA = 'america/aruba' + AMERICA_ASUNCION = 'america/asuncion' + AMERICA_ATIKOKAN = 'america/atikokan' + AMERICA_BAHIA = 'america/bahia' + AMERICA_BAHIA_BANDERAS = 'america/bahia_banderas' + AMERICA_BARBADOS = 'america/barbados' + AMERICA_BELEM = 'america/belem' + AMERICA_BELIZE = 'america/belize' + AMERICA_BLANC_SABLON = 'america/blanc-sablon' + AMERICA_BOA_VISTA = 'america/boa_vista' + AMERICA_BOGOTA = 'america/bogota' + AMERICA_BOISE = 'america/boise' + AMERICA_CAMBRIDGE_BAY = 'america/cambridge_bay' + AMERICA_CAMPO_GRANDE = 'america/campo_grande' + AMERICA_CANCUN = 'america/cancun' + AMERICA_CARACAS = 'america/caracas' + AMERICA_CAYENNE = 'america/cayenne' + AMERICA_CAYMAN = 'america/cayman' + AMERICA_CHICAGO = 'america/chicago' + AMERICA_CHIHUAHUA = 'america/chihuahua' + AMERICA_CIUDAD_JUAREZ = 'america/ciudad_juarez' + AMERICA_COSTA_RICA = 'america/costa_rica' + AMERICA_COYHAIQUE = 'america/coyhaique' + AMERICA_CRESTON = 'america/creston' + AMERICA_CUIABA = 'america/cuiaba' + AMERICA_CURACAO = 'america/curacao' + AMERICA_DANMARKSHAVN = 'america/danmarkshavn' + AMERICA_DAWSON = 'america/dawson' + AMERICA_DAWSON_CREEK = 'america/dawson_creek' + AMERICA_DENVER = 'america/denver' + AMERICA_DETROIT = 'america/detroit' + AMERICA_DOMINICA = 'america/dominica' + AMERICA_EDMONTON = 'america/edmonton' + AMERICA_EIRUNEPE = 'america/eirunepe' + AMERICA_EL_SALVADOR = 'america/el_salvador' + AMERICA_FORT_NELSON = 'america/fort_nelson' + AMERICA_FORTALEZA = 'america/fortaleza' + AMERICA_GLACE_BAY = 'america/glace_bay' + AMERICA_GOOSE_BAY = 'america/goose_bay' + AMERICA_GRAND_TURK = 'america/grand_turk' + AMERICA_GRENADA = 'america/grenada' + AMERICA_GUADELOUPE = 'america/guadeloupe' + AMERICA_GUATEMALA = 'america/guatemala' + AMERICA_GUAYAQUIL = 'america/guayaquil' + AMERICA_GUYANA = 'america/guyana' + AMERICA_HALIFAX = 'america/halifax' + AMERICA_HAVANA = 'america/havana' + AMERICA_HERMOSILLO = 'america/hermosillo' + AMERICA_INDIANA_INDIANAPOLIS = 'america/indiana/indianapolis' + AMERICA_INDIANA_KNOX = 'america/indiana/knox' + AMERICA_INDIANA_MARENGO = 'america/indiana/marengo' + AMERICA_INDIANA_PETERSBURG = 'america/indiana/petersburg' + AMERICA_INDIANA_TELL_CITY = 'america/indiana/tell_city' + AMERICA_INDIANA_VEVAY = 'america/indiana/vevay' + AMERICA_INDIANA_VINCENNES = 'america/indiana/vincennes' + AMERICA_INDIANA_WINAMAC = 'america/indiana/winamac' + AMERICA_INUVIK = 'america/inuvik' + AMERICA_IQALUIT = 'america/iqaluit' + AMERICA_JAMAICA = 'america/jamaica' + AMERICA_JUNEAU = 'america/juneau' + AMERICA_KENTUCKY_LOUISVILLE = 'america/kentucky/louisville' + AMERICA_KENTUCKY_MONTICELLO = 'america/kentucky/monticello' + AMERICA_KRALENDIJK = 'america/kralendijk' + AMERICA_LA_PAZ = 'america/la_paz' + AMERICA_LIMA = 'america/lima' + AMERICA_LOS_ANGELES = 'america/los_angeles' + AMERICA_LOWER_PRINCES = 'america/lower_princes' + AMERICA_MACEIO = 'america/maceio' + AMERICA_MANAGUA = 'america/managua' + AMERICA_MANAUS = 'america/manaus' + AMERICA_MARIGOT = 'america/marigot' + AMERICA_MARTINIQUE = 'america/martinique' + AMERICA_MATAMOROS = 'america/matamoros' + AMERICA_MAZATLAN = 'america/mazatlan' + AMERICA_MENOMINEE = 'america/menominee' + AMERICA_MERIDA = 'america/merida' + AMERICA_METLAKATLA = 'america/metlakatla' + AMERICA_MEXICO_CITY = 'america/mexico_city' + AMERICA_MIQUELON = 'america/miquelon' + AMERICA_MONCTON = 'america/moncton' + AMERICA_MONTERREY = 'america/monterrey' + AMERICA_MONTEVIDEO = 'america/montevideo' + AMERICA_MONTSERRAT = 'america/montserrat' + AMERICA_NASSAU = 'america/nassau' + AMERICA_NEW_YORK = 'america/new_york' + AMERICA_NOME = 'america/nome' + AMERICA_NORONHA = 'america/noronha' + AMERICA_NORTH_DAKOTA_BEULAH = 'america/north_dakota/beulah' + AMERICA_NORTH_DAKOTA_CENTER = 'america/north_dakota/center' + AMERICA_NORTH_DAKOTA_NEW_SALEM = 'america/north_dakota/new_salem' + AMERICA_NUUK = 'america/nuuk' + AMERICA_OJINAGA = 'america/ojinaga' + AMERICA_PANAMA = 'america/panama' + AMERICA_PARAMARIBO = 'america/paramaribo' + AMERICA_PHOENIX = 'america/phoenix' + AMERICA_PORT_AU_PRINCE = 'america/port-au-prince' + AMERICA_PORT_OF_SPAIN = 'america/port_of_spain' + AMERICA_PORTO_VELHO = 'america/porto_velho' + AMERICA_PUERTO_RICO = 'america/puerto_rico' + AMERICA_PUNTA_ARENAS = 'america/punta_arenas' + AMERICA_RANKIN_INLET = 'america/rankin_inlet' + AMERICA_RECIFE = 'america/recife' + AMERICA_REGINA = 'america/regina' + AMERICA_RESOLUTE = 'america/resolute' + AMERICA_RIO_BRANCO = 'america/rio_branco' + AMERICA_SANTAREM = 'america/santarem' + AMERICA_SANTIAGO = 'america/santiago' + AMERICA_SANTO_DOMINGO = 'america/santo_domingo' + AMERICA_SAO_PAULO = 'america/sao_paulo' + AMERICA_SCORESBYSUND = 'america/scoresbysund' + AMERICA_SITKA = 'america/sitka' + AMERICA_ST_BARTHELEMY = 'america/st_barthelemy' + AMERICA_ST_JOHNS = 'america/st_johns' + AMERICA_ST_KITTS = 'america/st_kitts' + AMERICA_ST_LUCIA = 'america/st_lucia' + AMERICA_ST_THOMAS = 'america/st_thomas' + AMERICA_ST_VINCENT = 'america/st_vincent' + AMERICA_SWIFT_CURRENT = 'america/swift_current' + AMERICA_TEGUCIGALPA = 'america/tegucigalpa' + AMERICA_THULE = 'america/thule' + AMERICA_TIJUANA = 'america/tijuana' + AMERICA_TORONTO = 'america/toronto' + AMERICA_TORTOLA = 'america/tortola' + AMERICA_VANCOUVER = 'america/vancouver' + AMERICA_WHITEHORSE = 'america/whitehorse' + AMERICA_WINNIPEG = 'america/winnipeg' + AMERICA_YAKUTAT = 'america/yakutat' + ANTARCTICA_CASEY = 'antarctica/casey' + ANTARCTICA_DAVIS = 'antarctica/davis' + ANTARCTICA_DUMONTDURVILLE = 'antarctica/dumontdurville' + ANTARCTICA_MACQUARIE = 'antarctica/macquarie' + ANTARCTICA_MAWSON = 'antarctica/mawson' + ANTARCTICA_MCMURDO = 'antarctica/mcmurdo' + ANTARCTICA_PALMER = 'antarctica/palmer' + ANTARCTICA_ROTHERA = 'antarctica/rothera' + ANTARCTICA_SYOWA = 'antarctica/syowa' + ANTARCTICA_TROLL = 'antarctica/troll' + ANTARCTICA_VOSTOK = 'antarctica/vostok' + ARCTIC_LONGYEARBYEN = 'arctic/longyearbyen' + ASIA_ADEN = 'asia/aden' + ASIA_ALMATY = 'asia/almaty' + ASIA_AMMAN = 'asia/amman' + ASIA_ANADYR = 'asia/anadyr' + ASIA_AQTAU = 'asia/aqtau' + ASIA_AQTOBE = 'asia/aqtobe' + ASIA_ASHGABAT = 'asia/ashgabat' + ASIA_ATYRAU = 'asia/atyrau' + ASIA_BAGHDAD = 'asia/baghdad' + ASIA_BAHRAIN = 'asia/bahrain' + ASIA_BAKU = 'asia/baku' + ASIA_BANGKOK = 'asia/bangkok' + ASIA_BARNAUL = 'asia/barnaul' + ASIA_BEIRUT = 'asia/beirut' + ASIA_BISHKEK = 'asia/bishkek' + ASIA_BRUNEI = 'asia/brunei' + ASIA_CHITA = 'asia/chita' + ASIA_COLOMBO = 'asia/colombo' + ASIA_DAMASCUS = 'asia/damascus' + ASIA_DHAKA = 'asia/dhaka' + ASIA_DILI = 'asia/dili' + ASIA_DUBAI = 'asia/dubai' + ASIA_DUSHANBE = 'asia/dushanbe' + ASIA_FAMAGUSTA = 'asia/famagusta' + ASIA_GAZA = 'asia/gaza' + ASIA_HEBRON = 'asia/hebron' + ASIA_HO_CHI_MINH = 'asia/ho_chi_minh' + ASIA_HONG_KONG = 'asia/hong_kong' + ASIA_HOVD = 'asia/hovd' + ASIA_IRKUTSK = 'asia/irkutsk' + ASIA_JAKARTA = 'asia/jakarta' + ASIA_JAYAPURA = 'asia/jayapura' + ASIA_JERUSALEM = 'asia/jerusalem' + ASIA_KABUL = 'asia/kabul' + ASIA_KAMCHATKA = 'asia/kamchatka' + ASIA_KARACHI = 'asia/karachi' + ASIA_KATHMANDU = 'asia/kathmandu' + ASIA_KHANDYGA = 'asia/khandyga' + ASIA_KOLKATA = 'asia/kolkata' + ASIA_KRASNOYARSK = 'asia/krasnoyarsk' + ASIA_KUALA_LUMPUR = 'asia/kuala_lumpur' + ASIA_KUCHING = 'asia/kuching' + ASIA_KUWAIT = 'asia/kuwait' + ASIA_MACAU = 'asia/macau' + ASIA_MAGADAN = 'asia/magadan' + ASIA_MAKASSAR = 'asia/makassar' + ASIA_MANILA = 'asia/manila' + ASIA_MUSCAT = 'asia/muscat' + ASIA_NICOSIA = 'asia/nicosia' + ASIA_NOVOKUZNETSK = 'asia/novokuznetsk' + ASIA_NOVOSIBIRSK = 'asia/novosibirsk' + ASIA_OMSK = 'asia/omsk' + ASIA_ORAL = 'asia/oral' + ASIA_PHNOM_PENH = 'asia/phnom_penh' + ASIA_PONTIANAK = 'asia/pontianak' + ASIA_PYONGYANG = 'asia/pyongyang' + ASIA_QATAR = 'asia/qatar' + ASIA_QOSTANAY = 'asia/qostanay' + ASIA_QYZYLORDA = 'asia/qyzylorda' + ASIA_RIYADH = 'asia/riyadh' + ASIA_SAKHALIN = 'asia/sakhalin' + ASIA_SAMARKAND = 'asia/samarkand' + ASIA_SEOUL = 'asia/seoul' + ASIA_SHANGHAI = 'asia/shanghai' + ASIA_SINGAPORE = 'asia/singapore' + ASIA_SREDNEKOLYMSK = 'asia/srednekolymsk' + ASIA_TAIPEI = 'asia/taipei' + ASIA_TASHKENT = 'asia/tashkent' + ASIA_TBILISI = 'asia/tbilisi' + ASIA_TEHRAN = 'asia/tehran' + ASIA_THIMPHU = 'asia/thimphu' + ASIA_TOKYO = 'asia/tokyo' + ASIA_TOMSK = 'asia/tomsk' + ASIA_ULAANBAATAR = 'asia/ulaanbaatar' + ASIA_URUMQI = 'asia/urumqi' + ASIA_UST_NERA = 'asia/ust-nera' + ASIA_VIENTIANE = 'asia/vientiane' + ASIA_VLADIVOSTOK = 'asia/vladivostok' + ASIA_YAKUTSK = 'asia/yakutsk' + ASIA_YANGON = 'asia/yangon' + ASIA_YEKATERINBURG = 'asia/yekaterinburg' + ASIA_YEREVAN = 'asia/yerevan' + ATLANTIC_AZORES = 'atlantic/azores' + ATLANTIC_BERMUDA = 'atlantic/bermuda' + ATLANTIC_CANARY = 'atlantic/canary' + ATLANTIC_CAPE_VERDE = 'atlantic/cape_verde' + ATLANTIC_FAROE = 'atlantic/faroe' + ATLANTIC_MADEIRA = 'atlantic/madeira' + ATLANTIC_REYKJAVIK = 'atlantic/reykjavik' + ATLANTIC_SOUTH_GEORGIA = 'atlantic/south_georgia' + ATLANTIC_ST_HELENA = 'atlantic/st_helena' + ATLANTIC_STANLEY = 'atlantic/stanley' + AUSTRALIA_ADELAIDE = 'australia/adelaide' + AUSTRALIA_BRISBANE = 'australia/brisbane' + AUSTRALIA_BROKEN_HILL = 'australia/broken_hill' + AUSTRALIA_DARWIN = 'australia/darwin' + AUSTRALIA_EUCLA = 'australia/eucla' + AUSTRALIA_HOBART = 'australia/hobart' + AUSTRALIA_LINDEMAN = 'australia/lindeman' + AUSTRALIA_LORD_HOWE = 'australia/lord_howe' + AUSTRALIA_MELBOURNE = 'australia/melbourne' + AUSTRALIA_PERTH = 'australia/perth' + AUSTRALIA_SYDNEY = 'australia/sydney' + EUROPE_AMSTERDAM = 'europe/amsterdam' + EUROPE_ANDORRA = 'europe/andorra' + EUROPE_ASTRAKHAN = 'europe/astrakhan' + EUROPE_ATHENS = 'europe/athens' + EUROPE_BELGRADE = 'europe/belgrade' + EUROPE_BERLIN = 'europe/berlin' + EUROPE_BRATISLAVA = 'europe/bratislava' + EUROPE_BRUSSELS = 'europe/brussels' + EUROPE_BUCHAREST = 'europe/bucharest' + EUROPE_BUDAPEST = 'europe/budapest' + EUROPE_BUSINGEN = 'europe/busingen' + EUROPE_CHISINAU = 'europe/chisinau' + EUROPE_COPENHAGEN = 'europe/copenhagen' + EUROPE_DUBLIN = 'europe/dublin' + EUROPE_GIBRALTAR = 'europe/gibraltar' + EUROPE_GUERNSEY = 'europe/guernsey' + EUROPE_HELSINKI = 'europe/helsinki' + EUROPE_ISLE_OF_MAN = 'europe/isle_of_man' + EUROPE_ISTANBUL = 'europe/istanbul' + EUROPE_JERSEY = 'europe/jersey' + EUROPE_KALININGRAD = 'europe/kaliningrad' + EUROPE_KIROV = 'europe/kirov' + EUROPE_KYIV = 'europe/kyiv' + EUROPE_LISBON = 'europe/lisbon' + EUROPE_LJUBLJANA = 'europe/ljubljana' + EUROPE_LONDON = 'europe/london' + EUROPE_LUXEMBOURG = 'europe/luxembourg' + EUROPE_MADRID = 'europe/madrid' + EUROPE_MALTA = 'europe/malta' + EUROPE_MARIEHAMN = 'europe/mariehamn' + EUROPE_MINSK = 'europe/minsk' + EUROPE_MONACO = 'europe/monaco' + EUROPE_MOSCOW = 'europe/moscow' + EUROPE_OSLO = 'europe/oslo' + EUROPE_PARIS = 'europe/paris' + EUROPE_PODGORICA = 'europe/podgorica' + EUROPE_PRAGUE = 'europe/prague' + EUROPE_RIGA = 'europe/riga' + EUROPE_ROME = 'europe/rome' + EUROPE_SAMARA = 'europe/samara' + EUROPE_SAN_MARINO = 'europe/san_marino' + EUROPE_SARAJEVO = 'europe/sarajevo' + EUROPE_SARATOV = 'europe/saratov' + EUROPE_SIMFEROPOL = 'europe/simferopol' + EUROPE_SKOPJE = 'europe/skopje' + EUROPE_SOFIA = 'europe/sofia' + EUROPE_STOCKHOLM = 'europe/stockholm' + EUROPE_TALLINN = 'europe/tallinn' + EUROPE_TIRANE = 'europe/tirane' + EUROPE_ULYANOVSK = 'europe/ulyanovsk' + EUROPE_VADUZ = 'europe/vaduz' + EUROPE_VATICAN = 'europe/vatican' + EUROPE_VIENNA = 'europe/vienna' + EUROPE_VILNIUS = 'europe/vilnius' + EUROPE_VOLGOGRAD = 'europe/volgograd' + EUROPE_WARSAW = 'europe/warsaw' + EUROPE_ZAGREB = 'europe/zagreb' + EUROPE_ZURICH = 'europe/zurich' + INDIAN_ANTANANARIVO = 'indian/antananarivo' + INDIAN_CHAGOS = 'indian/chagos' + INDIAN_CHRISTMAS = 'indian/christmas' + INDIAN_COCOS = 'indian/cocos' + INDIAN_COMORO = 'indian/comoro' + INDIAN_KERGUELEN = 'indian/kerguelen' + INDIAN_MAHE = 'indian/mahe' + INDIAN_MALDIVES = 'indian/maldives' + INDIAN_MAURITIUS = 'indian/mauritius' + INDIAN_MAYOTTE = 'indian/mayotte' + INDIAN_REUNION = 'indian/reunion' + PACIFIC_APIA = 'pacific/apia' + PACIFIC_AUCKLAND = 'pacific/auckland' + PACIFIC_BOUGAINVILLE = 'pacific/bougainville' + PACIFIC_CHATHAM = 'pacific/chatham' + PACIFIC_CHUUK = 'pacific/chuuk' + PACIFIC_EASTER = 'pacific/easter' + PACIFIC_EFATE = 'pacific/efate' + PACIFIC_FAKAOFO = 'pacific/fakaofo' + PACIFIC_FIJI = 'pacific/fiji' + PACIFIC_FUNAFUTI = 'pacific/funafuti' + PACIFIC_GALAPAGOS = 'pacific/galapagos' + PACIFIC_GAMBIER = 'pacific/gambier' + PACIFIC_GUADALCANAL = 'pacific/guadalcanal' + PACIFIC_GUAM = 'pacific/guam' + PACIFIC_HONOLULU = 'pacific/honolulu' + PACIFIC_KANTON = 'pacific/kanton' + PACIFIC_KIRITIMATI = 'pacific/kiritimati' + PACIFIC_KOSRAE = 'pacific/kosrae' + PACIFIC_KWAJALEIN = 'pacific/kwajalein' + PACIFIC_MAJURO = 'pacific/majuro' + PACIFIC_MARQUESAS = 'pacific/marquesas' + PACIFIC_MIDWAY = 'pacific/midway' + PACIFIC_NAURU = 'pacific/nauru' + PACIFIC_NIUE = 'pacific/niue' + PACIFIC_NORFOLK = 'pacific/norfolk' + PACIFIC_NOUMEA = 'pacific/noumea' + PACIFIC_PAGO_PAGO = 'pacific/pago_pago' + PACIFIC_PALAU = 'pacific/palau' + PACIFIC_PITCAIRN = 'pacific/pitcairn' + PACIFIC_POHNPEI = 'pacific/pohnpei' + PACIFIC_PORT_MORESBY = 'pacific/port_moresby' + PACIFIC_RAROTONGA = 'pacific/rarotonga' + PACIFIC_SAIPAN = 'pacific/saipan' + PACIFIC_TAHITI = 'pacific/tahiti' + PACIFIC_TARAWA = 'pacific/tarawa' + PACIFIC_TONGATAPU = 'pacific/tongatapu' + PACIFIC_WAKE = 'pacific/wake' + PACIFIC_WALLIS = 'pacific/wallis' + UTC = 'utc' + end + end +end \ No newline at end of file diff --git a/lib/appwrite/enums/vcs_deployment_type.rb b/lib/appwrite/enums/vcs_reference_type.rb similarity index 80% rename from lib/appwrite/enums/vcs_deployment_type.rb rename to lib/appwrite/enums/vcs_reference_type.rb index f2688df..d34529a 100644 --- a/lib/appwrite/enums/vcs_deployment_type.rb +++ b/lib/appwrite/enums/vcs_reference_type.rb @@ -1,6 +1,6 @@ module Appwrite module Enums - module VCSDeploymentType + module VCSReferenceType BRANCH = 'branch' COMMIT = 'commit' TAG = 'tag' diff --git a/lib/appwrite/models/bucket.rb b/lib/appwrite/models/bucket.rb index 0199029..42f3df2 100644 --- a/lib/appwrite/models/bucket.rb +++ b/lib/appwrite/models/bucket.rb @@ -15,6 +15,7 @@ class Bucket attr_reader :compression attr_reader :encryption attr_reader :antivirus + attr_reader :transformations def initialize( id:, @@ -28,7 +29,8 @@ def initialize( allowed_file_extensions:, compression:, encryption:, - antivirus: + antivirus:, + transformations: ) @id = id @created_at = created_at @@ -42,6 +44,7 @@ def initialize( @compression = compression @encryption = encryption @antivirus = antivirus + @transformations = transformations end def self.from(map:) @@ -57,7 +60,8 @@ def self.from(map:) allowed_file_extensions: map["allowedFileExtensions"], compression: map["compression"], encryption: map["encryption"], - antivirus: map["antivirus"] + antivirus: map["antivirus"], + transformations: map["transformations"] ) end @@ -74,7 +78,8 @@ def to_map "allowedFileExtensions": @allowed_file_extensions, "compression": @compression, "encryption": @encryption, - "antivirus": @antivirus + "antivirus": @antivirus, + "transformations": @transformations } end end diff --git a/lib/appwrite/services/avatars.rb b/lib/appwrite/services/avatars.rb index 657b271..fba6855 100644 --- a/lib/appwrite/services/avatars.rb +++ b/lib/appwrite/services/avatars.rb @@ -282,5 +282,79 @@ def get_qr(text:, size: nil, margin: nil, download: nil) ) end + # Use this endpoint to capture a screenshot of any website URL. This endpoint + # uses a headless browser to render the webpage and capture it as an image. + # + # You can configure the browser viewport size, theme, user agent, + # geolocation, permissions, and more. Capture either just the viewport or the + # full page scroll. + # + # When width and height are specified, the image is resized accordingly. If + # both dimensions are 0, the API provides an image at original size. If + # dimensions are not specified, the default viewport size is 1280x720px. + # + # @param [String] url Website URL which you want to capture. + # @param [Hash] headers HTTP headers to send with the browser request. Defaults to empty. + # @param [Integer] viewport_width Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. + # @param [Integer] viewport_height Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. + # @param [Float] scale Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. + # @param [Theme] theme Browser theme. Pass "light" or "dark". Defaults to "light". + # @param [String] user_agent Custom user agent string. Defaults to browser default. + # @param [] fullpage Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. + # @param [String] locale Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. + # @param [Timezone] timezone IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default. + # @param [Float] latitude Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. + # @param [Float] longitude Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. + # @param [Float] accuracy Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. + # @param [] touch Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0. + # @param [Array] permissions Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty. + # @param [Integer] sleep Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. + # @param [Integer] width Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). + # @param [Integer] height Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). + # @param [Integer] quality Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. + # @param [Output] output Output format type (jpeg, jpg, png, gif and webp). + # + # @return [] + def get_screenshot(url:, headers: nil, viewport_width: nil, viewport_height: nil, scale: nil, theme: nil, user_agent: nil, fullpage: nil, locale: nil, timezone: nil, latitude: nil, longitude: nil, accuracy: nil, touch: nil, permissions: nil, sleep: nil, width: nil, height: nil, quality: nil, output: nil) + api_path = '/avatars/screenshots' + + if url.nil? + raise Appwrite::Exception.new('Missing required parameter: "url"') + end + + api_params = { + url: url, + headers: headers, + viewportWidth: viewport_width, + viewportHeight: viewport_height, + scale: scale, + theme: theme, + userAgent: user_agent, + fullpage: fullpage, + locale: locale, + timezone: timezone, + latitude: latitude, + longitude: longitude, + accuracy: accuracy, + touch: touch, + permissions: permissions, + sleep: sleep, + width: width, + height: height, + quality: quality, + output: output, + } + + api_headers = { + } + + @client.call( + method: 'GET', + path: api_path, + headers: api_headers, + params: api_params, + ) + end + end end \ No newline at end of file diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index b73b16e..3104636 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -458,11 +458,12 @@ def create_duplicate_deployment(function_id:, deployment_id:, build_id: nil) # @param [String] repository Repository name of the template. # @param [String] owner The name of the owner of the template. # @param [String] root_directory Path to function code in the template repo. - # @param [String] version Version (tag) for the repo linked to the function template. + # @param [TemplateReferenceType] type Type for the reference provided. Can be commit, branch, or tag + # @param [String] reference Reference value, can be a commit hash, branch name, or release tag # @param [] activate Automatically activate the deployment when it is finished building. # # @return [Deployment] - def create_template_deployment(function_id:, repository:, owner:, root_directory:, version:, activate: nil) + def create_template_deployment(function_id:, repository:, owner:, root_directory:, type:, reference:, activate: nil) api_path = '/functions/{functionId}/deployments/template' .gsub('{functionId}', function_id) @@ -482,15 +483,20 @@ def create_template_deployment(function_id:, repository:, owner:, root_directory raise Appwrite::Exception.new('Missing required parameter: "rootDirectory"') end - if version.nil? - raise Appwrite::Exception.new('Missing required parameter: "version"') + if type.nil? + raise Appwrite::Exception.new('Missing required parameter: "type"') + end + + if reference.nil? + raise Appwrite::Exception.new('Missing required parameter: "reference"') end api_params = { repository: repository, owner: owner, rootDirectory: root_directory, - version: version, + type: type, + reference: reference, activate: activate, } @@ -512,7 +518,7 @@ def create_template_deployment(function_id:, repository:, owner:, root_directory # This endpoint lets you create deployment from a branch, commit, or a tag. # # @param [String] function_id Function ID. - # @param [VCSDeploymentType] type Type of reference passed. Allowed values are: branch, commit + # @param [VCSReferenceType] type Type of reference passed. Allowed values are: branch, commit # @param [String] reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash # @param [] activate Automatically activate the deployment when it is finished building. # diff --git a/lib/appwrite/services/sites.rb b/lib/appwrite/services/sites.rb index ac26b5c..ad64c81 100644 --- a/lib/appwrite/services/sites.rb +++ b/lib/appwrite/services/sites.rb @@ -356,7 +356,7 @@ def list_deployments(site_id:, queries: nil, search: nil, total: nil) # Create a new site code deployment. Use this endpoint to upload a new # version of your site code. To activate your newly uploaded code, you'll - # need to update the function's deployment to use your new deployment ID. + # need to update the site's deployment to use your new deployment ID. # # @param [String] site_id Site ID. # @param [file] code Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory. @@ -457,11 +457,12 @@ def create_duplicate_deployment(site_id:, deployment_id:) # @param [String] repository Repository name of the template. # @param [String] owner The name of the owner of the template. # @param [String] root_directory Path to site code in the template repo. - # @param [String] version Version (tag) for the repo linked to the site template. + # @param [TemplateReferenceType] type Type for the reference provided. Can be commit, branch, or tag + # @param [String] reference Reference value, can be a commit hash, branch name, or release tag # @param [] activate Automatically activate the deployment when it is finished building. # # @return [Deployment] - def create_template_deployment(site_id:, repository:, owner:, root_directory:, version:, activate: nil) + def create_template_deployment(site_id:, repository:, owner:, root_directory:, type:, reference:, activate: nil) api_path = '/sites/{siteId}/deployments/template' .gsub('{siteId}', site_id) @@ -481,15 +482,20 @@ def create_template_deployment(site_id:, repository:, owner:, root_directory:, v raise Appwrite::Exception.new('Missing required parameter: "rootDirectory"') end - if version.nil? - raise Appwrite::Exception.new('Missing required parameter: "version"') + if type.nil? + raise Appwrite::Exception.new('Missing required parameter: "type"') + end + + if reference.nil? + raise Appwrite::Exception.new('Missing required parameter: "reference"') end api_params = { repository: repository, owner: owner, rootDirectory: root_directory, - version: version, + type: type, + reference: reference, activate: activate, } @@ -511,7 +517,7 @@ def create_template_deployment(site_id:, repository:, owner:, root_directory:, v # This endpoint lets you create deployment from a branch, commit, or a tag. # # @param [String] site_id Site ID. - # @param [VCSDeploymentType] type Type of reference passed. Allowed values are: branch, commit + # @param [VCSReferenceType] type Type of reference passed. Allowed values are: branch, commit # @param [String] reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash # @param [] activate Automatically activate the deployment when it is finished building. # diff --git a/lib/appwrite/services/storage.rb b/lib/appwrite/services/storage.rb index e2dfc04..a5323d1 100644 --- a/lib/appwrite/services/storage.rb +++ b/lib/appwrite/services/storage.rb @@ -10,7 +10,7 @@ def initialize(client) # Get a list of all the storage buckets. You can use the query params to # filter your results. # - # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus + # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations # @param [String] search Search term to filter your list results. Max length: 256 chars. # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # @@ -48,9 +48,10 @@ def list_buckets(queries: nil, search: nil, total: nil) # @param [Compression] compression Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled # @param [] encryption Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled # @param [] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled + # @param [] transformations Are image transformations enabled? # # @return [Bucket] - def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabled: nil, maximum_file_size: nil, allowed_file_extensions: nil, compression: nil, encryption: nil, antivirus: nil) + def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabled: nil, maximum_file_size: nil, allowed_file_extensions: nil, compression: nil, encryption: nil, antivirus: nil, transformations: nil) api_path = '/storage/buckets' if bucket_id.nil? @@ -72,6 +73,7 @@ def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl compression: compression, encryption: encryption, antivirus: antivirus, + transformations: transformations, } api_headers = { @@ -128,9 +130,10 @@ def get_bucket(bucket_id:) # @param [Compression] compression Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled # @param [] encryption Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled # @param [] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled + # @param [] transformations Are image transformations enabled? # # @return [Bucket] - def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabled: nil, maximum_file_size: nil, allowed_file_extensions: nil, compression: nil, encryption: nil, antivirus: nil) + def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabled: nil, maximum_file_size: nil, allowed_file_extensions: nil, compression: nil, encryption: nil, antivirus: nil, transformations: nil) api_path = '/storage/buckets/{bucketId}' .gsub('{bucketId}', bucket_id) @@ -152,6 +155,7 @@ def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl compression: compression, encryption: encryption, antivirus: antivirus, + transformations: transformations, } api_headers = { diff --git a/lib/appwrite/services/tables_db.rb b/lib/appwrite/services/tables_db.rb index fbf78bc..09457ca 100644 --- a/lib/appwrite/services/tables_db.rb +++ b/lib/appwrite/services/tables_db.rb @@ -464,7 +464,7 @@ def get_table(database_id:, table_id:) # @param [String] table_id Table ID. # @param [String] name Table name. Max length: 128 chars. # @param [Array] permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - # @param [] row_security Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + # @param [] row_security Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). # @param [] enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. # # @return [Table] From dbe6ce30ed5bb5f117cd444d69a5bfa27e549649 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 28 Nov 2025 19:29:48 +0000 Subject: [PATCH 2/3] fix changelog --- CHANGELOG.md | 5 ++++- appwrite.gemspec | 2 +- lib/appwrite/client.rb | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a32cd9..272f9b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ # Change Log -## 19.4.0 +## 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 diff --git a/appwrite.gemspec b/appwrite.gemspec index 59750a9..13565d4 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '19.4.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' diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 0f652c6..b47f296 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -15,7 +15,7 @@ def initialize 'x-sdk-name'=> 'Ruby', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'ruby', - 'x-sdk-version'=> '19.4.0', + 'x-sdk-version'=> '20.0.0', 'X-Appwrite-Response-Format' => '1.8.0' } @endpoint = 'https://cloud.appwrite.io/v1' From 7cccbb327ad238e6539e05aa1c1db4f37997b41b Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Dec 2025 13:55:22 +0000 Subject: [PATCH 3/3] update examples --- docs/examples/avatars/get-screenshot.md | 35 ++++++++++++++----------- lib/appwrite/services/account.rb | 4 +-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index f66fae3..0271404 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -12,23 +12,26 @@ avatars = Avatars.new(client) result = avatars.get_screenshot( url: 'https://example.com', - headers: {}, # optional - viewport_width: 1, # optional - viewport_height: 1, # optional - scale: 0.1, # optional + 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: '', # optional - fullpage: false, # optional - locale: '', # 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: -90, # optional - longitude: -180, # optional - accuracy: 0, # optional - touch: false, # optional - permissions: [], # optional - sleep: 0, # optional - width: 0, # optional - height: 0, # optional - quality: -1, # 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 ) diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index d6b9e1d..f291d9c 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -362,7 +362,7 @@ def delete_mfa_authenticator(type:) # # @return [MfaChallenge] def create_mfa_challenge(factor:) - api_path = '/account/mfa/challenge' + api_path = '/account/mfa/challenges' if factor.nil? raise Appwrite::Exception.new('Missing required parameter: "factor"') @@ -396,7 +396,7 @@ def create_mfa_challenge(factor:) # # @return [Session] def update_mfa_challenge(challenge_id:, otp:) - api_path = '/account/mfa/challenge' + api_path = '/account/mfa/challenges' if challenge_id.nil? raise Appwrite::Exception.new('Missing required parameter: "challengeId"')