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

## 16.1.0

* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
* Add `dart38` and `flutter332` support to runtime models
* Add `gif` support to `ImageFormat` enum
* Add `encrypt` support to `StringAttribute` model
* Add `sequence` support to `Document` model
* Add `upsertDocument` support to `Databases` service

## 16.0.0

* Add `<REGION>` to doc examples due to the new multi region endpoints
* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc.
* Add doc examples, class and methods for new `Sites` service
* Add doc examples, class and methods for new `Tokens` service
* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType`
* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329
* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage
* Add `queries` and `search` params to `listMemberships` method
* Remove `search` param from `listExecutions` method

## 15.0.0

* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests

## 14.0.0

* Fix pong response & chunked upload
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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.7.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.4-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)
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 = '16.0.0'
spec.version = '16.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'
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ 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_session('') # The user session to authenticate with
.set_key('<YOUR_API_KEY>') # Your secret API key
.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token

databases = Databases.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/databases/create-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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

databases = Databases.new(client)
Expand Down
19 changes: 19 additions & 0 deletions docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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

databases = Databases.new(client)

result = databases.decrement_document_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
attribute: '',
value: null, # optional
min: null # optional
)
19 changes: 19 additions & 0 deletions docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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

databases = Databases.new(client)

result = databases.increment_document_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
attribute: '',
value: null, # optional
max: null # optional
)
18 changes: 18 additions & 0 deletions docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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_session('') # The user session to authenticate with

databases = Databases.new(client)

result = databases.upsert_document(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
data: {},
permissions: ["read("any")"] # optional
)
2 changes: 1 addition & 1 deletion docs/examples/databases/upsert-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ databases = Databases.new(client)
result = databases.upsert_documents(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
documents: [] # optional
documents: []
)
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'=> '16.0.0',
'x-sdk-version'=> '16.1.0',
'X-Appwrite-Response-Format' => '1.7.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 @@ -38,6 +38,7 @@ module BuildRuntime
DART_3_1 = 'dart-3.1'
DART_3_3 = 'dart-3.3'
DART_3_5 = 'dart-3.5'
DART_3_8 = 'dart-3.8'
DOTNET_6_0 = 'dotnet-6.0'
DOTNET_7_0 = 'dotnet-7.0'
DOTNET_8_0 = 'dotnet-8.0'
Expand All @@ -64,6 +65,7 @@ module BuildRuntime
FLUTTER_3_24 = 'flutter-3.24'
FLUTTER_3_27 = 'flutter-3.27'
FLUTTER_3_29 = 'flutter-3.29'
FLUTTER_3_32 = 'flutter-3.32'
end
end
end
1 change: 1 addition & 0 deletions lib/appwrite/enums/image_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module ImageFormat
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 @@ -38,6 +38,7 @@ module Runtime
DART_3_1 = 'dart-3.1'
DART_3_3 = 'dart-3.3'
DART_3_5 = 'dart-3.5'
DART_3_8 = 'dart-3.8'
DOTNET_6_0 = 'dotnet-6.0'
DOTNET_7_0 = 'dotnet-7.0'
DOTNET_8_0 = 'dotnet-8.0'
Expand All @@ -64,6 +65,7 @@ module Runtime
FLUTTER_3_24 = 'flutter-3.24'
FLUTTER_3_27 = 'flutter-3.27'
FLUTTER_3_29 = 'flutter-3.29'
FLUTTER_3_32 = 'flutter-3.32'
end
end
end
11 changes: 8 additions & 3 deletions lib/appwrite/models/attribute_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class AttributeString
attr_reader :updated_at
attr_reader :size
attr_reader :default
attr_reader :encrypt

def initialize(
key:,
Expand All @@ -24,7 +25,8 @@ def initialize(
created_at:,
updated_at:,
size:,
default:
default: ,
encrypt:
)
@key = key
@type = type
Expand All @@ -36,6 +38,7 @@ def initialize(
@updated_at = updated_at
@size = size
@default = default
@encrypt = encrypt
end

def self.from(map:)
Expand All @@ -49,7 +52,8 @@ def self.from(map:)
created_at: map["$createdAt"],
updated_at: map["$updatedAt"],
size: map["size"],
default: map["default"]
default: map["default"],
encrypt: map["encrypt"]
)
end

Expand All @@ -64,7 +68,8 @@ def to_map
"$createdAt": @created_at,
"$updatedAt": @updated_at,
"size": @size,
"default": @default
"default": @default,
"encrypt": @encrypt
}
end
end
Expand Down
5 changes: 5 additions & 0 deletions lib/appwrite/models/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Appwrite
module Models
class Document
attr_reader :id
attr_reader :sequence
attr_reader :collection_id
attr_reader :database_id
attr_reader :created_at
Expand All @@ -13,6 +14,7 @@ class Document

def initialize(
id:,
sequence:,
collection_id:,
database_id:,
created_at:,
Expand All @@ -21,6 +23,7 @@ def initialize(
data:
)
@id = id
@sequence = sequence
@collection_id = collection_id
@database_id = database_id
@created_at = created_at
Expand All @@ -32,6 +35,7 @@ def initialize(
def self.from(map:)
Document.new(
id: map["$id"],
sequence: map["$sequence"],
collection_id: map["$collectionId"],
database_id: map["$databaseId"],
created_at: map["$createdAt"],
Expand All @@ -44,6 +48,7 @@ def self.from(map:)
def to_map
{
"$id": @id,
"$sequence": @sequence,
"$collectionId": @collection_id,
"$databaseId": @database_id,
"$createdAt": @created_at,
Expand Down
Loading