appwrite 25.0.0 → 26.0.0

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +36 -6
  3. data/lib/appwrite/enums/billing_plan_group.rb +9 -0
  4. data/lib/appwrite/enums/database_status.rb +9 -0
  5. data/lib/appwrite/enums/o_auth2_oidc_prompt.rb +10 -0
  6. data/lib/appwrite/enums/o_auth_provider.rb +1 -0
  7. data/lib/appwrite/enums/organization_key_scopes.rb +4 -0
  8. data/lib/appwrite/enums/project_key_scopes.rb +9 -2
  9. data/lib/appwrite/enums/project_o_auth2_oidc_prompt.rb +10 -0
  10. data/lib/appwrite/enums/project_o_auth_provider_id.rb +1 -0
  11. data/lib/appwrite/enums/project_policy_id.rb +2 -0
  12. data/lib/appwrite/enums/project_service_id.rb +1 -0
  13. data/lib/appwrite/models/activity_event.rb +3 -73
  14. data/lib/appwrite/models/additional_resource.rb +52 -0
  15. data/lib/appwrite/models/backup_policy.rb +5 -0
  16. data/lib/appwrite/models/billing_plan.rb +379 -0
  17. data/lib/appwrite/models/billing_plan_addon.rb +32 -0
  18. data/lib/appwrite/models/billing_plan_addon_details.rb +62 -0
  19. data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +117 -0
  20. data/lib/appwrite/models/billing_plan_limits.rb +32 -0
  21. data/lib/appwrite/models/billing_plan_supported_addons.rb +37 -0
  22. data/lib/appwrite/models/block.rb +5 -0
  23. data/lib/appwrite/models/database.rb +19 -0
  24. data/lib/appwrite/models/locale.rb +58 -3
  25. data/lib/appwrite/models/membership.rb +5 -0
  26. data/lib/appwrite/models/o_auth2_appwrite.rb +42 -0
  27. data/lib/appwrite/models/o_auth2_oidc.rb +13 -3
  28. data/lib/appwrite/models/organization.rb +197 -0
  29. data/lib/appwrite/models/policy_deny_corporate_email.rb +32 -0
  30. data/lib/appwrite/models/policy_membership_privacy.rb +8 -3
  31. data/lib/appwrite/models/policy_password_strength.rb +52 -0
  32. data/lib/appwrite/models/program.rb +67 -0
  33. data/lib/appwrite/models/project.rb +93 -13
  34. data/lib/appwrite/models/usage_billing_plan.rb +77 -0
  35. data/lib/appwrite/models/user.rb +25 -0
  36. data/lib/appwrite/query.rb +13 -1
  37. data/lib/appwrite/services/account.rb +88 -2
  38. data/lib/appwrite/services/activities.rb +4 -0
  39. data/lib/appwrite/services/advisor.rb +9 -0
  40. data/lib/appwrite/services/avatars.rb +16 -0
  41. data/lib/appwrite/services/backups.rb +37 -1
  42. data/lib/appwrite/services/databases.rb +178 -0
  43. data/lib/appwrite/services/functions.rb +56 -4
  44. data/lib/appwrite/services/graphql.rb +4 -0
  45. data/lib/appwrite/services/locale.rb +16 -0
  46. data/lib/appwrite/services/messaging.rb +188 -132
  47. data/lib/appwrite/services/organization.rb +278 -3
  48. data/lib/appwrite/services/presences.rb +9 -0
  49. data/lib/appwrite/services/project.rb +417 -49
  50. data/lib/appwrite/services/proxy.rb +15 -0
  51. data/lib/appwrite/services/sites.rb +50 -1
  52. data/lib/appwrite/services/storage.rb +24 -0
  53. data/lib/appwrite/services/tables_db.rb +139 -1
  54. data/lib/appwrite/services/teams.rb +24 -0
  55. data/lib/appwrite/services/tokens.rb +9 -0
  56. data/lib/appwrite/services/users.rb +81 -1
  57. data/lib/appwrite/services/webhooks.rb +11 -0
  58. data/lib/appwrite.rb +17 -15
  59. metadata +19 -17
  60. data/lib/appwrite/enums/health_antivirus_status.rb +0 -9
  61. data/lib/appwrite/enums/health_check_status.rb +0 -8
  62. data/lib/appwrite/enums/health_queue_name.rb +0 -19
  63. data/lib/appwrite/models/health_antivirus.rb +0 -49
  64. data/lib/appwrite/models/health_certificate.rb +0 -52
  65. data/lib/appwrite/models/health_queue.rb +0 -27
  66. data/lib/appwrite/models/health_status.rb +0 -53
  67. data/lib/appwrite/models/health_status_list.rb +0 -32
  68. data/lib/appwrite/models/health_time.rb +0 -37
  69. data/lib/appwrite/models/usage_event.rb +0 -72
  70. data/lib/appwrite/models/usage_event_list.rb +0 -32
  71. data/lib/appwrite/models/usage_gauge.rb +0 -47
  72. data/lib/appwrite/models/usage_gauge_list.rb +0 -32
  73. data/lib/appwrite/services/health.rb +0 -630
  74. data/lib/appwrite/services/usage.rb +0 -86
