appwrite 8.0.0 → 9.0.1
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.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +4 -4
- data/lib/appwrite/models/attribute_boolean.rb +5 -0
- data/lib/appwrite/models/attribute_datetime.rb +5 -0
- data/lib/appwrite/models/attribute_email.rb +5 -0
- data/lib/appwrite/models/attribute_enum.rb +5 -0
- data/lib/appwrite/models/attribute_float.rb +5 -0
- data/lib/appwrite/models/attribute_integer.rb +5 -0
- data/lib/appwrite/models/attribute_ip.rb +5 -0
- data/lib/appwrite/models/attribute_relationship.rb +5 -0
- data/lib/appwrite/models/attribute_string.rb +5 -0
- data/lib/appwrite/models/attribute_url.rb +5 -0
- data/lib/appwrite/models/database.rb +8 -3
- data/lib/appwrite/models/deployment.rb +63 -13
- data/lib/appwrite/models/execution.rb +40 -20
- data/lib/appwrite/models/function.rb +53 -13
- data/lib/appwrite/models/headers.rb +32 -0
- data/lib/appwrite/models/health_status.rb +5 -0
- data/lib/appwrite/models/identity.rb +72 -0
- data/lib/appwrite/models/identity_list.rb +32 -0
- data/lib/appwrite/models/index.rb +5 -0
- data/lib/appwrite/models/locale_code.rb +32 -0
- data/lib/appwrite/models/locale_code_list.rb +32 -0
- data/lib/appwrite/models/user.rb +13 -3
- data/lib/appwrite/models/variable.rb +10 -5
- data/lib/appwrite/role.rb +56 -0
- data/lib/appwrite/services/account.rb +185 -130
- data/lib/appwrite/services/avatars.rb +42 -42
- data/lib/appwrite/services/databases.rb +274 -262
- data/lib/appwrite/services/functions.rb +229 -143
- data/lib/appwrite/services/graphql.rb +12 -12
- data/lib/appwrite/services/health.rb +111 -62
- data/lib/appwrite/services/locale.rb +67 -42
- data/lib/appwrite/services/storage.rb +85 -83
- data/lib/appwrite/services/teams.rb +80 -79
- data/lib/appwrite/services/users.rb +248 -150
- data/lib/appwrite.rb +5 -0
- metadata +7 -2
data/lib/appwrite/role.rb
CHANGED
@@ -1,9 +1,26 @@
|
|
1
1
|
module Appwrite
|
2
|
+
|
3
|
+
# Helper class to generate role strings for `Permission`.
|
2
4
|
class Role
|
5
|
+
|
6
|
+
# Grants access to anyone.
|
7
|
+
#
|
8
|
+
# This includes authenticated and unauthenticated users.
|
9
|
+
#
|
10
|
+
# @return [String]
|
3
11
|
def self.any
|
4
12
|
'any'
|
5
13
|
end
|
6
14
|
|
15
|
+
# Grants access to a specific user by user ID.
|
16
|
+
#
|
17
|
+
# You can optionally pass verified or unverified for
|
18
|
+
# `status` to target specific types of users.
|
19
|
+
#
|
20
|
+
# @param [String] id
|
21
|
+
# @param [String] status
|
22
|
+
#
|
23
|
+
# @return [String]
|
7
24
|
def self.user(id, status = "")
|
8
25
|
if(status.empty?)
|
9
26
|
"user:#{id}"
|
@@ -12,6 +29,14 @@ module Appwrite
|
|
12
29
|
end
|
13
30
|
end
|
14
31
|
|
32
|
+
# Grants access to any authenticated or anonymous user.
|
33
|
+
#
|
34
|
+
# You can optionally pass verified or unverified for
|
35
|
+
# `status` to target specific types of users.
|
36
|
+
#
|
37
|
+
# @param [String] status
|
38
|
+
#
|
39
|
+
# @return [String]
|
15
40
|
def self.users(status = "")
|
16
41
|
if(status.empty?)
|
17
42
|
'users'
|
@@ -20,10 +45,24 @@ module Appwrite
|
|
20
45
|
end
|
21
46
|
end
|
22
47
|
|
48
|
+
# Grants access to any guest user without a session.
|
49
|
+
#
|
50
|
+
# Authenticated users don't have access to this role.
|
51
|
+
#
|
52
|
+
# @return [String]
|
23
53
|
def self.guests
|
24
54
|
'guests'
|
25
55
|
end
|
26
56
|
|
57
|
+
# Grants access to a team by team ID.
|
58
|
+
#
|
59
|
+
# You can optionally pass a role for `role` to target
|
60
|
+
# team members with the specified role.
|
61
|
+
#
|
62
|
+
# @param [String] id
|
63
|
+
# @param [String] role
|
64
|
+
#
|
65
|
+
# @return [String]
|
27
66
|
def self.team(id, role = "")
|
28
67
|
if(role.empty?)
|
29
68
|
"team:#{id}"
|
@@ -32,8 +71,25 @@ module Appwrite
|
|
32
71
|
end
|
33
72
|
end
|
34
73
|
|
74
|
+
# Grants access to a specific member of a team.
|
75
|
+
#
|
76
|
+
# When the member is removed from the team, they will
|
77
|
+
# no longer have access.
|
78
|
+
#
|
79
|
+
# @param [String] id
|
80
|
+
#
|
81
|
+
# @return [String]
|
35
82
|
def self.member(id)
|
36
83
|
"member:#{id}"
|
37
84
|
end
|
85
|
+
|
86
|
+
# Grants access to a user with the specified label.
|
87
|
+
#
|
88
|
+
# @param [String] name
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def self.label(name)
|
92
|
+
"label:#{name}"
|
93
|
+
end
|
38
94
|
end
|
39
95
|
end
|