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

## 23.1.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
* Added: Introduced `bigint` create/update APIs for `TablesDB` columns
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 23.0.0

* [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Ruby SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.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)

**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**

Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |spec|

spec.name = 'appwrite'
spec.version = '23.0.0'
spec.version = '23.1.0'
spec.license = 'BSD-3-Clause'
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API'
spec.author = 'Appwrite Team'
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.create_big_int_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
min: null, # optional
max: null, # optional
default: null, # optional
array: false # optional
)
```
23 changes: 23 additions & 0 deletions docs/examples/databases/update-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.update_big_int_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: null,
min: null, # optional
max: null, # optional
new_key: '' # optional
)
```
1 change: 1 addition & 0 deletions docs/examples/functions/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ functions = Functions.new(client)

result = functions.create_variable(
function_id: '<FUNCTION_ID>',
variable_id: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ result = functions.create(
logging: false, # optional
entrypoint: '<ENTRYPOINT>', # optional
commands: '<COMMANDS>', # optional
scopes: [Scopes::SESSIONS_WRITE], # optional
scopes: [Scopes::PROJECT_READ], # optional
installation_id: '<INSTALLATION_ID>', # optional
provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional
provider_branch: '<PROVIDER_BRANCH>', # optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ client = Client.new
functions = Functions.new(client)

result = functions.list_variables(
function_id: '<FUNCTION_ID>'
function_id: '<FUNCTION_ID>',
queries: [], # optional
total: false # optional
)
```
2 changes: 1 addition & 1 deletion docs/examples/functions/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ functions = Functions.new(client)
result = functions.update_variable(
function_id: '<FUNCTION_ID>',
variable_id: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', # optional
value: '<VALUE>', # optional
secret: false # optional
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ result = functions.update(
logging: false, # optional
entrypoint: '<ENTRYPOINT>', # optional
commands: '<COMMANDS>', # optional
scopes: [Scopes::SESSIONS_WRITE], # optional
scopes: [Scopes::PROJECT_READ], # optional
installation_id: '<INSTALLATION_ID>', # optional
provider_repository_id: '<PROVIDER_REPOSITORY_ID>', # optional
provider_branch: '<PROVIDER_BRANCH>', # optional
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.delete(
presence_id: '<PRESENCE_ID>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.get(
presence_id: '<PRESENCE_ID>'
)
```
18 changes: 18 additions & 0 deletions docs/examples/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

presences = Presences.new(client)

result = presences.list(
queries: [], # optional
total: false, # optional
ttl: 0 # optional
)
```
24 changes: 24 additions & 0 deletions docs/examples/presences/update-presence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```ruby
require 'appwrite'

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

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

presences = Presences.new(client)

result = presences.update_presence(
presence_id: '<PRESENCE_ID>',
user_id: '<USER_ID>',
status: '<STATUS>', # optional
expires_at: '2020-10-15T06:38:00.000+00:00', # optional
metadata: {}, # optional
permissions: [Permission.read(Role.any())], # optional
purge: false # optional
)
```
23 changes: 23 additions & 0 deletions docs/examples/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```ruby
require 'appwrite'

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

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

presences = Presences.new(client)

result = presences.upsert(
presence_id: '<PRESENCE_ID>',
user_id: '<USER_ID>',
status: '<STATUS>',
permissions: [Permission.read(Role.any())], # optional
expires_at: '2020-10-15T06:38:00.000+00:00', # optional
metadata: {} # optional
)
```
18 changes: 18 additions & 0 deletions docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
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_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.create_ephemeral_key(
scopes: [Scopes::PROJECT_READ],
duration: 600
)
```
2 changes: 1 addition & 1 deletion docs/examples/project/create-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ project = Project.new(client)
result = project.create_key(
key_id: '<KEY_ID>',
name: '<NAME>',
scopes: [Scopes::SESSIONS_WRITE],
scopes: [Scopes::PROJECT_READ],
expire: '2020-10-15T06:38:00.000+00:00' # optional
)
```
17 changes: 17 additions & 0 deletions docs/examples/project/create-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.create_mock_phone(
number: '+12065550100',
otp: '<OTP>'
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/create-smtp-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.create_smtp_test(
emails: []
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/delete-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.delete_mock_phone(
number: '+12065550100'
)
```
14 changes: 14 additions & 0 deletions docs/examples/project/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.delete()
```
18 changes: 18 additions & 0 deletions docs/examples/project/get-email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```ruby
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_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.get_email_template(
template_id: EmailTemplateType::VERIFICATION,
locale: EmailTemplateLocale::AF # optional
)
```
16 changes: 16 additions & 0 deletions docs/examples/project/get-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ruby
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.get_mock_phone(
number: '+12065550100'
)
```
17 changes: 17 additions & 0 deletions docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ruby
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_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.get_o_auth2_provider(
provider_id: ProviderId::AMAZON
)
```
17 changes: 17 additions & 0 deletions docs/examples/project/get-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ruby
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_key('<YOUR_API_KEY>') # Your secret API key

project = Project.new(client)

result = project.get_policy(
policy_id: PolicyId::PASSWORD_DICTIONARY
)
```
Loading
Loading