appwrite 4.1.0 → 7.0.0.pre.RC1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +32 -11
- data/lib/appwrite/id.rb +11 -0
- data/lib/appwrite/input_file.rb +33 -0
- data/lib/appwrite/models/account.rb +82 -0
- data/lib/appwrite/models/algo_argon2.rb +37 -0
- data/lib/appwrite/models/algo_bcrypt.rb +22 -0
- data/lib/appwrite/models/algo_md5.rb +22 -0
- data/lib/appwrite/models/algo_phpass.rb +22 -0
- data/lib/appwrite/models/algo_scrypt.rb +42 -0
- data/lib/appwrite/models/algo_scrypt_modified.rb +37 -0
- data/lib/appwrite/models/algo_sha.rb +22 -0
- data/lib/appwrite/models/attribute_datetime.rb +57 -0
- data/lib/appwrite/models/bucket.rb +25 -25
- data/lib/appwrite/models/collection.rb +25 -15
- data/lib/appwrite/models/database.rb +42 -0
- data/lib/appwrite/models/database_list.rb +32 -0
- data/lib/appwrite/models/deployment.rb +10 -5
- data/lib/appwrite/models/document.rb +15 -10
- data/lib/appwrite/models/execution.rb +20 -10
- data/lib/appwrite/models/file.rb +15 -15
- data/lib/appwrite/models/function.rb +12 -12
- data/lib/appwrite/models/index.rb +1 -1
- data/lib/appwrite/models/membership.rb +25 -10
- data/lib/appwrite/models/session.rb +5 -0
- data/lib/appwrite/models/team.rb +10 -5
- data/lib/appwrite/models/token.rb +5 -0
- data/lib/appwrite/models/user.rb +35 -0
- data/lib/appwrite/models/variable.rb +52 -0
- data/lib/appwrite/models/variable_list.rb +32 -0
- data/lib/appwrite/permission.rb +21 -0
- data/lib/appwrite/query.rb +43 -14
- data/lib/appwrite/role.rb +31 -0
- data/lib/appwrite/services/account.rb +274 -126
- data/lib/appwrite/services/avatars.rb +106 -59
- data/lib/appwrite/services/databases.rb +1425 -0
- data/lib/appwrite/services/functions.rb +381 -176
- data/lib/appwrite/services/health.rb +34 -34
- data/lib/appwrite/services/locale.rb +25 -7
- data/lib/appwrite/services/storage.rb +195 -193
- data/lib/appwrite/services/teams.rb +138 -128
- data/lib/appwrite/services/users.rb +637 -123
- data/lib/appwrite.rb +19 -2
- metadata +22 -6
- data/lib/appwrite/file.rb +0 -17
- data/lib/appwrite/services/database.rb +0 -1049
@@ -3,16 +3,21 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Health < Service
|
5
5
|
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
6
10
|
# Check the Appwrite HTTP server is up and responsive.
|
7
11
|
#
|
8
12
|
#
|
9
13
|
# @return [HealthStatus]
|
10
14
|
def get()
|
15
|
+
|
11
16
|
path = '/health'
|
12
17
|
|
13
18
|
params = {
|
14
19
|
}
|
15
|
-
|
20
|
+
|
16
21
|
headers = {
|
17
22
|
"content-type": 'application/json',
|
18
23
|
}
|
@@ -26,16 +31,18 @@ module Appwrite
|
|
26
31
|
)
|
27
32
|
end
|
28
33
|
|
34
|
+
|
29
35
|
# Check the Appwrite Antivirus server is up and connection is successful.
|
30
36
|
#
|
31
37
|
#
|
32
38
|
# @return [HealthAntivirus]
|
33
39
|
def get_antivirus()
|
40
|
+
|
34
41
|
path = '/health/anti-virus'
|
35
42
|
|
36
43
|
params = {
|
37
44
|
}
|
38
|
-
|
45
|
+
|
39
46
|
headers = {
|
40
47
|
"content-type": 'application/json',
|
41
48
|
}
|
@@ -49,17 +56,19 @@ module Appwrite
|
|
49
56
|
)
|
50
57
|
end
|
51
58
|
|
59
|
+
|
52
60
|
# Check the Appwrite in-memory cache server is up and connection is
|
53
61
|
# successful.
|
54
62
|
#
|
55
63
|
#
|
56
64
|
# @return [HealthStatus]
|
57
65
|
def get_cache()
|
66
|
+
|
58
67
|
path = '/health/cache'
|
59
68
|
|
60
69
|
params = {
|
61
70
|
}
|
62
|
-
|
71
|
+
|
63
72
|
headers = {
|
64
73
|
"content-type": 'application/json',
|
65
74
|
}
|
@@ -73,16 +82,18 @@ module Appwrite
|
|
73
82
|
)
|
74
83
|
end
|
75
84
|
|
85
|
+
|
76
86
|
# Check the Appwrite database server is up and connection is successful.
|
77
87
|
#
|
78
88
|
#
|
79
89
|
# @return [HealthStatus]
|
80
90
|
def get_db()
|
91
|
+
|
81
92
|
path = '/health/db'
|
82
93
|
|
83
94
|
params = {
|
84
95
|
}
|
85
|
-
|
96
|
+
|
86
97
|
headers = {
|
87
98
|
"content-type": 'application/json',
|
88
99
|
}
|
@@ -96,6 +107,7 @@ module Appwrite
|
|
96
107
|
)
|
97
108
|
end
|
98
109
|
|
110
|
+
|
99
111
|
# Get the number of certificates that are waiting to be issued against
|
100
112
|
# [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
101
113
|
# server.
|
@@ -103,11 +115,12 @@ module Appwrite
|
|
103
115
|
#
|
104
116
|
# @return [HealthQueue]
|
105
117
|
def get_queue_certificates()
|
118
|
+
|
106
119
|
path = '/health/queue/certificates'
|
107
120
|
|
108
121
|
params = {
|
109
122
|
}
|
110
|
-
|
123
|
+
|
111
124
|
headers = {
|
112
125
|
"content-type": 'application/json',
|
113
126
|
}
|
@@ -121,16 +134,18 @@ module Appwrite
|
|
121
134
|
)
|
122
135
|
end
|
123
136
|
|
137
|
+
|
124
138
|
#
|
125
139
|
#
|
126
140
|
#
|
127
141
|
# @return [HealthQueue]
|
128
142
|
def get_queue_functions()
|
143
|
+
|
129
144
|
path = '/health/queue/functions'
|
130
145
|
|
131
146
|
params = {
|
132
147
|
}
|
133
|
-
|
148
|
+
|
134
149
|
headers = {
|
135
150
|
"content-type": 'application/json',
|
136
151
|
}
|
@@ -144,41 +159,19 @@ module Appwrite
|
|
144
159
|
)
|
145
160
|
end
|
146
161
|
|
162
|
+
|
147
163
|
# Get the number of logs that are waiting to be processed in the Appwrite
|
148
164
|
# internal queue server.
|
149
165
|
#
|
150
166
|
#
|
151
167
|
# @return [HealthQueue]
|
152
168
|
def get_queue_logs()
|
153
|
-
path = '/health/queue/logs'
|
154
|
-
|
155
|
-
params = {
|
156
|
-
}
|
157
|
-
|
158
|
-
headers = {
|
159
|
-
"content-type": 'application/json',
|
160
|
-
}
|
161
169
|
|
162
|
-
|
163
|
-
method: 'GET',
|
164
|
-
path: path,
|
165
|
-
headers: headers,
|
166
|
-
params: params,
|
167
|
-
response_type: Models::HealthQueue
|
168
|
-
)
|
169
|
-
end
|
170
|
-
|
171
|
-
# Get the number of usage stats that are waiting to be processed in the
|
172
|
-
# Appwrite internal queue server.
|
173
|
-
#
|
174
|
-
#
|
175
|
-
# @return [HealthQueue]
|
176
|
-
def get_queue_usage()
|
177
|
-
path = '/health/queue/usage'
|
170
|
+
path = '/health/queue/logs'
|
178
171
|
|
179
172
|
params = {
|
180
173
|
}
|
181
|
-
|
174
|
+
|
182
175
|
headers = {
|
183
176
|
"content-type": 'application/json',
|
184
177
|
}
|
@@ -192,17 +185,19 @@ module Appwrite
|
|
192
185
|
)
|
193
186
|
end
|
194
187
|
|
188
|
+
|
195
189
|
# Get the number of webhooks that are waiting to be processed in the Appwrite
|
196
190
|
# internal queue server.
|
197
191
|
#
|
198
192
|
#
|
199
193
|
# @return [HealthQueue]
|
200
194
|
def get_queue_webhooks()
|
195
|
+
|
201
196
|
path = '/health/queue/webhooks'
|
202
197
|
|
203
198
|
params = {
|
204
199
|
}
|
205
|
-
|
200
|
+
|
206
201
|
headers = {
|
207
202
|
"content-type": 'application/json',
|
208
203
|
}
|
@@ -216,16 +211,18 @@ module Appwrite
|
|
216
211
|
)
|
217
212
|
end
|
218
213
|
|
214
|
+
|
219
215
|
# Check the Appwrite local storage device is up and connection is successful.
|
220
216
|
#
|
221
217
|
#
|
222
218
|
# @return [HealthStatus]
|
223
219
|
def get_storage_local()
|
220
|
+
|
224
221
|
path = '/health/storage/local'
|
225
222
|
|
226
223
|
params = {
|
227
224
|
}
|
228
|
-
|
225
|
+
|
229
226
|
headers = {
|
230
227
|
"content-type": 'application/json',
|
231
228
|
}
|
@@ -239,6 +236,7 @@ module Appwrite
|
|
239
236
|
)
|
240
237
|
end
|
241
238
|
|
239
|
+
|
242
240
|
# Check the Appwrite server time is synced with Google remote NTP server. We
|
243
241
|
# use this technology to smoothly handle leap seconds with no disruptive
|
244
242
|
# events. The [Network Time
|
@@ -250,11 +248,12 @@ module Appwrite
|
|
250
248
|
#
|
251
249
|
# @return [HealthTime]
|
252
250
|
def get_time()
|
251
|
+
|
253
252
|
path = '/health/time'
|
254
253
|
|
255
254
|
params = {
|
256
255
|
}
|
257
|
-
|
256
|
+
|
258
257
|
headers = {
|
259
258
|
"content-type": 'application/json',
|
260
259
|
}
|
@@ -268,5 +267,6 @@ module Appwrite
|
|
268
267
|
)
|
269
268
|
end
|
270
269
|
|
270
|
+
|
271
271
|
end
|
272
272
|
end
|
@@ -3,6 +3,10 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Locale < Service
|
5
5
|
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
6
10
|
# Get the current user location based on IP. Returns an object with user
|
7
11
|
# country code, country name, continent name, continent code, ip address and
|
8
12
|
# suggested currency. You can use the locale header to get the data in a
|
@@ -13,11 +17,12 @@ module Appwrite
|
|
13
17
|
#
|
14
18
|
# @return [Locale]
|
15
19
|
def get()
|
20
|
+
|
16
21
|
path = '/locale'
|
17
22
|
|
18
23
|
params = {
|
19
24
|
}
|
20
|
-
|
25
|
+
|
21
26
|
headers = {
|
22
27
|
"content-type": 'application/json',
|
23
28
|
}
|
@@ -31,17 +36,19 @@ module Appwrite
|
|
31
36
|
)
|
32
37
|
end
|
33
38
|
|
39
|
+
|
34
40
|
# List of all continents. You can use the locale header to get the data in a
|
35
41
|
# supported language.
|
36
42
|
#
|
37
43
|
#
|
38
44
|
# @return [ContinentList]
|
39
45
|
def get_continents()
|
46
|
+
|
40
47
|
path = '/locale/continents'
|
41
48
|
|
42
49
|
params = {
|
43
50
|
}
|
44
|
-
|
51
|
+
|
45
52
|
headers = {
|
46
53
|
"content-type": 'application/json',
|
47
54
|
}
|
@@ -55,17 +62,19 @@ module Appwrite
|
|
55
62
|
)
|
56
63
|
end
|
57
64
|
|
65
|
+
|
58
66
|
# List of all countries. You can use the locale header to get the data in a
|
59
67
|
# supported language.
|
60
68
|
#
|
61
69
|
#
|
62
70
|
# @return [CountryList]
|
63
71
|
def get_countries()
|
72
|
+
|
64
73
|
path = '/locale/countries'
|
65
74
|
|
66
75
|
params = {
|
67
76
|
}
|
68
|
-
|
77
|
+
|
69
78
|
headers = {
|
70
79
|
"content-type": 'application/json',
|
71
80
|
}
|
@@ -79,17 +88,19 @@ module Appwrite
|
|
79
88
|
)
|
80
89
|
end
|
81
90
|
|
91
|
+
|
82
92
|
# List of all countries that are currently members of the EU. You can use the
|
83
93
|
# locale header to get the data in a supported language.
|
84
94
|
#
|
85
95
|
#
|
86
96
|
# @return [CountryList]
|
87
97
|
def get_countries_eu()
|
98
|
+
|
88
99
|
path = '/locale/countries/eu'
|
89
100
|
|
90
101
|
params = {
|
91
102
|
}
|
92
|
-
|
103
|
+
|
93
104
|
headers = {
|
94
105
|
"content-type": 'application/json',
|
95
106
|
}
|
@@ -103,17 +114,19 @@ module Appwrite
|
|
103
114
|
)
|
104
115
|
end
|
105
116
|
|
117
|
+
|
106
118
|
# List of all countries phone codes. You can use the locale header to get the
|
107
119
|
# data in a supported language.
|
108
120
|
#
|
109
121
|
#
|
110
122
|
# @return [PhoneList]
|
111
123
|
def get_countries_phones()
|
124
|
+
|
112
125
|
path = '/locale/countries/phones'
|
113
126
|
|
114
127
|
params = {
|
115
128
|
}
|
116
|
-
|
129
|
+
|
117
130
|
headers = {
|
118
131
|
"content-type": 'application/json',
|
119
132
|
}
|
@@ -127,6 +140,7 @@ module Appwrite
|
|
127
140
|
)
|
128
141
|
end
|
129
142
|
|
143
|
+
|
130
144
|
# List of all currencies, including currency symbol, name, plural, and
|
131
145
|
# decimal digits for all major and minor currencies. You can use the locale
|
132
146
|
# header to get the data in a supported language.
|
@@ -134,11 +148,12 @@ module Appwrite
|
|
134
148
|
#
|
135
149
|
# @return [CurrencyList]
|
136
150
|
def get_currencies()
|
151
|
+
|
137
152
|
path = '/locale/currencies'
|
138
153
|
|
139
154
|
params = {
|
140
155
|
}
|
141
|
-
|
156
|
+
|
142
157
|
headers = {
|
143
158
|
"content-type": 'application/json',
|
144
159
|
}
|
@@ -152,17 +167,19 @@ module Appwrite
|
|
152
167
|
)
|
153
168
|
end
|
154
169
|
|
170
|
+
|
155
171
|
# List of all languages classified by ISO 639-1 including 2-letter code, name
|
156
172
|
# in English, and name in the respective language.
|
157
173
|
#
|
158
174
|
#
|
159
175
|
# @return [LanguageList]
|
160
176
|
def get_languages()
|
177
|
+
|
161
178
|
path = '/locale/languages'
|
162
179
|
|
163
180
|
params = {
|
164
181
|
}
|
165
|
-
|
182
|
+
|
166
183
|
headers = {
|
167
184
|
"content-type": 'application/json',
|
168
185
|
}
|
@@ -176,5 +193,6 @@ module Appwrite
|
|
176
193
|
)
|
177
194
|
end
|
178
195
|
|
196
|
+
|
179
197
|
end
|
180
198
|
end
|