appwrite 7.0.0.pre.RC2 → 7.1.0
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 +2 -2
- data/lib/appwrite/models/document.rb +10 -5
- data/lib/appwrite/models/execution.rb +5 -5
- data/lib/appwrite/models/function.rb +5 -5
- data/lib/appwrite/role.rb +15 -7
- data/lib/appwrite/services/account.rb +87 -107
- data/lib/appwrite/services/avatars.rb +27 -34
- data/lib/appwrite/services/databases.rb +379 -410
- data/lib/appwrite/services/functions.rb +180 -200
- data/lib/appwrite/services/health.rb +0 -10
- data/lib/appwrite/services/locale.rb +6 -13
- data/lib/appwrite/services/storage.rb +105 -118
- data/lib/appwrite/services/teams.rb +94 -105
- data/lib/appwrite/services/users.rb +226 -251
- metadata +4 -4
@@ -18,7 +18,6 @@ module Appwrite
|
|
18
18
|
#
|
19
19
|
# @return [TeamList]
|
20
20
|
def list(queries: nil, search: nil)
|
21
|
-
|
22
21
|
path = '/teams'
|
23
22
|
|
24
23
|
params = {
|
@@ -50,9 +49,16 @@ module Appwrite
|
|
50
49
|
#
|
51
50
|
# @return [Team]
|
52
51
|
def create(team_id:, name:, roles: nil)
|
53
|
-
|
54
52
|
path = '/teams'
|
55
53
|
|
54
|
+
if team_id.nil?
|
55
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
56
|
+
end
|
57
|
+
|
58
|
+
if name.nil?
|
59
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
60
|
+
end
|
61
|
+
|
56
62
|
params = {
|
57
63
|
teamId: team_id,
|
58
64
|
name: name,
|
@@ -62,14 +68,6 @@ module Appwrite
|
|
62
68
|
headers = {
|
63
69
|
"content-type": 'application/json',
|
64
70
|
}
|
65
|
-
if team_id.nil?
|
66
|
-
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
67
|
-
end
|
68
|
-
|
69
|
-
if name.nil?
|
70
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
71
|
-
end
|
72
|
-
|
73
71
|
|
74
72
|
@client.call(
|
75
73
|
method: 'POST',
|
@@ -87,8 +85,12 @@ module Appwrite
|
|
87
85
|
#
|
88
86
|
# @return [Team]
|
89
87
|
def get(team_id:)
|
90
|
-
|
91
88
|
path = '/teams/{teamId}'
|
89
|
+
.gsub('{teamId}', team_id)
|
90
|
+
|
91
|
+
if team_id.nil?
|
92
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
93
|
+
end
|
92
94
|
|
93
95
|
params = {
|
94
96
|
}
|
@@ -96,11 +98,6 @@ module Appwrite
|
|
96
98
|
headers = {
|
97
99
|
"content-type": 'application/json',
|
98
100
|
}
|
99
|
-
if team_id.nil?
|
100
|
-
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
101
|
-
end
|
102
|
-
|
103
|
-
.gsub('{teamId}', team_id)
|
104
101
|
|
105
102
|
@client.call(
|
106
103
|
method: 'GET',
|
@@ -120,8 +117,16 @@ module Appwrite
|
|
120
117
|
#
|
121
118
|
# @return [Team]
|
122
119
|
def update(team_id:, name:)
|
123
|
-
|
124
120
|
path = '/teams/{teamId}'
|
121
|
+
.gsub('{teamId}', team_id)
|
122
|
+
|
123
|
+
if team_id.nil?
|
124
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
125
|
+
end
|
126
|
+
|
127
|
+
if name.nil?
|
128
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
129
|
+
end
|
125
130
|
|
126
131
|
params = {
|
127
132
|
name: name,
|
@@ -130,15 +135,6 @@ module Appwrite
|
|
130
135
|
headers = {
|
131
136
|
"content-type": 'application/json',
|
132
137
|
}
|
133
|
-
if team_id.nil?
|
134
|
-
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
135
|
-
end
|
136
|
-
|
137
|
-
if name.nil?
|
138
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
139
|
-
end
|
140
|
-
|
141
|
-
.gsub('{teamId}', team_id)
|
142
138
|
|
143
139
|
@client.call(
|
144
140
|
method: 'PUT',
|
@@ -157,8 +153,12 @@ module Appwrite
|
|
157
153
|
#
|
158
154
|
# @return []
|
159
155
|
def delete(team_id:)
|
160
|
-
|
161
156
|
path = '/teams/{teamId}'
|
157
|
+
.gsub('{teamId}', team_id)
|
158
|
+
|
159
|
+
if team_id.nil?
|
160
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
161
|
+
end
|
162
162
|
|
163
163
|
params = {
|
164
164
|
}
|
@@ -166,11 +166,6 @@ module Appwrite
|
|
166
166
|
headers = {
|
167
167
|
"content-type": 'application/json',
|
168
168
|
}
|
169
|
-
if team_id.nil?
|
170
|
-
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
171
|
-
end
|
172
|
-
|
173
|
-
.gsub('{teamId}', team_id)
|
174
169
|
|
175
170
|
@client.call(
|
176
171
|
method: 'DELETE',
|
@@ -189,9 +184,13 @@ module Appwrite
|
|
189
184
|
# @param [String] search Search term to filter your list results. Max length: 256 chars.
|
190
185
|
#
|
191
186
|
# @return [MembershipList]
|
192
|
-
def
|
193
|
-
|
187
|
+
def list_memberships(team_id:, queries: nil, search: nil)
|
194
188
|
path = '/teams/{teamId}/memberships'
|
189
|
+
.gsub('{teamId}', team_id)
|
190
|
+
|
191
|
+
if team_id.nil?
|
192
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
193
|
+
end
|
195
194
|
|
196
195
|
params = {
|
197
196
|
queries: queries,
|
@@ -201,11 +200,6 @@ module Appwrite
|
|
201
200
|
headers = {
|
202
201
|
"content-type": 'application/json',
|
203
202
|
}
|
204
|
-
if team_id.nil?
|
205
|
-
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
206
|
-
end
|
207
|
-
|
208
|
-
.gsub('{teamId}', team_id)
|
209
203
|
|
210
204
|
@client.call(
|
211
205
|
method: 'GET',
|
@@ -241,36 +235,35 @@ module Appwrite
|
|
241
235
|
#
|
242
236
|
# @return [Membership]
|
243
237
|
def create_membership(team_id:, email:, roles:, url:, name: nil)
|
244
|
-
|
245
238
|
path = '/teams/{teamId}/memberships'
|
239
|
+
.gsub('{teamId}', team_id)
|
246
240
|
|
247
|
-
params = {
|
248
|
-
email: email,
|
249
|
-
roles: roles,
|
250
|
-
url: url,
|
251
|
-
name: name,
|
252
|
-
}
|
253
|
-
|
254
|
-
headers = {
|
255
|
-
"content-type": 'application/json',
|
256
|
-
}
|
257
241
|
if team_id.nil?
|
258
|
-
|
242
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
259
243
|
end
|
260
244
|
|
261
245
|
if email.nil?
|
262
|
-
|
246
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
263
247
|
end
|
264
248
|
|
265
249
|
if roles.nil?
|
266
|
-
|
250
|
+
raise Appwrite::Exception.new('Missing required parameter: "roles"')
|
267
251
|
end
|
268
252
|
|
269
253
|
if url.nil?
|
270
|
-
|
254
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
271
255
|
end
|
272
256
|
|
273
|
-
|
257
|
+
params = {
|
258
|
+
email: email,
|
259
|
+
roles: roles,
|
260
|
+
url: url,
|
261
|
+
name: name,
|
262
|
+
}
|
263
|
+
|
264
|
+
headers = {
|
265
|
+
"content-type": 'application/json',
|
266
|
+
}
|
274
267
|
|
275
268
|
@client.call(
|
276
269
|
method: 'POST',
|
@@ -290,25 +283,24 @@ module Appwrite
|
|
290
283
|
#
|
291
284
|
# @return [MembershipList]
|
292
285
|
def get_membership(team_id:, membership_id:)
|
293
|
-
|
294
286
|
path = '/teams/{teamId}/memberships/{membershipId}'
|
287
|
+
.gsub('{teamId}', team_id)
|
288
|
+
.gsub('{membershipId}', membership_id)
|
295
289
|
|
296
|
-
params = {
|
297
|
-
}
|
298
|
-
|
299
|
-
headers = {
|
300
|
-
"content-type": 'application/json',
|
301
|
-
}
|
302
290
|
if team_id.nil?
|
303
|
-
|
291
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
304
292
|
end
|
305
293
|
|
306
294
|
if membership_id.nil?
|
307
|
-
|
295
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
308
296
|
end
|
309
297
|
|
310
|
-
|
311
|
-
|
298
|
+
params = {
|
299
|
+
}
|
300
|
+
|
301
|
+
headers = {
|
302
|
+
"content-type": 'application/json',
|
303
|
+
}
|
312
304
|
|
313
305
|
@client.call(
|
314
306
|
method: 'GET',
|
@@ -330,30 +322,29 @@ module Appwrite
|
|
330
322
|
#
|
331
323
|
# @return [Membership]
|
332
324
|
def update_membership_roles(team_id:, membership_id:, roles:)
|
333
|
-
|
334
325
|
path = '/teams/{teamId}/memberships/{membershipId}'
|
326
|
+
.gsub('{teamId}', team_id)
|
327
|
+
.gsub('{membershipId}', membership_id)
|
335
328
|
|
336
|
-
params = {
|
337
|
-
roles: roles,
|
338
|
-
}
|
339
|
-
|
340
|
-
headers = {
|
341
|
-
"content-type": 'application/json',
|
342
|
-
}
|
343
329
|
if team_id.nil?
|
344
|
-
|
330
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
345
331
|
end
|
346
332
|
|
347
333
|
if membership_id.nil?
|
348
|
-
|
334
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
349
335
|
end
|
350
336
|
|
351
337
|
if roles.nil?
|
352
|
-
|
338
|
+
raise Appwrite::Exception.new('Missing required parameter: "roles"')
|
353
339
|
end
|
354
340
|
|
355
|
-
|
356
|
-
|
341
|
+
params = {
|
342
|
+
roles: roles,
|
343
|
+
}
|
344
|
+
|
345
|
+
headers = {
|
346
|
+
"content-type": 'application/json',
|
347
|
+
}
|
357
348
|
|
358
349
|
@client.call(
|
359
350
|
method: 'PATCH',
|
@@ -374,25 +365,24 @@ module Appwrite
|
|
374
365
|
#
|
375
366
|
# @return []
|
376
367
|
def delete_membership(team_id:, membership_id:)
|
377
|
-
|
378
368
|
path = '/teams/{teamId}/memberships/{membershipId}'
|
369
|
+
.gsub('{teamId}', team_id)
|
370
|
+
.gsub('{membershipId}', membership_id)
|
379
371
|
|
380
|
-
params = {
|
381
|
-
}
|
382
|
-
|
383
|
-
headers = {
|
384
|
-
"content-type": 'application/json',
|
385
|
-
}
|
386
372
|
if team_id.nil?
|
387
|
-
|
373
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
388
374
|
end
|
389
375
|
|
390
376
|
if membership_id.nil?
|
391
|
-
|
377
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
392
378
|
end
|
393
379
|
|
394
|
-
|
395
|
-
|
380
|
+
params = {
|
381
|
+
}
|
382
|
+
|
383
|
+
headers = {
|
384
|
+
"content-type": 'application/json',
|
385
|
+
}
|
396
386
|
|
397
387
|
@client.call(
|
398
388
|
method: 'DELETE',
|
@@ -418,35 +408,34 @@ module Appwrite
|
|
418
408
|
#
|
419
409
|
# @return [Membership]
|
420
410
|
def update_membership_status(team_id:, membership_id:, user_id:, secret:)
|
421
|
-
|
422
411
|
path = '/teams/{teamId}/memberships/{membershipId}/status'
|
412
|
+
.gsub('{teamId}', team_id)
|
413
|
+
.gsub('{membershipId}', membership_id)
|
423
414
|
|
424
|
-
params = {
|
425
|
-
userId: user_id,
|
426
|
-
secret: secret,
|
427
|
-
}
|
428
|
-
|
429
|
-
headers = {
|
430
|
-
"content-type": 'application/json',
|
431
|
-
}
|
432
415
|
if team_id.nil?
|
433
|
-
|
416
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
434
417
|
end
|
435
418
|
|
436
419
|
if membership_id.nil?
|
437
|
-
|
420
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
438
421
|
end
|
439
422
|
|
440
423
|
if user_id.nil?
|
441
|
-
|
424
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
442
425
|
end
|
443
426
|
|
444
427
|
if secret.nil?
|
445
|
-
|
428
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
446
429
|
end
|
447
430
|
|
448
|
-
|
449
|
-
|
431
|
+
params = {
|
432
|
+
userId: user_id,
|
433
|
+
secret: secret,
|
434
|
+
}
|
435
|
+
|
436
|
+
headers = {
|
437
|
+
"content-type": 'application/json',
|
438
|
+
}
|
450
439
|
|
451
440
|
@client.call(
|
452
441
|
method: 'PATCH',
|