appwrite 5.0.0 → 7.0.0.pre.RC2

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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +32 -11
  3. data/lib/appwrite/id.rb +11 -0
  4. data/lib/appwrite/input_file.rb +33 -0
  5. data/lib/appwrite/models/account.rb +82 -0
  6. data/lib/appwrite/models/algo_argon2.rb +37 -0
  7. data/lib/appwrite/models/algo_bcrypt.rb +22 -0
  8. data/lib/appwrite/models/algo_md5.rb +22 -0
  9. data/lib/appwrite/models/algo_phpass.rb +22 -0
  10. data/lib/appwrite/models/algo_scrypt.rb +42 -0
  11. data/lib/appwrite/models/algo_scrypt_modified.rb +37 -0
  12. data/lib/appwrite/models/algo_sha.rb +22 -0
  13. data/lib/appwrite/models/attribute_datetime.rb +57 -0
  14. data/lib/appwrite/models/bucket.rb +25 -25
  15. data/lib/appwrite/models/collection.rb +25 -15
  16. data/lib/appwrite/models/database.rb +42 -0
  17. data/lib/appwrite/models/database_list.rb +32 -0
  18. data/lib/appwrite/models/deployment.rb +10 -5
  19. data/lib/appwrite/models/document.rb +15 -10
  20. data/lib/appwrite/models/execution.rb +20 -10
  21. data/lib/appwrite/models/file.rb +15 -15
  22. data/lib/appwrite/models/function.rb +12 -12
  23. data/lib/appwrite/models/index.rb +1 -1
  24. data/lib/appwrite/models/membership.rb +10 -0
  25. data/lib/appwrite/models/session.rb +5 -0
  26. data/lib/appwrite/models/team.rb +10 -5
  27. data/lib/appwrite/models/token.rb +5 -0
  28. data/lib/appwrite/models/user.rb +35 -0
  29. data/lib/appwrite/models/variable.rb +52 -0
  30. data/lib/appwrite/models/variable_list.rb +32 -0
  31. data/lib/appwrite/permission.rb +21 -0
  32. data/lib/appwrite/query.rb +43 -14
  33. data/lib/appwrite/role.rb +31 -0
  34. data/lib/appwrite/services/account.rb +250 -103
  35. data/lib/appwrite/services/avatars.rb +73 -56
  36. data/lib/appwrite/services/databases.rb +1425 -0
  37. data/lib/appwrite/services/functions.rb +381 -176
  38. data/lib/appwrite/services/health.rb +34 -10
  39. data/lib/appwrite/services/locale.rb +25 -7
  40. data/lib/appwrite/services/storage.rb +195 -193
  41. data/lib/appwrite/services/teams.rb +138 -128
  42. data/lib/appwrite/services/users.rb +610 -130
  43. data/lib/appwrite.rb +19 -2
  44. metadata +22 -6
  45. data/lib/appwrite/file.rb +0 -17
  46. data/lib/appwrite/services/database.rb +0 -1047
@@ -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,17 +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()
169
+
153
170
  path = '/health/queue/logs'
154
171
 
155
172
  params = {
156
173
  }
157
-
174
+
158
175
  headers = {
159
176
  "content-type": 'application/json',
160
177
  }
@@ -168,17 +185,19 @@ module Appwrite
168
185
  )
169
186
  end
170
187
 
188
+
171
189
  # Get the number of webhooks that are waiting to be processed in the Appwrite
172
190
  # internal queue server.
173
191
  #
174
192
  #
175
193
  # @return [HealthQueue]
176
194
  def get_queue_webhooks()
195
+
177
196
  path = '/health/queue/webhooks'
178
197
 
179
198
  params = {
180
199
  }
181
-
200
+
182
201
  headers = {
183
202
  "content-type": 'application/json',
184
203
  }
@@ -192,16 +211,18 @@ module Appwrite
192
211
  )
193
212
  end
194
213
 
214
+
195
215
  # Check the Appwrite local storage device is up and connection is successful.
196
216
  #
197
217
  #
198
218
  # @return [HealthStatus]
199
219
  def get_storage_local()
220
+
200
221
  path = '/health/storage/local'
201
222
 
202
223
  params = {
203
224
  }
204
-
225
+
205
226
  headers = {
206
227
  "content-type": 'application/json',
207
228
  }
@@ -215,6 +236,7 @@ module Appwrite
215
236
  )
216
237
  end
217
238
 
239
+
218
240
  # Check the Appwrite server time is synced with Google remote NTP server. We
219
241
  # use this technology to smoothly handle leap seconds with no disruptive
220
242
  # events. The [Network Time
@@ -226,11 +248,12 @@ module Appwrite
226
248
  #
227
249
  # @return [HealthTime]
228
250
  def get_time()
251
+
229
252
  path = '/health/time'
230
253
 
231
254
  params = {
232
255
  }
233
-
256
+
234
257
  headers = {
235
258
  "content-type": 'application/json',
236
259
  }
@@ -244,5 +267,6 @@ module Appwrite
244
267
  )
245
268
  end
246
269
 
270
+
247
271
  end
248
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