appwrite 6.0.0 → 7.0.0.pre.RC1

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