Skip to content

Commit 8f840a5

Browse files
committed
Upgraded to support Appwrite 0.6
1 parent a144a4d commit 8f840a5

File tree

7 files changed

+163
-15
lines changed

7 files changed

+163
-15
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Appwrite SDK for Ruby
1+
# Appwrite Ruby SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?v=1)
4-
![Version](https://img.shields.io/badge/api%20version-0.5.3-blue.svg?v=1)
4+
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)
55

6-
**This SDK is compatible with Appwrite server version 0.5.3. For older versions, please check previous releases.**
6+
**This SDK is compatible with Appwrite server version 0.6.0. For older versions, please check previous releases.**
77

88
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.
99
Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.

appwrite.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
77
For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)"
88
s.author = 'Appwrite Team'
99
s.homepage = 'https://appwrite.io/support'
10-
s.email = 'team@appwrite.io'
10+
s.email = 'team@localhost.test'
1111
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
1212

1313
end

lib/appwrite.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
require_relative 'appwrite/service'
66
require_relative 'appwrite/services/avatars'
77
require_relative 'appwrite/services/database'
8+
require_relative 'appwrite/services/health'
89
require_relative 'appwrite/services/locale'
910
require_relative 'appwrite/services/storage'
1011
require_relative 'appwrite/services/teams'

lib/appwrite/client.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ def set_locale(value)
4343
return self
4444
end
4545

46-
def set_mode(value)
47-
add_header('x-appwrite-mode', value)
48-
49-
return self
50-
end
51-
5246
def set_endpoint(endpoint)
5347
@endpoint = endpoint
5448

lib/appwrite/services/database.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def list_documents(collection_id:, filters: [], offset: 0, limit: 50, order_fiel
7979
'filters': filters,
8080
'offset': offset,
8181
'limit': limit,
82-
'order-field': order_field,
83-
'order-type': order_type,
84-
'order-cast': order_cast,
82+
'orderField': order_field,
83+
'orderType': order_type,
84+
'orderCast': order_cast,
8585
'search': search,
8686
'first': first,
8787
'last': last
@@ -152,6 +152,18 @@ def delete_document(collection_id:, document_id:)
152152
}, params);
153153
end
154154

155+
def get_collection_logs(collection_id:)
156+
path = '/database/collections/{collectionId}/logs'
157+
.gsub('{collection_id}', collection_id)
158+
159+
params = {
160+
}
161+
162+
return @client.call('get', path, {
163+
'content-type' => 'application/json',
164+
}, params);
165+
end
166+
155167

156168
protected
157169

lib/appwrite/services/health.rb

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
module Appwrite
2+
class Health < Service
3+
4+
def get()
5+
path = '/health'
6+
7+
params = {
8+
}
9+
10+
return @client.call('get', path, {
11+
'content-type' => 'application/json',
12+
}, params);
13+
end
14+
15+
def get_anti_virus()
16+
path = '/health/anti-virus'
17+
18+
params = {
19+
}
20+
21+
return @client.call('get', path, {
22+
'content-type' => 'application/json',
23+
}, params);
24+
end
25+
26+
def get_cache()
27+
path = '/health/cache'
28+
29+
params = {
30+
}
31+
32+
return @client.call('get', path, {
33+
'content-type' => 'application/json',
34+
}, params);
35+
end
36+
37+
def get_d_b()
38+
path = '/health/db'
39+
40+
params = {
41+
}
42+
43+
return @client.call('get', path, {
44+
'content-type' => 'application/json',
45+
}, params);
46+
end
47+
48+
def get_queue_certificates()
49+
path = '/health/queue/certificates'
50+
51+
params = {
52+
}
53+
54+
return @client.call('get', path, {
55+
'content-type' => 'application/json',
56+
}, params);
57+
end
58+
59+
def get_queue_functions()
60+
path = '/health/queue/functions'
61+
62+
params = {
63+
}
64+
65+
return @client.call('get', path, {
66+
'content-type' => 'application/json',
67+
}, params);
68+
end
69+
70+
def get_queue_logs()
71+
path = '/health/queue/logs'
72+
73+
params = {
74+
}
75+
76+
return @client.call('get', path, {
77+
'content-type' => 'application/json',
78+
}, params);
79+
end
80+
81+
def get_queue_tasks()
82+
path = '/health/queue/tasks'
83+
84+
params = {
85+
}
86+
87+
return @client.call('get', path, {
88+
'content-type' => 'application/json',
89+
}, params);
90+
end
91+
92+
def get_queue_usage()
93+
path = '/health/queue/usage'
94+
95+
params = {
96+
}
97+
98+
return @client.call('get', path, {
99+
'content-type' => 'application/json',
100+
}, params);
101+
end
102+
103+
def get_queue_webhooks()
104+
path = '/health/queue/webhooks'
105+
106+
params = {
107+
}
108+
109+
return @client.call('get', path, {
110+
'content-type' => 'application/json',
111+
}, params);
112+
end
113+
114+
def get_storage_local()
115+
path = '/health/storage/local'
116+
117+
params = {
118+
}
119+
120+
return @client.call('get', path, {
121+
'content-type' => 'application/json',
122+
}, params);
123+
end
124+
125+
def get_time()
126+
path = '/health/time'
127+
128+
params = {
129+
}
130+
131+
return @client.call('get', path, {
132+
'content-type' => 'application/json',
133+
}, params);
134+
end
135+
136+
137+
protected
138+
139+
private
140+
end
141+
end

lib/appwrite/services/users.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ def delete_sessions(user_id:)
104104
end
105105

106106
def delete_session(user_id:, session_id:)
107-
path = '/users/{userId}/sessions/:session'
107+
path = '/users/{userId}/sessions/{sessionId}'
108108
.gsub('{user_id}', user_id)
109+
.gsub('{session_id}', session_id)
109110

110111
params = {
111-
'sessionId': session_id
112112
}
113113

114114
return @client.call('delete', path, {

0 commit comments

Comments
 (0)