@@ -0,0 +1,67 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Program
6
+ attr_reader :id
7
+ attr_reader :title
8
+ attr_reader :description
9
+ attr_reader :tag
10
+ attr_reader :icon
11
+ attr_reader :url
12
+ attr_reader :active
13
+ attr_reader :external
14
+ attr_reader :billing_plan_id
15
+
16
+ def initialize(
17
+ id:,
18
+ title:,
19
+ description:,
20
+ tag:,
21
+ icon:,
22
+ url:,
23
+ active:,
24
+ external:,
25
+ billing_plan_id:
26
+ )
27
+ @id = id
28
+ @title = title
29
+ @description = description
30
+ @tag = tag
31
+ @icon = icon
32
+ @url = url
33
+ @active = active
34
+ @external = external
35
+ @billing_plan_id = billing_plan_id
36
+ end
37
+
38
+ def self.from(map:)
39
+ Program.new(
40
+ id: map["$id"],
41
+ title: map["title"],
42
+ description: map["description"],
43
+ tag: map["tag"],
44
+ icon: map["icon"],
45
+ url: map["url"],
46
+ active: map["active"],
47
+ external: map["external"],
48
+ billing_plan_id: map["billingPlanId"]
49
+ )
50
+ end
51
+
52
+ def to_map
53
+ {
54
+ "$id": @id,
55
+ "title": @title,
56
+ "description": @description,
57
+ "tag": @tag,
58
+ "icon": @icon,
59
+ "url": @url,
60
+ "active": @active,
61
+ "external": @external,
62
+ "billingPlanId": @billing_plan_id
63
+ }
64
+ end
65
+ end
66
+ end
67
+ end
@@ -8,6 +8,7 @@ module Appwrite
8
8
  attr_reader :updated_at
9
9
  attr_reader :name
10
10
  attr_reader :team_id
11
+ attr_reader :region
11
12
  attr_reader :dev_keys
12
13
  attr_reader :smtp_enabled
13
14
  attr_reader :smtp_sender_name
@@ -23,13 +24,28 @@ module Appwrite
23
24
  attr_reader :pinged_at
24
25
  attr_reader :labels
25
26
  attr_reader :status
27
+ attr_reader :onboarding
26
28
  attr_reader :auth_methods
27
29
  attr_reader :services
28
30
  attr_reader :protocols
29
- attr_reader :region
30
- attr_reader :billing_limits
31
31
  attr_reader :blocks
32
32
  attr_reader :console_accessed_at
33
+ attr_reader :billing_limits
34
+ attr_reader :o_auth2_server_enabled
35
+ attr_reader :o_auth2_server_authorization_url
36
+ attr_reader :o_auth2_server_scopes
37
+ attr_reader :o_auth2_server_default_scopes
38
+ attr_reader :o_auth2_server_authorization_details_types
39
+ attr_reader :o_auth2_server_access_token_duration
40
+ attr_reader :o_auth2_server_refresh_token_duration
41
+ attr_reader :o_auth2_server_public_access_token_duration
42
+ attr_reader :o_auth2_server_public_refresh_token_duration
43
+ attr_reader :o_auth2_server_confidential_pkce
44
+ attr_reader :o_auth2_server_verification_url
45
+ attr_reader :o_auth2_server_user_code_length
46
+ attr_reader :o_auth2_server_user_code_format
47
+ attr_reader :o_auth2_server_device_code_duration
48
+ attr_reader :o_auth2_server_discovery_url
33
49
 
