appwrite 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/appwrite.gemspec +1 -1
- data/lib/appwrite/client.rb +1 -1
- data/lib/appwrite/services/account.rb +136 -46
- data/lib/appwrite/services/avatars.rb +125 -42
- data/lib/appwrite/services/database.rb +199 -53
- data/lib/appwrite/services/functions.rb +223 -61
- data/lib/appwrite/services/health.rb +12 -24
- data/lib/appwrite/services/locale.rb +7 -14
- data/lib/appwrite/services/storage.rb +123 -38
- data/lib/appwrite/services/teams.rb +162 -42
- data/lib/appwrite/services/users.rb +105 -33
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8ff2795d0cc0f1baea07252be2491778be3f5a3cef6ec3ab2e8609fef6a9aa
|
4
|
+
data.tar.gz: 21e9ade2dcb732c4edef4034cb0d339e82f115f14d7e9a24e77419097574bcec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 444fb0922c332ff21bb3e5bf800ed5bd94a78b874c64dd91ad870fc7a5b2a6260550f82b9c386459ee31e309734b997965de1c554f9e66ca58fa4fdc3dc76809
|
7
|
+
data.tar.gz: b3764a2d140cbd594cfe6fb9f88c7319d12df46451da1a1c5663b281feb512cd67f124e9c2cb98187ea7047387d92d702fb1a93c5b86cfd491d095e723ac089a
|
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.1.
|
4
|
+
s.version = '2.1.2'
|
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'
|
data/lib/appwrite/client.rb
CHANGED
@@ -20,7 +20,7 @@ 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.1.
|
23
|
+
'x-sdk-version' => 'appwrite:ruby:2.1.2',
|
24
24
|
'X-Appwrite-Response-Format' => '0.8.0'
|
25
25
|
}
|
26
26
|
@endpoint = 'https://appwrite.io/v1';
|
@@ -4,8 +4,7 @@ module Appwrite
|
|
4
4
|
def get()
|
5
5
|
path = '/account'
|
6
6
|
|
7
|
-
params = {
|
8
|
-
}
|
7
|
+
params = {}
|
9
8
|
|
10
9
|
return @client.call('get', path, {
|
11
10
|
'content-type' => 'application/json',
|
@@ -15,8 +14,7 @@ module Appwrite
|
|
15
14
|
def delete()
|
16
15
|
path = '/account'
|
17
16
|
|
18
|
-
params = {
|
19
|
-
}
|
17
|
+
params = {}
|
20
18
|
|
21
19
|
return @client.call('delete', path, {
|
22
20
|
'content-type' => 'application/json',
|
@@ -24,12 +22,25 @@ module Appwrite
|
|
24
22
|
end
|
25
23
|
|
26
24
|
def update_email(email:, password:)
|
25
|
+
if email.nil?
|
26
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
27
|
+
end
|
28
|
+
|
29
|
+
if password.nil?
|
30
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
31
|
+
end
|
32
|
+
|
27
33
|
path = '/account/email'
|
28
34
|
|
29
|
-
params = {
|
30
|
-
|
31
|
-
|
32
|
-
|
35
|
+
params = {}
|
36
|
+
|
37
|
+
if !email.nil?
|
38
|
+
params[:email] = email
|
39
|
+
end
|
40
|
+
|
41
|
+
if !password.nil?
|
42
|
+
params[:password] = password
|
43
|
+
end
|
33
44
|
|
34
45
|
return @client.call('patch', path, {
|
35
46
|
'content-type' => 'application/json',
|
@@ -39,8 +50,7 @@ module Appwrite
|
|
39
50
|
def get_logs()
|
40
51
|
path = '/account/logs'
|
41
52
|
|
42
|
-
params = {
|
43
|
-
}
|
53
|
+
params = {}
|
44
54
|
|
45
55
|
return @client.call('get', path, {
|
46
56
|
'content-type' => 'application/json',
|
@@ -48,24 +58,39 @@ module Appwrite
|
|
48
58
|
end
|
49
59
|
|
50
60
|
def update_name(name:)
|
61
|
+
if name.nil?
|
62
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
63
|
+
end
|
64
|
+
|
51
65
|
path = '/account/name'
|
52
66
|
|
53
|
-
params = {
|
54
|
-
|
55
|
-
|
67
|
+
params = {}
|
68
|
+
|
69
|
+
if !name.nil?
|
70
|
+
params[:name] = name
|
71
|
+
end
|
56
72
|
|
57
73
|
return @client.call('patch', path, {
|
58
74
|
'content-type' => 'application/json',
|
59
75
|
}, params);
|
60
76
|
end
|
61
77
|
|
62
|
-
def update_password(password:, old_password:
|
78
|
+
def update_password(password:, old_password: nil)
|
79
|
+
if password.nil?
|
80
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
81
|
+
end
|
82
|
+
|
63
83
|
path = '/account/password'
|
64
84
|
|
65
|
-
params = {
|
66
|
-
|
67
|
-
|
68
|
-
|
85
|
+
params = {}
|
86
|
+
|
87
|
+
if !password.nil?
|
88
|
+
params[:password] = password
|
89
|
+
end
|
90
|
+
|
91
|
+
if !old_password.nil?
|
92
|
+
params[:oldPassword] = old_password
|
93
|
+
end
|
69
94
|
|
70
95
|
return @client.call('patch', path, {
|
71
96
|
'content-type' => 'application/json',
|
@@ -75,8 +100,7 @@ module Appwrite
|
|
75
100
|
def get_prefs()
|
76
101
|
path = '/account/prefs'
|
77
102
|
|
78
|
-
params = {
|
79
|
-
}
|
103
|
+
params = {}
|
80
104
|
|
81
105
|
return @client.call('get', path, {
|
82
106
|
'content-type' => 'application/json',
|
@@ -84,11 +108,17 @@ module Appwrite
|
|
84
108
|
end
|
85
109
|
|
86
110
|
def update_prefs(prefs:)
|
111
|
+
if prefs.nil?
|
112
|
+
raise Appwrite::Exception.new('Missing required parameter: "prefs"')
|
113
|
+
end
|
114
|
+
|
87
115
|
path = '/account/prefs'
|
88
116
|
|
89
|
-
params = {
|
90
|
-
|
91
|
-
|
117
|
+
params = {}
|
118
|
+
|
119
|
+
if !prefs.nil?
|
120
|
+
params[:prefs] = prefs
|
121
|
+
end
|
92
122
|
|
93
123
|
return @client.call('patch', path, {
|
94
124
|
'content-type' => 'application/json',
|
@@ -96,12 +126,25 @@ module Appwrite
|
|
96
126
|
end
|
97
127
|
|
98
128
|
def create_recovery(email:, url:)
|
129
|
+
if email.nil?
|
130
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
131
|
+
end
|
132
|
+
|
133
|
+
if url.nil?
|
134
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
135
|
+
end
|
136
|
+
|
99
137
|
path = '/account/recovery'
|
100
138
|
|
101
|
-
params = {
|
102
|
-
|
103
|
-
|
104
|
-
|
139
|
+
params = {}
|
140
|
+
|
141
|
+
if !email.nil?
|
142
|
+
params[:email] = email
|
143
|
+
end
|
144
|
+
|
145
|
+
if !url.nil?
|
146
|
+
params[:url] = url
|
147
|
+
end
|
105
148
|
|
106
149
|
return @client.call('post', path, {
|
107
150
|
'content-type' => 'application/json',
|
@@ -109,14 +152,41 @@ module Appwrite
|
|
109
152
|
end
|
110
153
|
|
111
154
|
def update_recovery(user_id:, secret:, password:, password_again:)
|
155
|
+
if user_id.nil?
|
156
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
157
|
+
end
|
158
|
+
|
159
|
+
if secret.nil?
|
160
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
161
|
+
end
|
162
|
+
|
163
|
+
if password.nil?
|
164
|
+
raise Appwrite::Exception.new('Missing required parameter: "password"')
|
165
|
+
end
|
166
|
+
|
167
|
+
if password_again.nil?
|
168
|
+
raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"')
|
169
|
+
end
|
170
|
+
|
112
171
|
path = '/account/recovery'
|
113
172
|
|
114
|
-
params = {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
173
|
+
params = {}
|
174
|
+
|
175
|
+
if !user_id.nil?
|
176
|
+
params[:userId] = user_id
|
177
|
+
end
|
178
|
+
|
179
|
+
if !secret.nil?
|
180
|
+
params[:secret] = secret
|
181
|
+
end
|
182
|
+
|
183
|
+
if !password.nil?
|
184
|
+
params[:password] = password
|
185
|
+
end
|
186
|
+
|
187
|
+
if !password_again.nil?
|
188
|
+
params[:passwordAgain] = password_again
|
189
|
+
end
|
120
190
|
|
121
191
|
return @client.call('put', path, {
|
122
192
|
'content-type' => 'application/json',
|
@@ -126,8 +196,7 @@ module Appwrite
|
|
126
196
|
def get_sessions()
|
127
197
|
path = '/account/sessions'
|
128
198
|
|
129
|
-
params = {
|
130
|
-
}
|
199
|
+
params = {}
|
131
200
|
|
132
201
|
return @client.call('get', path, {
|
133
202
|
'content-type' => 'application/json',
|
@@ -137,8 +206,7 @@ module Appwrite
|
|
137
206
|
def delete_sessions()
|
138
207
|
path = '/account/sessions'
|
139
208
|
|
140
|
-
params = {
|
141
|
-
}
|
209
|
+
params = {}
|
142
210
|
|
143
211
|
return @client.call('delete', path, {
|
144
212
|
'content-type' => 'application/json',
|
@@ -146,11 +214,14 @@ module Appwrite
|
|
146
214
|
end
|
147
215
|
|
148
216
|
def delete_session(session_id:)
|
217
|
+
if session_id.nil?
|
218
|
+
raise Appwrite::Exception.new('Missing required parameter: "sessionId"')
|
219
|
+
end
|
220
|
+
|
149
221
|
path = '/account/sessions/{sessionId}'
|
150
222
|
.gsub('{sessionId}', session_id)
|
151
223
|
|
152
|
-
params = {
|
153
|
-
}
|
224
|
+
params = {}
|
154
225
|
|
155
226
|
return @client.call('delete', path, {
|
156
227
|
'content-type' => 'application/json',
|
@@ -158,11 +229,17 @@ module Appwrite
|
|
158
229
|
end
|
159
230
|
|
160
231
|
def create_verification(url:)
|
232
|
+
if url.nil?
|
233
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
234
|
+
end
|
235
|
+
|
161
236
|
path = '/account/verification'
|
162
237
|
|
163
|
-
params = {
|
164
|
-
|
165
|
-
|
238
|
+
params = {}
|
239
|
+
|
240
|
+
if !url.nil?
|
241
|
+
params[:url] = url
|
242
|
+
end
|
166
243
|
|
167
244
|
return @client.call('post', path, {
|
168
245
|
'content-type' => 'application/json',
|
@@ -170,12 +247,25 @@ module Appwrite
|
|
170
247
|
end
|
171
248
|
|
172
249
|
def update_verification(user_id:, secret:)
|
250
|
+
if user_id.nil?
|
251
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
252
|
+
end
|
253
|
+
|
254
|
+
if secret.nil?
|
255
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
256
|
+
end
|
257
|
+
|
173
258
|
path = '/account/verification'
|
174
259
|
|
175
|
-
params = {
|
176
|
-
|
177
|
-
|
178
|
-
|
260
|
+
params = {}
|
261
|
+
|
262
|
+
if !user_id.nil?
|
263
|
+
params[:userId] = user_id
|
264
|
+
end
|
265
|
+
|
266
|
+
if !secret.nil?
|
267
|
+
params[:secret] = secret
|
268
|
+
end
|
179
269
|
|
180
270
|
return @client.call('put', path, {
|
181
271
|
'content-type' => 'application/json',
|
@@ -1,30 +1,54 @@
|
|
1
1
|
module Appwrite
|
2
2
|
class Avatars < Service
|
3
3
|
|
4
|
-
def get_browser(code:, width:
|
4
|
+
def get_browser(code:, width: nil, height: nil, quality: nil)
|
5
|
+
if code.nil?
|
6
|
+
raise Appwrite::Exception.new('Missing required parameter: "code"')
|
7
|
+
end
|
8
|
+
|
5
9
|
path = '/avatars/browsers/{code}'
|
6
10
|
.gsub('{code}', code)
|
7
11
|
|
8
|
-
params = {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
params = {}
|
13
|
+
|
14
|
+
if !width.nil?
|
15
|
+
params[:width] = width
|
16
|
+
end
|
17
|
+
|
18
|
+
if !height.nil?
|
19
|
+
params[:height] = height
|
20
|
+
end
|
21
|
+
|
22
|
+
if !quality.nil?
|
23
|
+
params[:quality] = quality
|
24
|
+
end
|
13
25
|
|
14
26
|
return @client.call('get', path, {
|
15
27
|
'content-type' => 'application/json',
|
16
28
|
}, params);
|
17
29
|
end
|
18
30
|
|
19
|
-
def get_credit_card(code:, width:
|
31
|
+
def get_credit_card(code:, width: nil, height: nil, quality: nil)
|
32
|
+
if code.nil?
|
33
|
+
raise Appwrite::Exception.new('Missing required parameter: "code"')
|
34
|
+
end
|
35
|
+
|
20
36
|
path = '/avatars/credit-cards/{code}'
|
21
37
|
.gsub('{code}', code)
|
22
38
|
|
23
|
-
params = {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
39
|
+
params = {}
|
40
|
+
|
41
|
+
if !width.nil?
|
42
|
+
params[:width] = width
|
43
|
+
end
|
44
|
+
|
45
|
+
if !height.nil?
|
46
|
+
params[:height] = height
|
47
|
+
end
|
48
|
+
|
49
|
+
if !quality.nil?
|
50
|
+
params[:quality] = quality
|
51
|
+
end
|
28
52
|
|
29
53
|
return @client.call('get', path, {
|
30
54
|
'content-type' => 'application/json',
|
@@ -32,71 +56,130 @@ module Appwrite
|
|
32
56
|
end
|
33
57
|
|
34
58
|
def get_favicon(url:)
|
59
|
+
if url.nil?
|
60
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
61
|
+
end
|
62
|
+
|
35
63
|
path = '/avatars/favicon'
|
36
64
|
|
37
|
-
params = {
|
38
|
-
|
39
|
-
|
65
|
+
params = {}
|
66
|
+
|
67
|
+
if !url.nil?
|
68
|
+
params[:url] = url
|
69
|
+
end
|
40
70
|
|
41
71
|
return @client.call('get', path, {
|
42
72
|
'content-type' => 'application/json',
|
43
73
|
}, params);
|
44
74
|
end
|
45
75
|
|
46
|
-
def get_flag(code:, width:
|
76
|
+
def get_flag(code:, width: nil, height: nil, quality: nil)
|
77
|
+
if code.nil?
|
78
|
+
raise Appwrite::Exception.new('Missing required parameter: "code"')
|
79
|
+
end
|
80
|
+
|
47
81
|
path = '/avatars/flags/{code}'
|
48
82
|
.gsub('{code}', code)
|
49
83
|
|
50
|
-
params = {
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
84
|
+
params = {}
|
85
|
+
|
86
|
+
if !width.nil?
|
87
|
+
params[:width] = width
|
88
|
+
end
|
89
|
+
|
90
|
+
if !height.nil?
|
91
|
+
params[:height] = height
|
92
|
+
end
|
93
|
+
|
94
|
+
if !quality.nil?
|
95
|
+
params[:quality] = quality
|
96
|
+
end
|
55
97
|
|
56
98
|
return @client.call('get', path, {
|
57
99
|
'content-type' => 'application/json',
|
58
100
|
}, params);
|
59
101
|
end
|
60
102
|
|
61
|
-
def get_image(url:, width:
|
103
|
+
def get_image(url:, width: nil, height: nil)
|
104
|
+
if url.nil?
|
105
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
106
|
+
end
|
107
|
+
|
62
108
|
path = '/avatars/image'
|
63
109
|
|
64
|
-
params = {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
110
|
+
params = {}
|
111
|
+
|
112
|
+
if !url.nil?
|
113
|
+
params[:url] = url
|
114
|
+
end
|
115
|
+
|
116
|
+
if !width.nil?
|
117
|
+
params[:width] = width
|
118
|
+
end
|
119
|
+
|
120
|
+
if !height.nil?
|
121
|
+
params[:height] = height
|
122
|
+
end
|
69
123
|
|
70
124
|
return @client.call('get', path, {
|
71
125
|
'content-type' => 'application/json',
|
72
126
|
}, params);
|
73
127
|
end
|
74
128
|
|
75
|
-
def get_initials(name:
|
129
|
+
def get_initials(name: nil, width: nil, height: nil, color: nil, background: nil)
|
76
130
|
path = '/avatars/initials'
|
77
131
|
|
78
|
-
params = {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
132
|
+
params = {}
|
133
|
+
|
134
|
+
if !name.nil?
|
135
|
+
params[:name] = name
|
136
|
+
end
|
137
|
+
|
138
|
+
if !width.nil?
|
139
|
+
params[:width] = width
|
140
|
+
end
|
141
|
+
|
142
|
+
if !height.nil?
|
143
|
+
params[:height] = height
|
144
|
+
end
|
145
|
+
|
146
|
+
if !color.nil?
|
147
|
+
params[:color] = color
|
148
|
+
end
|
149
|
+
|
150
|
+
if !background.nil?
|
151
|
+
params[:background] = background
|
152
|
+
end
|
85
153
|
|
86
154
|
return @client.call('get', path, {
|
87
155
|
'content-type' => 'application/json',
|
88
156
|
}, params);
|
89
157
|
end
|
90
158
|
|
91
|
-
def get_q_r(text:, size:
|
159
|
+
def get_q_r(text:, size: nil, margin: nil, download: nil)
|
160
|
+
if text.nil?
|
161
|
+
raise Appwrite::Exception.new('Missing required parameter: "text"')
|
162
|
+
end
|
163
|
+
|
92
164
|
path = '/avatars/qr'
|
93
165
|
|
94
|
-
params = {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
166
|
+
params = {}
|
167
|
+
|
168
|
+
if !text.nil?
|
169
|
+
params[:text] = text
|
170
|
+
end
|
171
|
+
|
172
|
+
if !size.nil?
|
173
|
+
params[:size] = size
|
174
|
+
end
|
175
|
+
|
176
|
+
if !margin.nil?
|
177
|
+
params[:margin] = margin
|
178
|
+
end
|
179
|
+
|
180
|
+
if !download.nil?
|
181
|
+
params[:download] = download
|
182
|
+
end
|
100
183
|
|
101
184
|
return @client.call('get', path, {
|
102
185
|
'content-type' => 'application/json',
|