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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ff4eead29ef5fcae244fbcc93ee35d51d26c04d44f6cae00bde1a35d7cd4590
4
- data.tar.gz: 0fee5b3c85b96692adcf9c29b024986bce8c5ff7fd935b4d9e67e1fea48685f8
3
+ metadata.gz: 7af7a36b8f84e4c0cc14fe71d566d3a12f838319c77024e486eaede9ecb4f6bf
4
+ data.tar.gz: '008f87179f1bbccfb26a44be5b8d57b3784ba9512aa500c59c7d91b7e915ca47'
5
5
  SHA512:
6
- metadata.gz: 7ee92d121c635eb76a2f872a8446d2516925b353fbb97fa3dba0c342730fe131cf537bfe49aece631442ab37704b624d8dd4e02a14d9fe9ca645038ee0501eae
7
- data.tar.gz: 3e0f8d737f3340996e1b2414991a143863c5e76c61edbd688d165cd98909394aa5dbd4ab92791b925659325e41899fb9d25d9f5c8be4cca5efb299ae17863a64
6
+ metadata.gz: 97a422d4d22aad866049e1dd30609515806e7691ebb4d33a1fc54aeb123af7a8afd7f4bd3e08282a411ef5a6410a7ad4ecf9840fe9e82213df0b6ba56877511c
7
+ data.tar.gz: cf27ec1ea058dad70e0445c604e6b4661491dd19641c3ece83b5b8cd77e40f8061bfaf35dc206de8d8765587775fdf7279d38c388a0f860a8c004729bb5c7b15
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'mime-types', '~> 3.1'
3
+ gem 'mime-types', '~> 3.3.1'
4
4
  gemspec
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.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)
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.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).**
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 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.
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 followng resources to learn more and get help
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.2.0'
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
@@ -10,6 +10,6 @@ client
10
10
 
11
11
  functions = Appwrite::Functions.new(client);
12
12
 
13
- response = functions.create(name: '[NAME]', execute: [], env: 'dotnet-3.1');
13
+ response = functions.create(name: '[NAME]', execute: [], runtime: 'java-11.0');
14
14
 
15
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
@@ -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.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'
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:, env:, vars: nil, events: nil, schedule: nil, timeout: nil)
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 env.nil?
40
- raise Appwrite::Exception.new('Missing required parameter: "env"')
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 !env.nil?
56
- params[:env] = env
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.2.0
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-06-07 00:00:00.000000000 Z
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