appwrite 4.1.0 → 5.0.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/execution.rb +5 -5
- data/lib/appwrite/models/membership.rb +15 -10
- data/lib/appwrite/services/account.rb +29 -28
- data/lib/appwrite/services/avatars.rb +36 -6
- data/lib/appwrite/services/database.rb +9 -11
- data/lib/appwrite/services/functions.rb +4 -4
- data/lib/appwrite/services/health.rb +0 -24
- data/lib/appwrite/services/storage.rb +2 -2
- data/lib/appwrite/services/teams.rb +3 -3
- data/lib/appwrite/services/users.rb +36 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ceedf8f740ccc7f74d65b4ad4d12a7ff85095fcc72da4174faacf9da2279541
|
4
|
+
data.tar.gz: 66a9db695a5704b9679f1652d0855385a2790160bbe3126fa4c6df476ebe095d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5872cf6c0b6ae680d62d9dcdea77277650cf7d98622616c8963b2bf5c1bb5420b36459d1453bc41a54fa71414255a52dc437492253d9a5dfeffbd6715a67bbd8
|
7
|
+
data.tar.gz: 35888e3e67a0511778cf2248683a298cd208057990edb6f1b40086ef4cc3efd84f9fa37d20ffc52e68de2fa3a1ed7224946d98ef9297586561e07afe2b24ea05
|
data/lib/appwrite/client.rb
CHANGED
@@ -12,8 +12,8 @@ module Appwrite
|
|
12
12
|
@chunk_size = 5*1024*1024
|
13
13
|
@headers = {
|
14
14
|
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
|
15
|
-
'x-sdk-version' => 'appwrite:ruby:
|
16
|
-
'X-Appwrite-Response-Format' => '0.
|
15
|
+
'x-sdk-version' => 'appwrite:ruby:5.0.0',
|
16
|
+
'X-Appwrite-Response-Format' => '0.14.0'
|
17
17
|
}
|
18
18
|
@endpoint = 'https://HOSTNAME/v1'
|
19
19
|
end
|
@@ -10,7 +10,7 @@ module Appwrite
|
|
10
10
|
attr_reader :trigger
|
11
11
|
attr_reader :status
|
12
12
|
attr_reader :status_code
|
13
|
-
attr_reader :
|
13
|
+
attr_reader :response
|
14
14
|
attr_reader :stderr
|
15
15
|
attr_reader :time
|
16
16
|
|
@@ -22,7 +22,7 @@ module Appwrite
|
|
22
22
|
trigger:,
|
23
23
|
status:,
|
24
24
|
status_code:,
|
25
|
-
|
25
|
+
response:,
|
26
26
|
stderr:,
|
27
27
|
time:
|
28
28
|
)
|
@@ -33,7 +33,7 @@ module Appwrite
|
|
33
33
|
@trigger = trigger
|
34
34
|
@status = status
|
35
35
|
@status_code = status_code
|
36
|
-
@
|
36
|
+
@response = response
|
37
37
|
@stderr = stderr
|
38
38
|
@time = time
|
39
39
|
end
|
@@ -47,7 +47,7 @@ module Appwrite
|
|
47
47
|
trigger: map["trigger"],
|
48
48
|
status: map["status"],
|
49
49
|
status_code: map["statusCode"],
|
50
|
-
|
50
|
+
response: map["response"],
|
51
51
|
stderr: map["stderr"],
|
52
52
|
time: map["time"]
|
53
53
|
)
|
@@ -62,7 +62,7 @@ module Appwrite
|
|
62
62
|
"trigger": @trigger,
|
63
63
|
"status": @status,
|
64
64
|
"statusCode": @status_code,
|
65
|
-
"
|
65
|
+
"response": @response,
|
66
66
|
"stderr": @stderr,
|
67
67
|
"time": @time
|
68
68
|
}
|
@@ -5,9 +5,10 @@ module Appwrite
|
|
5
5
|
class Membership
|
6
6
|
attr_reader :id
|
7
7
|
attr_reader :user_id
|
8
|
+
attr_reader :user_name
|
9
|
+
attr_reader :user_email
|
8
10
|
attr_reader :team_id
|
9
|
-
attr_reader :
|
10
|
-
attr_reader :email
|
11
|
+
attr_reader :team_name
|
11
12
|
attr_reader :invited
|
12
13
|
attr_reader :joined
|
13
14
|
attr_reader :confirm
|
@@ -16,9 +17,10 @@ module Appwrite
|
|
16
17
|
def initialize(
|
17
18
|
id:,
|
18
19
|
user_id:,
|
20
|
+
user_name:,
|
21
|
+
user_email:,
|
19
22
|
team_id:,
|
20
|
-
|
21
|
-
email:,
|
23
|
+
team_name:,
|
22
24
|
invited:,
|
23
25
|
joined:,
|
24
26
|
confirm:,
|
@@ -26,9 +28,10 @@ module Appwrite
|
|
26
28
|
)
|
27
29
|
@id = id
|
28
30
|
@user_id = user_id
|
31
|
+
@user_name = user_name
|
32
|
+
@user_email = user_email
|
29
33
|
@team_id = team_id
|
30
|
-
@
|
31
|
-
@email = email
|
34
|
+
@team_name = team_name
|
32
35
|
@invited = invited
|
33
36
|
@joined = joined
|
34
37
|
@confirm = confirm
|
@@ -39,9 +42,10 @@ module Appwrite
|
|
39
42
|
Membership.new(
|
40
43
|
id: map["$id"],
|
41
44
|
user_id: map["userId"],
|
45
|
+
user_name: map["userName"],
|
46
|
+
user_email: map["userEmail"],
|
42
47
|
team_id: map["teamId"],
|
43
|
-
|
44
|
-
email: map["email"],
|
48
|
+
team_name: map["teamName"],
|
45
49
|
invited: map["invited"],
|
46
50
|
joined: map["joined"],
|
47
51
|
confirm: map["confirm"],
|
@@ -53,9 +57,10 @@ module Appwrite
|
|
53
57
|
{
|
54
58
|
"$id": @id,
|
55
59
|
"userId": @user_id,
|
60
|
+
"userName": @user_name,
|
61
|
+
"userEmail": @user_email,
|
56
62
|
"teamId": @team_id,
|
57
|
-
"
|
58
|
-
"email": @email,
|
63
|
+
"teamName": @team_name,
|
59
64
|
"invited": @invited,
|
60
65
|
"joined": @joined,
|
61
66
|
"confirm": @confirm,
|
@@ -26,32 +26,6 @@ module Appwrite
|
|
26
26
|
)
|
27
27
|
end
|
28
28
|
|
29
|
-
# Delete a currently logged in user account. Behind the scene, the user
|
30
|
-
# record is not deleted but permanently blocked from any access. This is done
|
31
|
-
# to avoid deleted accounts being overtaken by new users with the same email
|
32
|
-
# address. Any user-related resources like documents or storage files should
|
33
|
-
# be deleted separately.
|
34
|
-
#
|
35
|
-
#
|
36
|
-
# @return []
|
37
|
-
def delete()
|
38
|
-
path = '/account'
|
39
|
-
|
40
|
-
params = {
|
41
|
-
}
|
42
|
-
|
43
|
-
headers = {
|
44
|
-
"content-type": 'application/json',
|
45
|
-
}
|
46
|
-
|
47
|
-
@client.call(
|
48
|
-
method: 'DELETE',
|
49
|
-
path: path,
|
50
|
-
headers: headers,
|
51
|
-
params: params,
|
52
|
-
)
|
53
|
-
end
|
54
|
-
|
55
29
|
# Update currently logged in user account email address. After changing user
|
56
30
|
# address, the user confirmation status will get reset. A new confirmation
|
57
31
|
# email is not sent automatically however you can use the send confirmation
|
@@ -153,7 +127,7 @@ module Appwrite
|
|
153
127
|
|
154
128
|
# Update currently logged in user password. For validation, user is required
|
155
129
|
# to pass in the new password, and the old password. For users created with
|
156
|
-
# OAuth and
|
130
|
+
# OAuth, Team Invites and Magic URL, oldPassword is optional.
|
157
131
|
#
|
158
132
|
# @param [string] password New user password. Must be at least 8 chars.
|
159
133
|
# @param [string] old_password Current user password. Must be at least 8 chars.
|
@@ -412,7 +386,9 @@ module Appwrite
|
|
412
386
|
)
|
413
387
|
end
|
414
388
|
|
415
|
-
#
|
389
|
+
# Access tokens have limited lifespan and expire to mitigate security risks.
|
390
|
+
# If session was created using an OAuth provider, this route can be used to
|
391
|
+
# "refresh" the access token.
|
416
392
|
#
|
417
393
|
# @param [string] session_id Session ID. Use the string 'current' to update the current device session.
|
418
394
|
#
|
@@ -472,6 +448,31 @@ module Appwrite
|
|
472
448
|
)
|
473
449
|
end
|
474
450
|
|
451
|
+
# Block the currently logged in user account. Behind the scene, the user
|
452
|
+
# record is not deleted but permanently blocked from any access. To
|
453
|
+
# completely delete a user, use the Users API instead.
|
454
|
+
#
|
455
|
+
#
|
456
|
+
# @return [User]
|
457
|
+
def update_status()
|
458
|
+
path = '/account/status'
|
459
|
+
|
460
|
+
params = {
|
461
|
+
}
|
462
|
+
|
463
|
+
headers = {
|
464
|
+
"content-type": 'application/json',
|
465
|
+
}
|
466
|
+
|
467
|
+
@client.call(
|
468
|
+
method: 'PATCH',
|
469
|
+
path: path,
|
470
|
+
headers: headers,
|
471
|
+
params: params,
|
472
|
+
response_type: Models::User
|
473
|
+
)
|
474
|
+
end
|
475
|
+
|
475
476
|
# Use this endpoint to send a verification message to your user email address
|
476
477
|
# to confirm they are the valid owners of that address. Both the **userId**
|
477
478
|
# and **secret** arguments will be passed as query parameters to the URL you
|
@@ -4,9 +4,14 @@ module Appwrite
|
|
4
4
|
class Avatars < Service
|
5
5
|
|
6
6
|
# You can use this endpoint to show different browser icons to your users.
|
7
|
-
# The code argument receives the browser code as it appears in your user
|
8
|
-
# /account/sessions endpoint. Use
|
9
|
-
# change the output settings.
|
7
|
+
# The code argument receives the browser code as it appears in your user [GET
|
8
|
+
# /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
|
9
|
+
# width, height and quality arguments to change the output settings.
|
10
|
+
#
|
11
|
+
# When one dimension is specified and the other is 0, the image is scaled
|
12
|
+
# with preserved aspect ratio. If both dimensions are 0, the API provides an
|
13
|
+
# image at source quality. If dimensions are not specified, the default size
|
14
|
+
# of image returned is 100x100px.
|
10
15
|
#
|
11
16
|
# @param [string] code Browser Code.
|
12
17
|
# @param [number] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
@@ -43,6 +48,12 @@ module Appwrite
|
|
43
48
|
# The credit card endpoint will return you the icon of the credit card
|
44
49
|
# provider you need. Use width, height and quality arguments to change the
|
45
50
|
# output settings.
|
51
|
+
#
|
52
|
+
# When one dimension is specified and the other is 0, the image is scaled
|
53
|
+
# with preserved aspect ratio. If both dimensions are 0, the API provides an
|
54
|
+
# image at source quality. If dimensions are not specified, the default size
|
55
|
+
# of image returned is 100x100px.
|
56
|
+
#
|
46
57
|
#
|
47
58
|
# @param [string] code Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.
|
48
59
|
# @param [number] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
@@ -109,6 +120,12 @@ module Appwrite
|
|
109
120
|
# You can use this endpoint to show different country flags icons to your
|
110
121
|
# users. The code argument receives the 2 letter country code. Use width,
|
111
122
|
# height and quality arguments to change the output settings.
|
123
|
+
#
|
124
|
+
# When one dimension is specified and the other is 0, the image is scaled
|
125
|
+
# with preserved aspect ratio. If both dimensions are 0, the API provides an
|
126
|
+
# image at source quality. If dimensions are not specified, the default size
|
127
|
+
# of image returned is 100x100px.
|
128
|
+
#
|
112
129
|
#
|
113
130
|
# @param [string] code Country Code. ISO Alpha-2 country code format.
|
114
131
|
# @param [number] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
@@ -146,10 +163,16 @@ module Appwrite
|
|
146
163
|
# you want. This endpoint is very useful if you need to crop and display
|
147
164
|
# remote images in your app or in case you want to make sure a 3rd party
|
148
165
|
# image is properly served using a TLS protocol.
|
166
|
+
#
|
167
|
+
# When one dimension is specified and the other is 0, the image is scaled
|
168
|
+
# with preserved aspect ratio. If both dimensions are 0, the API provides an
|
169
|
+
# image at source quality. If dimensions are not specified, the default size
|
170
|
+
# of image returned is 400x400px.
|
171
|
+
#
|
149
172
|
#
|
150
173
|
# @param [string] url Image URL which you want to crop.
|
151
|
-
# @param [number] width Resize preview image width, Pass an integer between 0 to 2000.
|
152
|
-
# @param [number] height Resize preview image height, Pass an integer between 0 to 2000.
|
174
|
+
# @param [number] width Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
175
|
+
# @param [number] height Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
153
176
|
#
|
154
177
|
# @return []
|
155
178
|
def get_image(url:, width: nil, height: nil)
|
@@ -187,6 +210,12 @@ module Appwrite
|
|
187
210
|
# default, a random theme will be selected. The random theme will persist for
|
188
211
|
# the user's initials when reloading the same theme will always return for
|
189
212
|
# the same initials.
|
213
|
+
#
|
214
|
+
# When one dimension is specified and the other is 0, the image is scaled
|
215
|
+
# with preserved aspect ratio. If both dimensions are 0, the API provides an
|
216
|
+
# image at source quality. If dimensions are not specified, the default size
|
217
|
+
# of image returned is 100x100px.
|
218
|
+
#
|
190
219
|
#
|
191
220
|
# @param [string] name Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
192
221
|
# @param [number] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
@@ -220,9 +249,10 @@ module Appwrite
|
|
220
249
|
|
221
250
|
# Converts a given plain text to a QR code image. You can use the query
|
222
251
|
# parameters to change the size and style of the resulting image.
|
252
|
+
#
|
223
253
|
#
|
224
254
|
# @param [string] text Plain text to be converted to QR code image.
|
225
|
-
# @param [number] size QR code size. Pass an integer between
|
255
|
+
# @param [number] size QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
226
256
|
# @param [number] margin Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
227
257
|
# @param [boolean] download Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
228
258
|
#
|
@@ -45,7 +45,7 @@ module Appwrite
|
|
45
45
|
#
|
46
46
|
# @param [string] collection_id Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
47
47
|
# @param [string] name Collection name. Max length: 128 chars.
|
48
|
-
# @param [string] permission
|
48
|
+
# @param [string] permission Specifies the permissions model used in this collection, which accepts either 'collection' or 'document'. For 'collection' level permission, the permissions specified in read and write params are applied to all documents in the collection. For 'document' level permissions, read and write permissions are specified in each document. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
49
49
|
# @param [array] read An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
50
50
|
# @param [array] write An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
51
51
|
#
|
@@ -325,7 +325,7 @@ module Appwrite
|
|
325
325
|
#
|
326
326
|
# @param [string] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
|
327
327
|
# @param [string] key Attribute Key.
|
328
|
-
# @param [array] elements Array of elements in enumerated type. Uses length of longest element to determine size.
|
328
|
+
# @param [array] elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 1024 characters long.
|
329
329
|
# @param [boolean] required Is attribute required?
|
330
330
|
# @param [string] default Default value for attribute when not provided. Cannot be set when attribute is required.
|
331
331
|
# @param [boolean] array Is attribute an array?
|
@@ -692,13 +692,13 @@ module Appwrite
|
|
692
692
|
# modes](/docs/admin).
|
693
693
|
#
|
694
694
|
# @param [string] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
|
695
|
-
# @param [array] queries Array of query strings.
|
695
|
+
# @param [array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents). Maximum of 100 queries are allowed, each 128 characters long.
|
696
696
|
# @param [number] limit Maximum number of documents to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
697
697
|
# @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
698
698
|
# @param [string] cursor ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
699
699
|
# @param [string] cursor_direction Direction of the cursor.
|
700
|
-
# @param [array] order_attributes Array of attributes used to sort results.
|
701
|
-
# @param [array] order_types Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.
|
700
|
+
# @param [array] order_attributes Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 128 characters long.
|
701
|
+
# @param [array] order_types Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.
|
702
702
|
#
|
703
703
|
# @return [DocumentList]
|
704
704
|
def list_documents(collection_id:, queries: nil, limit: nil, offset: nil, cursor: nil, cursor_direction: nil, order_attributes: nil, order_types: nil)
|
@@ -821,7 +821,7 @@ module Appwrite
|
|
821
821
|
#
|
822
822
|
# @param [string] collection_id Collection ID.
|
823
823
|
# @param [string] document_id Document ID.
|
824
|
-
# @param [object] data Document data as JSON object.
|
824
|
+
# @param [object] data Document data as JSON object. Include only attribute and value pairs to be updated.
|
825
825
|
# @param [array] read An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
826
826
|
# @param [array] write An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
827
827
|
#
|
@@ -862,9 +862,7 @@ module Appwrite
|
|
862
862
|
)
|
863
863
|
end
|
864
864
|
|
865
|
-
# Delete a document by its unique ID.
|
866
|
-
# documents, its attributes and relations to other documents. Child documents
|
867
|
-
# **will not** be deleted.
|
865
|
+
# Delete a document by its unique ID.
|
868
866
|
#
|
869
867
|
# @param [string] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
|
870
868
|
# @param [string] document_id Document ID.
|
@@ -932,8 +930,8 @@ module Appwrite
|
|
932
930
|
# @param [string] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
|
933
931
|
# @param [string] key Index Key.
|
934
932
|
# @param [string] type Index type.
|
935
|
-
# @param [array] attributes Array of attributes to index.
|
936
|
-
# @param [array] orders Array of index orders.
|
933
|
+
# @param [array] attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
934
|
+
# @param [array] orders Array of index orders. Maximum of 100 orders are allowed.
|
937
935
|
#
|
938
936
|
# @return [Index]
|
939
937
|
def create_index(collection_id:, key:, type:, attributes:, orders: nil)
|
@@ -45,10 +45,10 @@ module Appwrite
|
|
45
45
|
#
|
46
46
|
# @param [string] function_id Function ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
47
47
|
# @param [string] name Function name. Max length: 128 chars.
|
48
|
-
# @param [array] execute An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
48
|
+
# @param [array] execute An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.
|
49
49
|
# @param [string] runtime Execution runtime.
|
50
50
|
# @param [object] vars Key-value JSON object that will be passed to the function as environment variables.
|
51
|
-
# @param [array] events Events list.
|
51
|
+
# @param [array] events Events list. Maximum of 100 events are allowed.
|
52
52
|
# @param [string] schedule Schedule CRON syntax.
|
53
53
|
# @param [number] timeout Function maximum execution time in seconds.
|
54
54
|
#
|
@@ -152,9 +152,9 @@ module Appwrite
|
|
152
152
|
#
|
153
153
|
# @param [string] function_id Function ID.
|
154
154
|
# @param [string] name Function name. Max length: 128 chars.
|
155
|
-
# @param [array] execute An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.
|
155
|
+
# @param [array] execute An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions. Maximum of 100 scopes are allowed, each 64 characters long.
|
156
156
|
# @param [object] vars Key-value JSON object that will be passed to the function as environment variables.
|
157
|
-
# @param [array] events Events list.
|
157
|
+
# @param [array] events Events list. Maximum of 100 events are allowed.
|
158
158
|
# @param [string] schedule Schedule CRON syntax.
|
159
159
|
# @param [number] timeout Maximum execution time in seconds.
|
160
160
|
#
|
@@ -168,30 +168,6 @@ module Appwrite
|
|
168
168
|
)
|
169
169
|
end
|
170
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'
|
178
|
-
|
179
|
-
params = {
|
180
|
-
}
|
181
|
-
|
182
|
-
headers = {
|
183
|
-
"content-type": 'application/json',
|
184
|
-
}
|
185
|
-
|
186
|
-
@client.call(
|
187
|
-
method: 'GET',
|
188
|
-
path: path,
|
189
|
-
headers: headers,
|
190
|
-
params: params,
|
191
|
-
response_type: Models::HealthQueue
|
192
|
-
)
|
193
|
-
end
|
194
|
-
|
195
171
|
# Get the number of webhooks that are waiting to be processed in the Appwrite
|
196
172
|
# internal queue server.
|
197
173
|
#
|
@@ -48,7 +48,7 @@ module Appwrite
|
|
48
48
|
# @param [array] write An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.
|
49
49
|
# @param [boolean] enabled Is bucket enabled?
|
50
50
|
# @param [number] maximum_file_size Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the `_APP_STORAGE_LIMIT` environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)
|
51
|
-
# @param [array] allowed_file_extensions Allowed file extensions
|
51
|
+
# @param [array] allowed_file_extensions Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
52
52
|
# @param [boolean] encryption Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
53
53
|
# @param [boolean] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
54
54
|
#
|
@@ -133,7 +133,7 @@ module Appwrite
|
|
133
133
|
# @param [array] write An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.
|
134
134
|
# @param [boolean] enabled Is bucket enabled?
|
135
135
|
# @param [number] maximum_file_size Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self hosted version you can change the limit by changing _APP_STORAGE_LIMIT environment variable. [Learn more about storage environment variables](docs/environment-variables#storage)
|
136
|
-
# @param [array] allowed_file_extensions Allowed file extensions
|
136
|
+
# @param [array] allowed_file_extensions Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
|
137
137
|
# @param [boolean] encryption Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
|
138
138
|
# @param [boolean] antivirus Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
|
139
139
|
#
|
@@ -48,7 +48,7 @@ module Appwrite
|
|
48
48
|
#
|
49
49
|
# @param [string] team_id Team ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
50
50
|
# @param [string] name Team name. Max length: 128 chars.
|
51
|
-
# @param [array] roles Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions).
|
51
|
+
# @param [array] roles Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
52
52
|
#
|
53
53
|
# @return [Team]
|
54
54
|
def create(team_id:, name:, roles: nil)
|
@@ -235,7 +235,7 @@ module Appwrite
|
|
235
235
|
#
|
236
236
|
# @param [string] team_id Team ID.
|
237
237
|
# @param [string] email Email of the new team member.
|
238
|
-
# @param [array] roles Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions).
|
238
|
+
# @param [array] roles Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
239
239
|
# @param [string] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
240
240
|
# @param [string] name Name of the new team member. Max length: 128 chars.
|
241
241
|
#
|
@@ -322,7 +322,7 @@ module Appwrite
|
|
322
322
|
#
|
323
323
|
# @param [string] team_id Team ID.
|
324
324
|
# @param [string] membership_id Membership ID.
|
325
|
-
# @param [array] roles An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
325
|
+
# @param [array] roles An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
326
326
|
#
|
327
327
|
# @return [Membership]
|
328
328
|
def update_membership_roles(team_id:, membership_id:, roles:)
|
@@ -111,7 +111,11 @@ module Appwrite
|
|
111
111
|
)
|
112
112
|
end
|
113
113
|
|
114
|
-
# Delete a user by its unique ID.
|
114
|
+
# Delete a user by its unique ID, thereby releasing it's ID. Since ID is
|
115
|
+
# released and can be reused, all user-related resources like documents or
|
116
|
+
# storage files should be deleted before user deletion. If you want to keep
|
117
|
+
# ID reserved, use the [updateStatus](/docs/server/users#usersUpdateStatus)
|
118
|
+
# endpoint instead.
|
115
119
|
#
|
116
120
|
# @param [string] user_id User ID.
|
117
121
|
#
|
@@ -207,6 +211,35 @@ module Appwrite
|
|
207
211
|
)
|
208
212
|
end
|
209
213
|
|
214
|
+
# Get the user membership list by its unique ID.
|
215
|
+
#
|
216
|
+
# @param [string] user_id User ID.
|
217
|
+
#
|
218
|
+
# @return [MembershipList]
|
219
|
+
def get_memberships(user_id:)
|
220
|
+
if user_id.nil?
|
221
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
222
|
+
end
|
223
|
+
|
224
|
+
path = '/users/{userId}/memberships'
|
225
|
+
.gsub('{userId}', user_id)
|
226
|
+
|
227
|
+
params = {
|
228
|
+
}
|
229
|
+
|
230
|
+
headers = {
|
231
|
+
"content-type": 'application/json',
|
232
|
+
}
|
233
|
+
|
234
|
+
@client.call(
|
235
|
+
method: 'GET',
|
236
|
+
path: path,
|
237
|
+
headers: headers,
|
238
|
+
params: params,
|
239
|
+
response_type: Models::MembershipList
|
240
|
+
)
|
241
|
+
end
|
242
|
+
|
210
243
|
# Update the user name by its unique ID.
|
211
244
|
#
|
212
245
|
# @param [string] user_id User ID.
|
@@ -434,7 +467,8 @@ module Appwrite
|
|
434
467
|
)
|
435
468
|
end
|
436
469
|
|
437
|
-
# Update the user status by its unique ID.
|
470
|
+
# Update the user status by its unique ID. Use this endpoint as an
|
471
|
+
# alternative to deleting a user if you want to keep user's ID reserved.
|
438
472
|
#
|
439
473
|
# @param [string] user_id User ID.
|
440
474
|
# @param [boolean] status User Status. To activate the user pass `true` and to block the user pass `false`.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appwrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Appwrite Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|