appwrite 26.0.0 → 27.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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +16 -2
  3. data/lib/appwrite/enums/authentication_factor.rb +1 -0
  4. data/lib/appwrite/enums/build_runtime.rb +1 -0
  5. data/lib/appwrite/enums/database_status.rb +11 -0
  6. data/lib/appwrite/enums/database_type.rb +3 -0
  7. data/lib/appwrite/enums/embedding_model.rb +10 -0
  8. data/lib/appwrite/enums/invalidation_type.rb +9 -0
  9. data/lib/appwrite/enums/organization_key_scopes.rb +2 -0
  10. data/lib/appwrite/enums/project_key_scopes.rb +5 -0
  11. data/lib/appwrite/enums/project_policy_id.rb +1 -0
  12. data/lib/appwrite/enums/runtime.rb +1 -0
  13. data/lib/appwrite/models/activity_event.rb +58 -3
  14. data/lib/appwrite/models/app.rb +152 -0
  15. data/lib/appwrite/models/app_installation.rb +72 -0
  16. data/lib/appwrite/models/app_installation_list.rb +32 -0
  17. data/lib/appwrite/models/app_key.rb +67 -0
  18. data/lib/appwrite/models/app_key_list.rb +32 -0
  19. data/lib/appwrite/models/app_scope.rb +47 -0
  20. data/lib/appwrite/models/app_scope_list.rb +32 -0
  21. data/lib/appwrite/models/app_secret.rb +67 -0
  22. data/lib/appwrite/models/app_secret_list.rb +32 -0
  23. data/lib/appwrite/models/app_secret_plaintext.rb +67 -0
  24. data/lib/appwrite/models/apps_list.rb +32 -0
  25. data/lib/appwrite/models/billing_plan.rb +9 -4
  26. data/lib/appwrite/models/billing_plan_addon.rb +6 -6
  27. data/lib/appwrite/models/billing_plan_addon_details.rb +1 -1
  28. data/lib/appwrite/models/database.rb +35 -6
  29. data/lib/appwrite/models/database_migration.rb +102 -0
  30. data/lib/appwrite/models/database_migration_list.rb +32 -0
  31. data/lib/appwrite/models/database_status.rb +92 -0
  32. data/lib/appwrite/models/database_status_connections.rb +32 -0
  33. data/lib/appwrite/models/database_status_replica.rb +42 -0
  34. data/lib/appwrite/models/database_status_volume.rb +42 -0
  35. data/lib/appwrite/models/dedicated_database.rb +262 -0
  36. data/lib/appwrite/models/dedicated_database_member.rb +42 -0
  37. data/lib/appwrite/models/dedicated_database_operation.rb +77 -0
  38. data/lib/appwrite/models/dedicated_database_operation_list.rb +32 -0
  39. data/lib/appwrite/models/dedicated_database_replicas.rb +62 -0
  40. data/lib/appwrite/models/dedicated_database_specification.rb +67 -0
  41. data/lib/appwrite/models/dedicated_database_specification_list.rb +37 -0
  42. data/lib/appwrite/models/dedicated_database_specification_pricing.rb +42 -0
  43. data/lib/appwrite/models/embedding.rb +42 -0
  44. data/lib/appwrite/models/embedding_list.rb +32 -0
  45. data/lib/appwrite/models/file.rb +10 -0
  46. data/lib/appwrite/models/mfa_challenge_secret.rb +47 -0
  47. data/lib/appwrite/models/mfa_factors.rb +8 -3
  48. data/lib/appwrite/models/oauth2_approve.rb +27 -0
  49. data/lib/appwrite/models/oauth2_authorize.rb +32 -0
  50. data/lib/appwrite/models/oauth2_consent.rb +72 -0
  51. data/lib/appwrite/models/oauth2_consent_list.rb +32 -0
  52. data/lib/appwrite/models/oauth2_consent_token.rb +77 -0
  53. data/lib/appwrite/models/oauth2_consent_token_list.rb +32 -0
  54. data/lib/appwrite/models/oauth2_device_authorization.rb +52 -0
  55. data/lib/appwrite/models/oauth2_grant.rb +82 -0
  56. data/lib/appwrite/models/oauth2_organization.rb +27 -0
  57. data/lib/appwrite/models/oauth2_organization_list.rb +32 -0
  58. data/lib/appwrite/models/oauth2_par.rb +32 -0
  59. data/lib/appwrite/models/oauth2_project.rb +37 -0
  60. data/lib/appwrite/models/oauth2_project_list.rb +32 -0
  61. data/lib/appwrite/models/oauth2_reject.rb +27 -0
  62. data/lib/appwrite/models/oauth2_token.rb +57 -0
  63. data/lib/appwrite/models/organization.rb +12 -12
  64. data/lib/appwrite/models/policy_mfa_factors.rb +47 -0
  65. data/lib/appwrite/models/project.rb +15 -0
  66. data/lib/appwrite/models/project_auth_method.rb +3 -3
  67. data/lib/appwrite/models/proxy_invalidation.rb +42 -0
  68. data/lib/appwrite/models/usage_billing_plan.rb +9 -9
  69. data/lib/appwrite/services/account.rb +210 -33
  70. data/lib/appwrite/services/activities.rb +1 -1
  71. data/lib/appwrite/services/apps.rb +855 -0
  72. data/lib/appwrite/services/backups.rb +31 -12
  73. data/lib/appwrite/services/databases.rb +4 -4
  74. data/lib/appwrite/services/embeddings.rb +48 -0
  75. data/lib/appwrite/services/functions.rb +1 -1
  76. data/lib/appwrite/services/oauth2.rb +525 -0
  77. data/lib/appwrite/services/organization.rb +168 -0
  78. data/lib/appwrite/services/project.rb +54 -57
  79. data/lib/appwrite/services/proxy.rb +44 -0
  80. data/lib/appwrite/services/sites.rb +4 -2
  81. data/lib/appwrite/services/storage.rb +4 -2
  82. data/lib/appwrite/services/tables_db.rb +378 -6
  83. data/lib/appwrite/services/teams.rb +198 -0
  84. data/lib/appwrite/services/users.rb +38 -0
  85. data/lib/appwrite.rb +50 -0
  86. metadata +52 -2