34
50
  def initialize(
35
51
  id:,
@@ -37,6 +53,7 @@ module Appwrite
37
53
  updated_at:,
38
54
  name:,
39
55
  team_id:,
56
+ region:,
40
57
  dev_keys:,
41
58
  smtp_enabled:,
42
59
  smtp_sender_name:,
@@ -52,19 +69,35 @@ module Appwrite
52
69
  pinged_at:,
53
70
  labels:,
54
71
  status:,
72
+ onboarding:,
55
73
  auth_methods:,
56
74
  services:,
57
75
  protocols:,
58
- region:,
59
- billing_limits: ,
60
76
  blocks:,
61
- console_accessed_at:
77
+ console_accessed_at:,
78
+ billing_limits: ,
79
+ o_auth2_server_enabled: ,
80
+ o_auth2_server_authorization_url: ,
81
+ o_auth2_server_scopes: ,
82
+ o_auth2_server_default_scopes: ,
83
+ o_auth2_server_authorization_details_types: ,
84
+ o_auth2_server_access_token_duration: ,
85
+ o_auth2_server_refresh_token_duration: ,
86
+ o_auth2_server_public_access_token_duration: ,
87
+ o_auth2_server_public_refresh_token_duration: ,
88
+ o_auth2_server_confidential_pkce: ,
89
+ o_auth2_server_verification_url: ,
90
+ o_auth2_server_user_code_length: ,
91
+ o_auth2_server_user_code_format: ,
92
+ o_auth2_server_device_code_duration: ,
93
+ o_auth2_server_discovery_url:
62
94
  )
63
95
  @id = id
64
96
  @created_at = created_at
65
97
  @updated_at = updated_at
66
98
  @name = name
67
99
  @team_id = team_id
100
+ @region = region
68
101
  @dev_keys = dev_keys
69
102
  @smtp_enabled = smtp_enabled
70
103
  @smtp_sender_name = smtp_sender_name
@@ -80,13 +113,28 @@ module Appwrite
80
113
  @pinged_at = pinged_at
81
114
  @labels = labels
82
115
  @status = status
116
+ @onboarding = onboarding
83
117
  @auth_methods = auth_methods
84
118
  @services = services
85
119
  @protocols = protocols
86
- @region = region
87
- @billing_limits = billing_limits
88
120
  @blocks = blocks
89
121
  @console_accessed_at = console_accessed_at
122
+ @billing_limits = billing_limits
123
+ @o_auth2_server_enabled = o_auth2_server_enabled
124
+ @o_auth2_server_authorization_url = o_auth2_server_authorization_url
125
+ @o_auth2_server_scopes = o_auth2_server_scopes
126
+ @o_auth2_server_default_scopes = o_auth2_server_default_scopes
127
+ @o_auth2_server_authorization_details_types = o_auth2_server_authorization_details_types
128
+ @o_auth2_server_access_token_duration = o_auth2_server_access_token_duration
129
+ @o_auth2_server_refresh_token_duration = o_auth2_server_refresh_token_duration
130
+ @o_auth2_server_public_access_token_duration = o_auth2_server_public_access_token_duration
131
+ @o_auth2_server_public_refresh_token_duration = o_auth2_server_public_refresh_token_duration
132
+ @o_auth2_server_confidential_pkce = o_auth2_server_confidential_pkce
133
+ @o_auth2_server_verification_url = o_auth2_server_verification_url
134
+ @o_auth2_server_user_code_length = o_auth2_server_user_code_length
135
+ @o_auth2_server_user_code_format = o_auth2_server_user_code_format
136
+ @o_auth2_server_device_code_duration = o_auth2_server_device_code_duration
137
+ @o_auth2_server_discovery_url = o_auth2_server_discovery_url
90
138
  end
