appwrite 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +7 -8
- data/appwrite.gemspec +1 -1
- data/docs/examples/account/get-session.md +15 -0
- data/docs/examples/functions/create.md +1 -1
- data/docs/examples/users/update-verification.md +15 -0
- data/lib/appwrite/client.rb +2 -2
- data/lib/appwrite/services/account.rb +15 -0
- data/lib/appwrite/services/functions.rb +5 -5
- data/lib/appwrite/services/storage.rb +5 -1
- data/lib/appwrite/services/users.rb +23 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7af7a36b8f84e4c0cc14fe71d566d3a12f838319c77024e486eaede9ecb4f6bf
|
4
|
+
data.tar.gz: '008f87179f1bbccfb26a44be5b8d57b3784ba9512aa500c59c7d91b7e915ca47'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97a422d4d22aad866049e1dd30609515806e7691ebb4d33a1fc54aeb123af7a8afd7f4bd3e08282a411ef5a6410a7ad4ecf9840fe9e82213df0b6ba56877511c
|
7
|
+
data.tar.gz: cf27ec1ea058dad70e0445c604e6b4661491dd19641c3ece83b5b8cd77e40f8061bfaf35dc206de8d8765587775fdf7279d38c388a0f860a8c004729bb5c7b15
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
# Appwrite Ruby SDK
|
2
2
|
|
3
3
|
![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.
|
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)
|
5
6
|
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
|
6
7
|
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
|
7
8
|
|
8
|
-
**This SDK is compatible with Appwrite server version 0.
|
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).**
|
9
10
|
|
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)
|
13
12
|
|
14
13
|
![Appwrite](https://appwrite.io/images/github.png)
|
15
14
|
|
@@ -25,7 +24,7 @@ gem install appwrite --save
|
|
25
24
|
## Getting Started
|
26
25
|
|
27
26
|
### Init your SDK
|
28
|
-
Initialize your SDK
|
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.
|
29
28
|
|
30
29
|
```ruby
|
31
30
|
require 'appwrite'
|
@@ -41,7 +40,7 @@ client
|
|
41
40
|
```
|
42
41
|
|
43
42
|
### 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.
|
45
44
|
|
46
45
|
```ruby
|
47
46
|
users = Appwrite::Users.new(client);
|
@@ -81,7 +80,7 @@ end
|
|
81
80
|
```
|
82
81
|
|
83
82
|
### Learn more
|
84
|
-
You can use
|
83
|
+
You can use following resources to learn more and get help
|
85
84
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
86
85
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
87
86
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
data/appwrite.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'appwrite'
|
4
|
-
s.version = '2.
|
4
|
+
s.version = '2.3.0'
|
5
5
|
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"
|
6
6
|
s.author = 'Appwrite Team'
|
7
7
|
s.homepage = 'https://appwrite.io/support'
|
@@ -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
|
@@ -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
|
data/lib/appwrite/client.rb
CHANGED
@@ -20,8 +20,8 @@ module Appwrite
|
|
20
20
|
@headers = {
|
21
21
|
'content-type' => '',
|
22
22
|
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
|
23
|
-
'x-sdk-version' => 'appwrite:ruby:2.
|
24
|
-
'X-Appwrite-Response-Format' => '0.
|
23
|
+
'x-sdk-version' => 'appwrite:ruby:2.3.0',
|
24
|
+
'X-Appwrite-Response-Format' => '0.9.0'
|
25
25
|
}
|
26
26
|
@endpoint = 'https://appwrite.io/v1';
|
27
27
|
end
|
@@ -213,6 +213,21 @@ module Appwrite
|
|
213
213
|
}, params);
|
214
214
|
end
|
215
215
|
|
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
|
+
|
216
231
|
def delete_session(session_id:)
|
217
232
|
if session_id.nil?
|
218
233
|
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
@@ -27,7 +27,7 @@ module Appwrite
|
|
27
27
|
}, params);
|
28
28
|
end
|
29
29
|
|
30
|
-
def create(name:, execute:,
|
30
|
+
def create(name:, execute:, runtime:, vars: nil, events: nil, schedule: nil, timeout: nil)
|
31
31
|
if name.nil?
|
32
32
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
33
33
|
end
|
@@ -36,8 +36,8 @@ module Appwrite
|
|
36
36
|
raise Appwrite::Exception.new('Missing required parameter: "execute"')
|
37
37
|
end
|
38
38
|
|
39
|
-
if
|
40
|
-
raise Appwrite::Exception.new('Missing required parameter: "
|
39
|
+
if runtime.nil?
|
40
|
+
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
|
41
41
|
end
|
42
42
|
|
43
43
|
path = '/functions'
|
@@ -52,8 +52,8 @@ module Appwrite
|
|
52
52
|
params[:execute] = execute
|
53
53
|
end
|
54
54
|
|
55
|
-
if !
|
56
|
-
params[:
|
55
|
+
if !runtime.nil?
|
56
|
+
params[:runtime] = runtime
|
57
57
|
end
|
58
58
|
|
59
59
|
if !vars.nil?
|
@@ -129,7 +129,7 @@ module Appwrite
|
|
129
129
|
}, params);
|
130
130
|
end
|
131
131
|
|
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)
|
133
133
|
if file_id.nil?
|
134
134
|
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
135
135
|
end
|
@@ -147,6 +147,10 @@ module Appwrite
|
|
147
147
|
params[:height] = height
|
148
148
|
end
|
149
149
|
|
150
|
+
if !gravity.nil?
|
151
|
+
params[:gravity] = gravity
|
152
|
+
end
|
153
|
+
|
150
154
|
if !quality.nil?
|
151
155
|
params[:quality] = quality
|
152
156
|
end
|
@@ -213,6 +213,29 @@ module Appwrite
|
|
213
213
|
}, params);
|
214
214
|
end
|
215
215
|
|
216
|
+
def update_verification(user_id:, email_verification:)
|
217
|
+
if user_id.nil?
|
218
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
219
|
+
end
|
220
|
+
|
221
|
+
if email_verification.nil?
|
222
|
+
raise Appwrite::Exception.new('Missing required parameter: "emailVerification"')
|
223
|
+
end
|
224
|
+
|
225
|
+
path = '/users/{userId}/verification'
|
226
|
+
.gsub('{userId}', user_id)
|
227
|
+
|
228
|
+
params = {}
|
229
|
+
|
230
|
+
if !email_verification.nil?
|
231
|
+
params[:emailVerification] = email_verification
|
232
|
+
end
|
233
|
+
|
234
|
+
return @client.call('patch', path, {
|
235
|
+
'content-type' => 'application/json',
|
236
|
+
}, params);
|
237
|
+
end
|
238
|
+
|
216
239
|
|
217
240
|
protected
|
218
241
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appwrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appwrite Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: team@appwrite.io
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- docs/examples/account/delete.md
|
30
30
|
- docs/examples/account/get-logs.md
|
31
31
|
- docs/examples/account/get-prefs.md
|
32
|
+
- docs/examples/account/get-session.md
|
32
33
|
- docs/examples/account/get-sessions.md
|
33
34
|
- docs/examples/account/get.md
|
34
35
|
- docs/examples/account/update-email.md
|
@@ -115,6 +116,7 @@ files:
|
|
115
116
|
- docs/examples/users/list.md
|
116
117
|
- docs/examples/users/update-prefs.md
|
117
118
|
- docs/examples/users/update-status.md
|
119
|
+
- docs/examples/users/update-verification.md
|
118
120
|
- lib/appwrite.rb
|
119
121
|
- lib/appwrite/client.rb
|
120
122
|
- lib/appwrite/exception.rb
|