@@ -84,6 +84,215 @@ module Appwrite
84
84
 
85
85
  end
86
86
 
87
+ # Get a list of the OAuth2 consents the current user has given to third-party
88
+ # apps.
89
+ #
90
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
91
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
92
+ #
93
+ # @return [Oauth2ConsentList]
94
+ def list_consents(queries: nil, total: nil)
95
+ api_path = '/account/consents'
96
+
97
+ api_params = {
98
+ queries: queries,
99
+ total: total,
100
+ }
101
+
102
+ api_headers = {
103
+ "X-Appwrite-Project": @client.get_config('project'),
104
+ "accept": 'application/json',
105
+ }
106
+
107
+ @client.call(
108
+ method: 'GET',
109
+ path: api_path,
110
+ headers: api_headers,
111
+ params: api_params,
112
+ response_type: Models::Oauth2ConsentList
113
+ )
114
+
115
+ end
116
+
117
+ # Get an OAuth2 consent the current user has given to a third-party app by
118
+ # its unique ID.
119
+ #
120
+ # @param [String] consent_id Consent unique ID.
121
+ #
122
+ # @return [Oauth2Consent]
123
+ def get_consent(consent_id:)
124
+ api_path = '/account/consents/{consentId}'
125
+ .gsub('{consentId}', consent_id)
126
+
127
+ if consent_id.nil?
128
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
129
+ end
130
+
131
+ api_params = {
132
+ }
133
+
134
+ api_headers = {
135
+ "X-Appwrite-Project": @client.get_config('project'),
136
+ "accept": 'application/json',
137
+ }
138
+
139
+ @client.call(
140
+ method: 'GET',
141
+ path: api_path,
142
+ headers: api_headers,
143
+ params: api_params,
144
+ response_type: Models::Oauth2Consent
145
+ )
146
+
147
+ end
148
+
149
+ # Delete an OAuth2 consent by its unique ID. All token families issued under
150
+ # the consent are revoked, and the app must ask for consent again to regain
151
+ # access.
152
+ #
153
+ # @param [String] consent_id Consent unique ID.
154
+ #
155
+ # @return []
156
+ def delete_consent(consent_id:)
157
+ api_path = '/account/consents/{consentId}'
158
+ .gsub('{consentId}', consent_id)
159
+
160
+ if consent_id.nil?
161
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
162
+ end
163
+
164
+ api_params = {
165
+ }
166
+
167
+ api_headers = {
168
+ "X-Appwrite-Project": @client.get_config('project'),
169
+ "content-type": 'application/json',
170
+ "accept": 'application/json',
171
+ }
172
+
173
+ @client.call(
174
+ method: 'DELETE',
175
+ path: api_path,
176
+ headers: api_headers,
177
+ params: api_params,
178
+ )
179
+
180
+ end
181
+
182
+ # Get a list of the token families issued under an OAuth2 consent. Each entry
183
+ # represents one authorized device or session; the token secrets themselves
184
+ # are never returned.
185
+ #
186
+ # @param [String] consent_id Consent unique ID.
187
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
188
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
189
+ #
190
+ # @return [Oauth2ConsentTokenList]
191
+ def list_consent_tokens(consent_id:, queries: nil, total: nil)
192
+ api_path = '/account/consents/{consentId}/tokens'
193
+ .gsub('{consentId}', consent_id)
194
+
195
+ if consent_id.nil?
196
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
197
+ end
198
+
199
+ api_params = {
200
+ queries: queries,
201
+ total: total,
202
+ }
203
+
204
+ api_headers = {
205
+ "X-Appwrite-Project": @client.get_config('project'),
206
+ "accept": 'application/json',
207
+ }
208
+
209
+ @client.call(
210
+ method: 'GET',
211
+ path: api_path,
212
+ headers: api_headers,
213
+ params: api_params,
214
+ response_type: Models::Oauth2ConsentTokenList
215
+ )
216
+
217
+ end
218
+
219
+ # Get a token family issued under an OAuth2 consent by its unique ID. The
220
+ # token secrets themselves are never returned.
221
+ #
222
+ # @param [String] consent_id Consent unique ID.
223
+ # @param [String] token_id Token unique ID.
224
+ #
225
+ # @return [Oauth2ConsentToken]
226
+ def get_consent_token(consent_id:, token_id:)
227
+ api_path = '/account/consents/{consentId}/tokens/{tokenId}'
228
+ .gsub('{consentId}', consent_id)
229
+ .gsub('{tokenId}', token_id)
230
+
231
+ if consent_id.nil?
232
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
233
+ end
234
+
235
+ if token_id.nil?
236
+ raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
237
+ end
238
+
239
+ api_params = {
240
+ }
241
+
242
+ api_headers = {
243
+ "X-Appwrite-Project": @client.get_config('project'),
244
+ "accept": 'application/json',
245
+ }
246
+
247
+ @client.call(
248
+ method: 'GET',
249
+ path: api_path,
250
+ headers: api_headers,
251
+ params: api_params,
252
+ response_type: Models::Oauth2ConsentToken
253
+ )
254
+
255
+ end
256
+
257
+ # Delete a token family issued under an OAuth2 consent by its unique ID. The
258
+ # access and refresh tokens of the family stop working immediately; other
259
+ # token families and the consent itself are unaffected.
260
+ #
261
+ # @param [String] consent_id Consent unique ID.
262
+ # @param [String] token_id Token unique ID.
263
+ #
264
+ # @return []
265
+ def delete_consent_token(consent_id:, token_id:)
266
+ api_path = '/account/consents/{consentId}/tokens/{tokenId}'
267
+ .gsub('{consentId}', consent_id)
268
+ .gsub('{tokenId}', token_id)
269
+
270
+ if consent_id.nil?
271
+ raise Appwrite::Exception.new('Missing required parameter: "consentId"')
272
+ end
273
+
274
+ if token_id.nil?
275
+ raise Appwrite::Exception.new('Missing required parameter: "tokenId"')
276
+ end
277
+
278
+ api_params = {
279
+ }
280
+
281
+ api_headers = {
282
+ "X-Appwrite-Project": @client.get_config('project'),
283
+ "content-type": 'application/json',
284
+ "accept": 'application/json',
285
+ }
286
+
287
+ @client.call(
288
+ method: 'DELETE',
289
+ path: api_path,
290
+ headers: api_headers,
291
+ params: api_params,
292
+ )
293
+
294
+ end
295
+
87
296
  # Update currently logged in user account email address. After changing user