91
139
 
92
140
  def self.from(map:)
@@ -96,6 +144,7 @@ module Appwrite
96
144
  updated_at: map["$updatedAt"],
97
145
  name: map["name"],
98
146
  team_id: map["teamId"],
147
+ region: map["region"],
99
148
  dev_keys: map["devKeys"].map { |it| DevKey.from(map: it) },
100
149
  smtp_enabled: map["smtpEnabled"],
101
150
  smtp_sender_name: map["smtpSenderName"],
@@ -111,13 +160,28 @@ module Appwrite
111
160
  pinged_at: map["pingedAt"],
112
161
  labels: map["labels"],
113
162
  status: map["status"],
163
+ onboarding: map["onboarding"],
114
164
  auth_methods: map["authMethods"].map { |it| ProjectAuthMethod.from(map: it) },
115
165
  services: map["services"].map { |it| ProjectService.from(map: it) },
116
166
  protocols: map["protocols"].map { |it| ProjectProtocol.from(map: it) },
117
- region: map["region"],
118
- billing_limits: BillingLimits.from(map: map["billingLimits"]),
119
167
  blocks: map["blocks"].map { |it| Block.from(map: it) },
120
- console_accessed_at: map["consoleAccessedAt"]
168
+ console_accessed_at: map["consoleAccessedAt"],
169
+ billing_limits: map["billingLimits"].nil? ? nil : BillingLimits.from(map: map["billingLimits"]),
170
+ o_auth2_server_enabled: map["oAuth2ServerEnabled"],
171
+ o_auth2_server_authorization_url: map["oAuth2ServerAuthorizationUrl"],
172
+ o_auth2_server_scopes: map["oAuth2ServerScopes"],
173
+ o_auth2_server_default_scopes: map["oAuth2ServerDefaultScopes"],
174
+ o_auth2_server_authorization_details_types: map["oAuth2ServerAuthorizationDetailsTypes"],
175
+ o_auth2_server_access_token_duration: map["oAuth2ServerAccessTokenDuration"],
176
+ o_auth2_server_refresh_token_duration: map["oAuth2ServerRefreshTokenDuration"],
177
+ o_auth2_server_public_access_token_duration: map["oAuth2ServerPublicAccessTokenDuration"],
178
+ o_auth2_server_public_refresh_token_duration: map["oAuth2ServerPublicRefreshTokenDuration"],
179
+ o_auth2_server_confidential_pkce: map["oAuth2ServerConfidentialPkce"],
180
+ o_auth2_server_verification_url: map["oAuth2ServerVerificationUrl"],
181
+ o_auth2_server_user_code_length: map["oAuth2ServerUserCodeLength"],
182
+ o_auth2_server_user_code_format: map["oAuth2ServerUserCodeFormat"],
183
+ o_auth2_server_device_code_duration: map["oAuth2ServerDeviceCodeDuration"],
184
+ o_auth2_server_discovery_url: map["oAuth2ServerDiscoveryUrl"]
121
185
  )
122
186
  end
123
187
 
@@ -128,6 +192,7 @@ module Appwrite
128
192
  "$updatedAt": @updated_at,
129
193
  "name": @name,
130
194
  "teamId": @team_id,
195
+ "region": @region,
131
196
  "devKeys": @dev_keys.map { |it| it.to_map },
132
197
  "smtpEnabled": @smtp_enabled,
133
198
  "smtpSenderName": @smtp_sender_name,
@@ -143,13 +208,28 @@ module Appwrite
143
208
  "pingedAt": @pinged_at,
144
209
  "labels": @labels,
145
210
  "status": @status,
211
+ "onboarding": @onboarding,
146
212
  "authMethods": @auth_methods.map { |it| it.to_map },
147
213
  "services": @services.map { |it| it.to_map },
148
214
  "protocols": @protocols.map { |it| it.to_map },
149
- "region": @region,
150
- "billingLimits": @billing_limits.to_map,
151
215
  "blocks": @blocks.map { |it| it.to_map },
