appwrite 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +2 -18
- data/Gemfile +0 -3
- data/LICENSE +0 -12
- data/README.md +0 -24
- data/appwrite.gemspec +0 -11
- data/lib/appwrite.rb +0 -26
- data/lib/appwrite/client.rb +0 -93
- data/lib/appwrite/service.rb +0 -12
- data/lib/appwrite/services/account.rb +0 -114
- data/lib/appwrite/services/auth.rb +0 -131
- data/lib/appwrite/services/avatars.rb +0 -95
- data/lib/appwrite/services/database.rb +0 -160
- data/lib/appwrite/services/locale.rb +0 -64
- data/lib/appwrite/services/projects.rb +0 -410
- data/lib/appwrite/services/storage.rb +0 -120
- data/lib/appwrite/services/teams.rb +0 -146
- data/lib/appwrite/services/users.rb +0 -137
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c7cc7220b584ed2aa2de4566719da27e15d93954fb87c176ce13244ed8f81d1
|
4
|
+
data.tar.gz: 3ed457ef4e2b6aa12815dd24d05c88af9efb4de8c75a96a59282cc48d7401435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 640bff5c0d47f33d6c74e9d0435904ba577b643e47ca42c1f3d0df3de9feff5c5422ae012e77fd368703148688fb683e9c3c7d697538a0581bcebe0484cc4c4d
|
7
|
+
data.tar.gz: 9f8996b0f98c5b427be850d72538fc97cea37f78efa3bcae4538f69437a7f5a39fd1786d100341ed48c56b0840762f42d3ee447a3faaf28aa0b437aae5e2c116
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appwrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appwrite Team
|
@@ -15,23 +15,7 @@ email: team@appwrite.io
|
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
|
-
files:
|
19
|
-
- Gemfile
|
20
|
-
- LICENSE
|
21
|
-
- README.md
|
22
|
-
- appwrite.gemspec
|
23
|
-
- lib/appwrite.rb
|
24
|
-
- lib/appwrite/client.rb
|
25
|
-
- lib/appwrite/service.rb
|
26
|
-
- lib/appwrite/services/account.rb
|
27
|
-
- lib/appwrite/services/auth.rb
|
28
|
-
- lib/appwrite/services/avatars.rb
|
29
|
-
- lib/appwrite/services/database.rb
|
30
|
-
- lib/appwrite/services/locale.rb
|
31
|
-
- lib/appwrite/services/projects.rb
|
32
|
-
- lib/appwrite/services/storage.rb
|
33
|
-
- lib/appwrite/services/teams.rb
|
34
|
-
- lib/appwrite/services/users.rb
|
18
|
+
files: []
|
35
19
|
homepage: https://appwrite.io/support
|
36
20
|
licenses: []
|
37
21
|
metadata: {}
|
data/Gemfile
DELETED
data/LICENSE
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors.
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
5
|
-
|
6
|
-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
7
|
-
|
8
|
-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
9
|
-
|
10
|
-
3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
11
|
-
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# Appwrite SDK for Ruby
|
2
|
-
|
3
|
-
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1)
|
4
|
-
![Version](https://img.shields.io/badge/api%20version-0.2.0-blue.svg?v=1)
|
5
|
-
|
6
|
-
**WORK IN PROGRESS - NOT READY FOR USAGE - Want to help us improve this client SDK? Send a pull request to Appwrite [SDK generator repository](https://github.com/appwrite/sdk-generator).**
|
7
|
-
|
8
|
-
Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
![Appwrite](https://appwrite.io/images/github.png)
|
13
|
-
|
14
|
-
## Installation
|
15
|
-
|
16
|
-
To install via [Gem](https://rubygems.org/):
|
17
|
-
|
18
|
-
```bash
|
19
|
-
gem install appwrite --save
|
20
|
-
```
|
21
|
-
|
22
|
-
## License
|
23
|
-
|
24
|
-
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
|
data/appwrite.gemspec
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
|
3
|
-
s.name = 'appwrite'
|
4
|
-
s.version = '1.0.1'
|
5
|
-
s.summary = "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)"
|
6
|
-
s.author = 'Appwrite Team'
|
7
|
-
s.homepage = 'https://appwrite.io/support'
|
8
|
-
s.email = 'team@appwrite.io'
|
9
|
-
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
10
|
-
|
11
|
-
end
|
data/lib/appwrite.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
require 'uri'
|
3
|
-
require 'json'
|
4
|
-
require_relative 'appwrite/client'
|
5
|
-
require_relative 'appwrite/service'
|
6
|
-
require_relative 'appwrite/services/account'
|
7
|
-
require_relative 'appwrite/services/auth'
|
8
|
-
require_relative 'appwrite/services/avatars'
|
9
|
-
require_relative 'appwrite/services/database'
|
10
|
-
require_relative 'appwrite/services/locale'
|
11
|
-
require_relative 'appwrite/services/projects'
|
12
|
-
require_relative 'appwrite/services/storage'
|
13
|
-
require_relative 'appwrite/services/teams'
|
14
|
-
require_relative 'appwrite/services/users'
|
15
|
-
|
16
|
-
module Appwrite
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
client = Appwrite::Client.new()
|
21
|
-
|
22
|
-
client
|
23
|
-
.set_endpoint('https://www.walla.co.il')
|
24
|
-
.add_header('x', 'y')
|
25
|
-
.add_header('z', 'i')
|
26
|
-
.call('get', '/info', {}, {'test': 'xxx'})
|
data/lib/appwrite/client.rb
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
require 'uri'
|
3
|
-
require 'json'
|
4
|
-
|
5
|
-
module Appwrite
|
6
|
-
class Client
|
7
|
-
|
8
|
-
METHOD_GET = 'get'
|
9
|
-
METHOD_POST = 'post'
|
10
|
-
METHOD_PUT = 'put'
|
11
|
-
METHOD_PATCH = 'patch'
|
12
|
-
METHOD_DELETE = 'delete'
|
13
|
-
METHOD_HEAD = 'head'
|
14
|
-
METHOD_OPTIONS = 'options'
|
15
|
-
METHOD_CONNECT = 'connect'
|
16
|
-
METHOD_TRACE = 'trace'
|
17
|
-
|
18
|
-
def initialize()
|
19
|
-
@headers = {
|
20
|
-
'content-type' => '',
|
21
|
-
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
|
22
|
-
'x-sdk-version' => 'appwrite:ruby:1.0.1'
|
23
|
-
}
|
24
|
-
@endpoint = 'https://appwrite.io/v1';
|
25
|
-
end
|
26
|
-
|
27
|
-
def set_project(value)
|
28
|
-
add_header('x-appwrite-project', value)
|
29
|
-
|
30
|
-
return self
|
31
|
-
end
|
32
|
-
|
33
|
-
def set_key(value)
|
34
|
-
add_header('x-appwrite-key', value)
|
35
|
-
|
36
|
-
return self
|
37
|
-
end
|
38
|
-
|
39
|
-
def set_locale(value)
|
40
|
-
add_header('x-appwrite-locale', value)
|
41
|
-
|
42
|
-
return self
|
43
|
-
end
|
44
|
-
|
45
|
-
def set_mode(value)
|
46
|
-
add_header('x-appwrite-mode', value)
|
47
|
-
|
48
|
-
return self
|
49
|
-
end
|
50
|
-
|
51
|
-
def set_endpoint(endpoint)
|
52
|
-
@endpoint = endpoint
|
53
|
-
|
54
|
-
return self
|
55
|
-
end
|
56
|
-
|
57
|
-
def add_header(key, value)
|
58
|
-
@headers[key.downcase] = value.downcase
|
59
|
-
|
60
|
-
return self
|
61
|
-
end
|
62
|
-
|
63
|
-
def call(method, path = '', headers = {}, params = {})
|
64
|
-
uri = URI.parse(@endpoint + path + ((method == METHOD_GET) ? '?' + URI.encode_www_form(params) : ''))
|
65
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
66
|
-
http.use_ssl = (uri.scheme == 'https')
|
67
|
-
payload = ''
|
68
|
-
|
69
|
-
headers = @headers.merge(headers)
|
70
|
-
|
71
|
-
if (method != METHOD_GET)
|
72
|
-
case headers['content-type'][0, headers['content-type'].index(';') || headers['content-type'].length]
|
73
|
-
when 'application/json'
|
74
|
-
payload = params.to_json
|
75
|
-
else
|
76
|
-
payload = URI.encode_www_form(params)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
begin
|
81
|
-
response = http.send_request(method.upcase, uri.request_uri, payload, headers)
|
82
|
-
rescue => error
|
83
|
-
raise 'Request Failed: ' + error.message
|
84
|
-
end
|
85
|
-
|
86
|
-
return JSON.parse(response.body);
|
87
|
-
end
|
88
|
-
|
89
|
-
protected
|
90
|
-
|
91
|
-
private
|
92
|
-
end
|
93
|
-
end
|
data/lib/appwrite/service.rb
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
module Appwrite
|
2
|
-
class Account < Service
|
3
|
-
|
4
|
-
def get()
|
5
|
-
path = '/account'
|
6
|
-
|
7
|
-
params = {
|
8
|
-
}
|
9
|
-
|
10
|
-
return @client.call('get', path, {
|
11
|
-
'content-type' => 'application/json',
|
12
|
-
}, params);
|
13
|
-
end
|
14
|
-
|
15
|
-
def delete()
|
16
|
-
path = '/account'
|
17
|
-
|
18
|
-
params = {
|
19
|
-
}
|
20
|
-
|
21
|
-
return @client.call('delete', path, {
|
22
|
-
'content-type' => 'application/json',
|
23
|
-
}, params);
|
24
|
-
end
|
25
|
-
|
26
|
-
def update_email(email:, password:)
|
27
|
-
path = '/account/email'
|
28
|
-
|
29
|
-
params = {
|
30
|
-
'email': email,
|
31
|
-
'password': password
|
32
|
-
}
|
33
|
-
|
34
|
-
return @client.call('patch', path, {
|
35
|
-
'content-type' => 'application/json',
|
36
|
-
}, params);
|
37
|
-
end
|
38
|
-
|
39
|
-
def update_name(name:)
|
40
|
-
path = '/account/name'
|
41
|
-
|
42
|
-
params = {
|
43
|
-
'name': name
|
44
|
-
}
|
45
|
-
|
46
|
-
return @client.call('patch', path, {
|
47
|
-
'content-type' => 'application/json',
|
48
|
-
}, params);
|
49
|
-
end
|
50
|
-
|
51
|
-
def update_password(password:, old_password:)
|
52
|
-
path = '/account/password'
|
53
|
-
|
54
|
-
params = {
|
55
|
-
'password': password,
|
56
|
-
'old-password': old_password
|
57
|
-
}
|
58
|
-
|
59
|
-
return @client.call('patch', path, {
|
60
|
-
'content-type' => 'application/json',
|
61
|
-
}, params);
|
62
|
-
end
|
63
|
-
|
64
|
-
def get_prefs()
|
65
|
-
path = '/account/prefs'
|
66
|
-
|
67
|
-
params = {
|
68
|
-
}
|
69
|
-
|
70
|
-
return @client.call('get', path, {
|
71
|
-
'content-type' => 'application/json',
|
72
|
-
}, params);
|
73
|
-
end
|
74
|
-
|
75
|
-
def update_prefs(prefs:)
|
76
|
-
path = '/account/prefs'
|
77
|
-
|
78
|
-
params = {
|
79
|
-
'prefs': prefs
|
80
|
-
}
|
81
|
-
|
82
|
-
return @client.call('patch', path, {
|
83
|
-
'content-type' => 'application/json',
|
84
|
-
}, params);
|
85
|
-
end
|
86
|
-
|
87
|
-
def get_security()
|
88
|
-
path = '/account/security'
|
89
|
-
|
90
|
-
params = {
|
91
|
-
}
|
92
|
-
|
93
|
-
return @client.call('get', path, {
|
94
|
-
'content-type' => 'application/json',
|
95
|
-
}, params);
|
96
|
-
end
|
97
|
-
|
98
|
-
def get_sessions()
|
99
|
-
path = '/account/sessions'
|
100
|
-
|
101
|
-
params = {
|
102
|
-
}
|
103
|
-
|
104
|
-
return @client.call('get', path, {
|
105
|
-
'content-type' => 'application/json',
|
106
|
-
}, params);
|
107
|
-
end
|
108
|
-
|
109
|
-
|
110
|
-
protected
|
111
|
-
|
112
|
-
private
|
113
|
-
end
|
114
|
-
end
|
@@ -1,131 +0,0 @@
|
|
1
|
-
module Appwrite
|
2
|
-
class Auth < Service
|
3
|
-
|
4
|
-
def login(email:, password:, success: '', failure: '')
|
5
|
-
path = '/auth/login'
|
6
|
-
|
7
|
-
params = {
|
8
|
-
'email': email,
|
9
|
-
'password': password,
|
10
|
-
'success': success,
|
11
|
-
'failure': failure
|
12
|
-
}
|
13
|
-
|
14
|
-
return @client.call('post', path, {
|
15
|
-
'content-type' => 'application/json',
|
16
|
-
}, params);
|
17
|
-
end
|
18
|
-
|
19
|
-
def logout()
|
20
|
-
path = '/auth/logout'
|
21
|
-
|
22
|
-
params = {
|
23
|
-
}
|
24
|
-
|
25
|
-
return @client.call('delete', path, {
|
26
|
-
'content-type' => 'application/json',
|
27
|
-
}, params);
|
28
|
-
end
|
29
|
-
|
30
|
-
def logout_by_session(id:)
|
31
|
-
path = '/auth/logout/{id}'
|
32
|
-
.gsub('{id}', id)
|
33
|
-
|
34
|
-
params = {
|
35
|
-
}
|
36
|
-
|
37
|
-
return @client.call('delete', path, {
|
38
|
-
'content-type' => 'application/json',
|
39
|
-
}, params);
|
40
|
-
end
|
41
|
-
|
42
|
-
def oauth(provider:, success:, failure:)
|
43
|
-
path = '/auth/oauth/{provider}'
|
44
|
-
.gsub('{provider}', provider)
|
45
|
-
|
46
|
-
params = {
|
47
|
-
'success': success,
|
48
|
-
'failure': failure
|
49
|
-
}
|
50
|
-
|
51
|
-
return @client.call('get', path, {
|
52
|
-
'content-type' => 'application/json',
|
53
|
-
}, params);
|
54
|
-
end
|
55
|
-
|
56
|
-
def recovery(email:, reset:)
|
57
|
-
path = '/auth/recovery'
|
58
|
-
|
59
|
-
params = {
|
60
|
-
'email': email,
|
61
|
-
'reset': reset
|
62
|
-
}
|
63
|
-
|
64
|
-
return @client.call('post', path, {
|
65
|
-
'content-type' => 'application/json',
|
66
|
-
}, params);
|
67
|
-
end
|
68
|
-
|
69
|
-
def recovery_reset(user_id:, token:, password_a:, password_b:)
|
70
|
-
path = '/auth/recovery/reset'
|
71
|
-
|
72
|
-
params = {
|
73
|
-
'userId': user_id,
|
74
|
-
'token': token,
|
75
|
-
'password-a': password_a,
|
76
|
-
'password-b': password_b
|
77
|
-
}
|
78
|
-
|
79
|
-
return @client.call('put', path, {
|
80
|
-
'content-type' => 'application/json',
|
81
|
-
}, params);
|
82
|
-
end
|
83
|
-
|
84
|
-
def register(email:, password:, confirm:, success: '', failure: '', name: '')
|
85
|
-
path = '/auth/register'
|
86
|
-
|
87
|
-
params = {
|
88
|
-
'email': email,
|
89
|
-
'password': password,
|
90
|
-
'confirm': confirm,
|
91
|
-
'success': success,
|
92
|
-
'failure': failure,
|
93
|
-
'name': name
|
94
|
-
}
|
95
|
-
|
96
|
-
return @client.call('post', path, {
|
97
|
-
'content-type' => 'application/json',
|
98
|
-
}, params);
|
99
|
-
end
|
100
|
-
|
101
|
-
def confirm(user_id:, token:)
|
102
|
-
path = '/auth/register/confirm'
|
103
|
-
|
104
|
-
params = {
|
105
|
-
'userId': user_id,
|
106
|
-
'token': token
|
107
|
-
}
|
108
|
-
|
109
|
-
return @client.call('post', path, {
|
110
|
-
'content-type' => 'application/json',
|
111
|
-
}, params);
|
112
|
-
end
|
113
|
-
|
114
|
-
def confirm_resend(confirm:)
|
115
|
-
path = '/auth/register/confirm/resend'
|
116
|
-
|
117
|
-
params = {
|
118
|
-
'confirm': confirm
|
119
|
-
}
|
120
|
-
|
121
|
-
return @client.call('post', path, {
|
122
|
-
'content-type' => 'application/json',
|
123
|
-
}, params);
|
124
|
-
end
|
125
|
-
|
126
|
-
|
127
|
-
protected
|
128
|
-
|
129
|
-
private
|
130
|
-
end
|
131
|
-
end
|