88
297
  # address, the user confirmation status will get reset. A new confirmation
89
298
  # email is not sent automatically however you can use the send confirmation
@@ -188,38 +397,6 @@ module Appwrite
188
397
 
189
398
  end
190
399
 
191
- # Use this endpoint to create a JSON Web Token. You can use the resulting JWT
192
- # to authenticate on behalf of the current user when working with the
193
- # Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
194
- # from its creation and will be invalid if the user will logout in that time
195
- # frame.
196
- #
197
- # @param [Integer] duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
198
- #
199
- # @return [Jwt]
200
- def create_jwt(duration: nil)
201
- api_path = '/account/jwts'
202
-
203
- api_params = {
204
- duration: duration,
205
- }
206
-
207
- api_headers = {
208
- "X-Appwrite-Project": @client.get_config('project'),
209
- "content-type": 'application/json',
210
- "accept": 'application/json',
211
- }
212
-
213
- @client.call(
214
- method: 'POST',
215
- path: api_path,
216
- headers: api_headers,
217
- params: api_params,
218
- response_type: Models::Jwt
219
- )
220
-
221
- end
222
-
223
400
  # Get the list of latest security activity logs for the currently logged in
224
401
  # user. Each log returns user IP address, location and date and time of log.
225
402
  #
@@ -391,7 +568,7 @@ module Appwrite
391
568
  # [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
392
569
  # method.
393
570
  #
394
- # @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
571
+ # @param [AuthenticationFactor] factor Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
395
572
  #
396
573
  # @return [MfaChallenge]
397
574
  def create_mfa_challenge(factor:)
@@ -9,7 +9,7 @@ module Appwrite
9
9
 
10
10
  # List all events for selected filters.
11
11
  #
12
- # @param [String] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
12
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
13
13
  #
14
14
  # @return [ActivityEventList]
15
15
  def list_events(queries: nil)