152
- "consoleAccessedAt": @console_accessed_at
216
+ "consoleAccessedAt": @console_accessed_at,
217
+ "billingLimits": @billing_limits&.to_map,
218
+ "oAuth2ServerEnabled": @o_auth2_server_enabled,
219
+ "oAuth2ServerAuthorizationUrl": @o_auth2_server_authorization_url,
220
+ "oAuth2ServerScopes": @o_auth2_server_scopes,
221
+ "oAuth2ServerDefaultScopes": @o_auth2_server_default_scopes,
222
+ "oAuth2ServerAuthorizationDetailsTypes": @o_auth2_server_authorization_details_types,
223
+ "oAuth2ServerAccessTokenDuration": @o_auth2_server_access_token_duration,
224
+ "oAuth2ServerRefreshTokenDuration": @o_auth2_server_refresh_token_duration,
225
+ "oAuth2ServerPublicAccessTokenDuration": @o_auth2_server_public_access_token_duration,
226
+ "oAuth2ServerPublicRefreshTokenDuration": @o_auth2_server_public_refresh_token_duration,
227
+ "oAuth2ServerConfidentialPkce": @o_auth2_server_confidential_pkce,
228
+ "oAuth2ServerVerificationUrl": @o_auth2_server_verification_url,
229
+ "oAuth2ServerUserCodeLength": @o_auth2_server_user_code_length,
230
+ "oAuth2ServerUserCodeFormat": @o_auth2_server_user_code_format,
231
+ "oAuth2ServerDeviceCodeDuration": @o_auth2_server_device_code_duration,
232
+ "oAuth2ServerDiscoveryUrl": @o_auth2_server_discovery_url
153
233
  }
154
234
  end
155
235
  end
@@ -0,0 +1,77 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class UsageBillingPlan
6
+ attr_reader :bandwidth
7
+ attr_reader :executions
8
+ attr_reader :member
9
+ attr_reader :realtime
10
+ attr_reader :realtime_messages
11
+ attr_reader :realtime_bandwidth
12
+ attr_reader :storage
13
+ attr_reader :users
14
+ attr_reader :gb_hours
15
+ attr_reader :image_transformations
16
+ attr_reader :credits
17
+
18
+ def initialize(
19
+ bandwidth:,
20
+ executions:,
21
+ member:,
22
+ realtime:,
23
+ realtime_messages:,
24
+ realtime_bandwidth:,
25
+ storage:,
26
+ users:,
27
+ gb_hours:,
28
+ image_transformations:,
29
+ credits:
30
+ )
31
+ @bandwidth = bandwidth
32
+ @executions = executions
33
+ @member = member
34
+ @realtime = realtime
35
+ @realtime_messages = realtime_messages
36
+ @realtime_bandwidth = realtime_bandwidth
37
+ @storage = storage
38
+ @users = users
39
+ @gb_hours = gb_hours
40
+ @image_transformations = image_transformations
41
+ @credits = credits
42
+ end
43
+
44
+ def self.from(map:)
45
+ UsageBillingPlan.new(
46
+ bandwidth: AdditionalResource.from(map: map["bandwidth"]),
47
+ executions: AdditionalResource.from(map: map["executions"]),
48
+ member: AdditionalResource.from(map: map["member"]),
49
+ realtime: AdditionalResource.from(map: map["realtime"]),
50
+ realtime_messages: AdditionalResource.from(map: map["realtimeMessages"]),
51
+ realtime_bandwidth: AdditionalResource.from(map: map["realtimeBandwidth"]),
52
+ storage: AdditionalResource.from(map: map["storage"]),
53
+ users: AdditionalResource.from(map: map["users"]),
54
+ gb_hours: AdditionalResource.from(map: map["GBHours"]),
55
+ image_transformations: AdditionalResource.from(map: map["imageTransformations"]),
56
+ credits: AdditionalResource.from(map: map["credits"])
57
+ )
58
+ end
59
+
60
+ def to_map
61
+ {
62
+ "bandwidth": @bandwidth.to_map,
63
+ "executions": @executions.to_map,
64
+ "member": @member.to_map,
65
+ "realtime": @realtime.to_map,
66
+ "realtimeMessages": @realtime_messages.to_map,
67
+ "realtimeBandwidth": @realtime_bandwidth.to_map,
68
+ "storage": @storage.to_map,
69
+ "users": @users.to_map,
70
+ "GBHours": @gb_hours.to_map,
71
+ "imageTransformations": @image_transformations.to_map,
72
+ "credits": @credits.to_map
73
+ }
74
+ end
75
+ end
76
+ end
77
+ end
@@ -17,6 +17,11 @@ module Appwrite
17
17
  attr_reader :email
