From 7dcbcb1df2150272b8ba34412891f42864052587 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 23 Sep 2025 15:22:19 +1200 Subject: [PATCH] Add order random --- appwrite.gemspec | 2 +- docs/examples/databases/create-line-attribute.md | 2 +- docs/examples/databases/create-point-attribute.md | 2 +- docs/examples/databases/create-polygon-attribute.md | 2 +- docs/examples/databases/update-line-attribute.md | 2 +- docs/examples/databases/update-point-attribute.md | 2 +- docs/examples/databases/update-polygon-attribute.md | 2 +- docs/examples/tablesdb/create-line-column.md | 2 +- docs/examples/tablesdb/create-point-column.md | 2 +- docs/examples/tablesdb/create-polygon-column.md | 2 +- docs/examples/tablesdb/update-line-column.md | 2 +- docs/examples/tablesdb/update-point-column.md | 2 +- docs/examples/tablesdb/update-polygon-column.md | 2 +- lib/appwrite/client.rb | 2 +- lib/appwrite/models/deployment.rb | 10 +++++----- lib/appwrite/query.rb | 4 ++++ lib/appwrite/services/tables_db.rb | 2 +- 17 files changed, 24 insertions(+), 20 deletions(-) diff --git a/appwrite.gemspec b/appwrite.gemspec index 4b4c05c..d9cb255 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '18.0.0' + spec.version = '18.1.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/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 9a06ebd..33bdab7 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -14,5 +14,5 @@ result = databases.create_line_attribute( collection_id: '', key: '', required: false, - default: [[1,2], [3, 4]] # optional + default: [[1, 2], [3, 4], [5, 6]] # optional ) diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 3d69f97..f50a99f 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -14,5 +14,5 @@ result = databases.create_point_attribute( collection_id: '', key: '', required: false, - default: [[1,2], [3, 4]] # optional + default: [1, 2] # optional ) diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 24e6fff..d7930a5 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -14,5 +14,5 @@ result = databases.create_polygon_attribute( collection_id: '', key: '', required: false, - default: [[1,2], [3, 4]] # optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional ) diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index fc54d10..c6e6e46 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -14,6 +14,6 @@ result = databases.update_line_attribute( collection_id: '', key: '', required: false, - default: [[1,2], [3, 4]], # optional + default: [[1, 2], [3, 4], [5, 6]], # optional new_key: '' # optional ) diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 69fdac8..ce0b42b 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -14,6 +14,6 @@ result = databases.update_point_attribute( collection_id: '', key: '', required: false, - default: [[1,2], [3, 4]], # optional + default: [1, 2], # optional new_key: '' # optional ) diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index d5ecd9f..c159822 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -14,6 +14,6 @@ result = databases.update_polygon_attribute( collection_id: '', key: '', required: false, - default: [[1,2], [3, 4]], # optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional new_key: '' # optional ) diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 371a1dd..ec2352e 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -14,5 +14,5 @@ result = tables_db.create_line_column( table_id: '', key: '', required: false, - default: [[1,2], [3, 4]] # optional + default: [[1, 2], [3, 4], [5, 6]] # optional ) diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 8694027..bfe77a5 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -14,5 +14,5 @@ result = tables_db.create_point_column( table_id: '', key: '', required: false, - default: [[1,2], [3, 4]] # optional + default: [1, 2] # optional ) diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index e7fcd72..40ac70e 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -14,5 +14,5 @@ result = tables_db.create_polygon_column( table_id: '', key: '', required: false, - default: [[1,2], [3, 4]] # optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] # optional ) diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 627947a..5c1e24d 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -14,6 +14,6 @@ result = tables_db.update_line_column( table_id: '', key: '', required: false, - default: [[1,2], [3, 4]], # optional + default: [[1, 2], [3, 4], [5, 6]], # optional new_key: '' # optional ) diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 8bc5848..f2130bd 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -14,6 +14,6 @@ result = tables_db.update_point_column( table_id: '', key: '', required: false, - default: [[1,2], [3, 4]], # optional + default: [1, 2], # optional new_key: '' # optional ) diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 5451202..6b878e3 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -14,6 +14,6 @@ result = tables_db.update_polygon_column( table_id: '', key: '', required: false, - default: [[1,2], [3, 4]], # optional + default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], # optional new_key: '' # optional ) diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 6a0233e..9482a5c 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'=> '18.0.0', + 'x-sdk-version'=> '18.1.0', 'X-Appwrite-Response-Format' => '1.8.0' } @endpoint = 'https://cloud.appwrite.io/v1' diff --git a/lib/appwrite/models/deployment.rb b/lib/appwrite/models/deployment.rb index 2a385cc..8e2ba07 100644 --- a/lib/appwrite/models/deployment.rb +++ b/lib/appwrite/models/deployment.rb @@ -23,12 +23,12 @@ class Deployment attr_reader :provider_repository_name attr_reader :provider_repository_owner attr_reader :provider_repository_url - attr_reader :provider_branch attr_reader :provider_commit_hash attr_reader :provider_commit_author_url attr_reader :provider_commit_author attr_reader :provider_commit_message attr_reader :provider_commit_url + attr_reader :provider_branch attr_reader :provider_branch_url def initialize( @@ -52,12 +52,12 @@ def initialize( provider_repository_name:, provider_repository_owner:, provider_repository_url:, - provider_branch:, provider_commit_hash:, provider_commit_author_url:, provider_commit_author:, provider_commit_message:, provider_commit_url:, + provider_branch:, provider_branch_url: ) @id = id @@ -80,12 +80,12 @@ def initialize( @provider_repository_name = provider_repository_name @provider_repository_owner = provider_repository_owner @provider_repository_url = provider_repository_url - @provider_branch = provider_branch @provider_commit_hash = provider_commit_hash @provider_commit_author_url = provider_commit_author_url @provider_commit_author = provider_commit_author @provider_commit_message = provider_commit_message @provider_commit_url = provider_commit_url + @provider_branch = provider_branch @provider_branch_url = provider_branch_url end @@ -111,12 +111,12 @@ def self.from(map:) provider_repository_name: map["providerRepositoryName"], provider_repository_owner: map["providerRepositoryOwner"], provider_repository_url: map["providerRepositoryUrl"], - provider_branch: map["providerBranch"], provider_commit_hash: map["providerCommitHash"], provider_commit_author_url: map["providerCommitAuthorUrl"], provider_commit_author: map["providerCommitAuthor"], provider_commit_message: map["providerCommitMessage"], provider_commit_url: map["providerCommitUrl"], + provider_branch: map["providerBranch"], provider_branch_url: map["providerBranchUrl"] ) end @@ -143,12 +143,12 @@ def to_map "providerRepositoryName": @provider_repository_name, "providerRepositoryOwner": @provider_repository_owner, "providerRepositoryUrl": @provider_repository_url, - "providerBranch": @provider_branch, "providerCommitHash": @provider_commit_hash, "providerCommitAuthorUrl": @provider_commit_author_url, "providerCommitAuthor": @provider_commit_author, "providerCommitMessage": @provider_commit_message, "providerCommitUrl": @provider_commit_url, + "providerBranch": @provider_branch, "providerBranchUrl": @provider_branch_url } end diff --git a/lib/appwrite/query.rb b/lib/appwrite/query.rb index e1a6ecf..2372662 100644 --- a/lib/appwrite/query.rb +++ b/lib/appwrite/query.rb @@ -88,6 +88,10 @@ def order_desc(attribute) return Query.new("orderDesc", attribute, nil).to_s end + def order_random() + return Query.new("orderRandom", nil, nil).to_s + end + def cursor_before(id) return Query.new("cursorBefore", nil, id).to_s end diff --git a/lib/appwrite/services/tables_db.rb b/lib/appwrite/services/tables_db.rb index b8df615..9272913 100644 --- a/lib/appwrite/services/tables_db.rb +++ b/lib/appwrite/services/tables_db.rb @@ -2178,7 +2178,7 @@ def create_row(database_id:, table_id:, row_id:, data:, permissions: nil) # # @param [String] database_id Database ID. # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. - # @param [Array] rows Array of documents data as JSON objects. + # @param [Array] rows Array of rows data as JSON objects. # # @return [RowList] def create_rows(database_id:, table_id:, rows:)