Skip to content

Commit d21f715

Browse files
Merge pull request #3 from appwrite/dev
feat: update version
2 parents 891392e + 290c09a commit d21f715

File tree

11 files changed

+90
-19
lines changed

11 files changed

+90
-19
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
gem 'mime-types', '~> 3.1'
3+
gem 'mime-types', '~> 3.3.1'
44
gemspec

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Appwrite Ruby SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-0.8.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.9.0-blue.svg?style=flat-square)
5+
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
56
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
67
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
78

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

10-
Appwrite is an open-source backend as a service server that abstract and simplify 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.
11-
Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
12-
For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
11+
Appwrite is an open-source backend as a service server that abstract and simplify 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)
1312

1413
![Appwrite](https://appwrite.io/images/github.png)
1514

@@ -25,7 +24,7 @@ gem install appwrite --save
2524
## Getting Started
2625

2726
### Init your SDK
28-
Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
27+
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
2928

3029
```ruby
3130
require 'appwrite'
@@ -41,7 +40,7 @@ client
4140
```
4241

4342
### Make Your First Request
44-
Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.
43+
Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
4544

4645
```ruby
4746
users = Appwrite::Users.new(client);
@@ -81,7 +80,7 @@ end
8180
```
8281

8382
### Learn more
84-
You can use followng resources to learn more and get help
83+
You can use following resources to learn more and get help
8584
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
8685
- 📜 [Appwrite Docs](https://appwrite.io/docs)
8786
- 💬 [Discord Community](https://appwrite.io/discord)

appwrite.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'appwrite'
4-
s.version = '2.2.0'
4+
s.version = '2.3.0'
55
s.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"
66
s.author = 'Appwrite Team'
77
s.homepage = 'https://appwrite.io/support'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'appwrite'
2+
3+
client = Appwrite::Client.new()
4+
5+
client
6+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_project('5df5acd0d48c2') # Your project ID
8+
.set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token
9+
;
10+
11+
account = Appwrite::Account.new(client);
12+
13+
response = account.get_session(session_id: '[SESSION_ID]');
14+
15+
puts response

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ client
1010

1111
functions = Appwrite::Functions.new(client);
1212

13-
response = functions.create(name: '[NAME]', execute: [], env: 'dotnet-3.1');
13+
response = functions.create(name: '[NAME]', execute: [], runtime: 'java-11.0');
1414

1515
puts response
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'appwrite'
2+
3+
client = Appwrite::Client.new()
4+
5+
client
6+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_project('5df5acd0d48c2') # Your project ID
8+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9+
;
10+
11+
users = Appwrite::Users.new(client);
12+
13+
response = users.update_verification(user_id: '[USER_ID]', email_verification: false);
14+
15+
puts response

lib/appwrite/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def initialize()
2020
@headers = {
2121
'content-type' => '',
2222
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
23-
'x-sdk-version' => 'appwrite:ruby:2.2.0',
24-
'X-Appwrite-Response-Format' => '0.8.0'
23+
'x-sdk-version' => 'appwrite:ruby:2.3.0',
24+
'X-Appwrite-Response-Format' => '0.9.0'
2525
}
2626
@endpoint = 'https://appwrite.io/v1';
2727
end

lib/appwrite/services/account.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,21 @@ def delete_sessions()
213213
}, params);
214214
end
215215

216+
def get_session(session_id:)
217+
if session_id.nil?
218+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
219+
end
220+
221+
path = '/account/sessions/{sessionId}'
222+
.gsub('{sessionId}', session_id)
223+
224+
params = {}
225+
226+
return @client.call('get', path, {
227+
'content-type' => 'application/json',
228+
}, params);
229+
end
230+
216231
def delete_session(session_id:)
217232
if session_id.nil?
218233
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')

lib/appwrite/services/functions.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def list(search: nil, limit: nil, offset: nil, order_type: nil)
2727
}, params);
2828
end
2929

30-
def create(name:, execute:, env:, vars: nil, events: nil, schedule: nil, timeout: nil)
30+
def create(name:, execute:, runtime:, vars: nil, events: nil, schedule: nil, timeout: nil)
3131
if name.nil?
3232
raise Appwrite::Exception.new('Missing required parameter: "name"')
3333
end
@@ -36,8 +36,8 @@ def create(name:, execute:, env:, vars: nil, events: nil, schedule: nil, timeout
3636
raise Appwrite::Exception.new('Missing required parameter: "execute"')
3737
end
3838

39-
if env.nil?
40-
raise Appwrite::Exception.new('Missing required parameter: "env"')
39+
if runtime.nil?
40+
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
4141
end
4242

4343
path = '/functions'
@@ -52,8 +52,8 @@ def create(name:, execute:, env:, vars: nil, events: nil, schedule: nil, timeout
5252
params[:execute] = execute
5353
end
5454

55-
if !env.nil?
56-
params[:env] = env
55+
if !runtime.nil?
56+
params[:runtime] = runtime
5757
end
5858

5959
if !vars.nil?

lib/appwrite/services/storage.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_file_download(file_id:)
129129
}, params);
130130
end
131131

132-
def get_file_preview(file_id:, width: nil, height: nil, quality: nil, border_width: nil, border_color: nil, border_radius: nil, opacity: nil, rotation: nil, background: nil, output: nil)
132+
def get_file_preview(file_id:, width: nil, height: nil, gravity: nil, quality: nil, border_width: nil, border_color: nil, border_radius: nil, opacity: nil, rotation: nil, background: nil, output: nil)
133133
if file_id.nil?
134134
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
135135
end
@@ -147,6 +147,10 @@ def get_file_preview(file_id:, width: nil, height: nil, quality: nil, border_wid
147147
params[:height] = height
148148
end
149149

150+
if !gravity.nil?
151+
params[:gravity] = gravity
152+
end
153+
150154
if !quality.nil?
151155
params[:quality] = quality
152156
end

0 commit comments

Comments
 (0)