18
18
  attr_reader :phone
19
19
  attr_reader :email_verification
20
+ attr_reader :email_canonical
21
+ attr_reader :email_is_free
22
+ attr_reader :email_is_disposable
23
+ attr_reader :email_is_corporate
24
+ attr_reader :email_is_canonical
20
25
  attr_reader :phone_verification
21
26
  attr_reader :mfa
22
27
  attr_reader :prefs
@@ -40,6 +45,11 @@ module Appwrite
40
45
  email:,
41
46
  phone:,
42
47
  email_verification:,
48
+ email_canonical: ,
49
+ email_is_free: ,
50
+ email_is_disposable: ,
51
+ email_is_corporate: ,
52
+ email_is_canonical: ,
43
53
  phone_verification:,
44
54
  mfa:,
45
55
  prefs:,
@@ -62,6 +72,11 @@ module Appwrite
62
72
  @email = email
63
73
  @phone = phone
64
74
  @email_verification = email_verification
75
+ @email_canonical = email_canonical
76
+ @email_is_free = email_is_free
77
+ @email_is_disposable = email_is_disposable
78
+ @email_is_corporate = email_is_corporate
79
+ @email_is_canonical = email_is_canonical
65
80
  @phone_verification = phone_verification
66
81
  @mfa = mfa
67
82
  @prefs = prefs
@@ -87,6 +102,11 @@ module Appwrite
87
102
  email: map["email"],
88
103
  phone: map["phone"],
89
104
  email_verification: map["emailVerification"],
105
+ email_canonical: map["emailCanonical"],
106
+ email_is_free: map["emailIsFree"],
107
+ email_is_disposable: map["emailIsDisposable"],
108
+ email_is_corporate: map["emailIsCorporate"],
109
+ email_is_canonical: map["emailIsCanonical"],
90
110
  phone_verification: map["phoneVerification"],
91
111
  mfa: map["mfa"],
92
112
  prefs: Preferences.from(map: map["prefs"]),
@@ -113,6 +133,11 @@ module Appwrite
113
133
  "email": @email,
114
134
  "phone": @phone,
115
135
  "emailVerification": @email_verification,
136
+ "emailCanonical": @email_canonical,
137
+ "emailIsFree": @email_is_free,
138
+ "emailIsDisposable": @email_is_disposable,
139
+ "emailIsCorporate": @email_is_corporate,
140
+ "emailIsCanonical": @email_is_canonical,
116
141
  "phoneVerification": @phone_verification,
117
142
  "mfa": @mfa,
118
143
  "prefs": @prefs.to_map,
@@ -232,6 +232,18 @@ module Appwrite
232
232
  return Query.new("distanceLessThan", attribute, [[values, distance, meters]]).to_s
233
233
  end
234
234
 
235
+ def vector_dot(attribute, vector)
236
+ return Query.new("vectorDot", attribute, [vector]).to_s
237
+ end
238
+
239
+ def vector_cosine(attribute, vector)
240
+ return Query.new("vectorCosine", attribute, [vector]).to_s
241
+ end
242
+
243
+ def vector_euclidean(attribute, vector)
244
+ return Query.new("vectorEuclidean", attribute, [vector]).to_s
245
+ end
246
+
235
247
  def intersects(attribute, values)
236
248
  return Query.new("intersects", attribute, [values]).to_s
237
249
  end
@@ -265,4 +277,4 @@ module Appwrite
265
277
  end
266
278
  end
267
279
  end
268
- end
280
+ end