appwrite 7.1.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module Appwrite
10
10
  # Get a list of all the project's functions. You can use the query params to
11
11
  # filter your results.
12
12
  #
13
- # @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 the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout
13
+ # @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. You may filter on the following attributes: name, enabled, runtime, deployment, schedule, scheduleNext, schedulePrevious, timeout
14
14
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
15
15
  #
16
16
  # @return [FunctionList]
@@ -40,17 +40,17 @@ module Appwrite
40
40
  # [permissions](/docs/permissions) to allow different project users or team
41
41
  # with access to execute the function using the client API.
42
42
  #
43
- # @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.
43
+ # @param [String] function_id Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
44
44
  # @param [String] name Function name. Max length: 128 chars.
45
- # @param [Array] execute An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long.
46
45
  # @param [String] runtime Execution runtime.
46
+ # @param [Array] execute An array of strings with execution roles. By default no user is granted with any execute permissions. [learn more about permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 64 characters long.
47
47
  # @param [Array] events Events list. Maximum of 100 events are allowed.
48
48
  # @param [String] schedule Schedule CRON syntax.
49
49
  # @param [Integer] timeout Function maximum execution time in seconds.
50
50
  # @param [] enabled Is function enabled?
51
51
  #
52
52
  # @return [Function]
53
- def create(function_id:, name:, execute:, runtime:, events: nil, schedule: nil, timeout: nil, enabled: nil)
53
+ def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil)
54
54
  path = '/functions'
55
55
 
56
56
  if function_id.nil?
@@ -61,10 +61,6 @@ module Appwrite
61
61
  raise Appwrite::Exception.new('Missing required parameter: "name"')
62
62
  end
63
63
 
64
- if execute.nil?
65
- raise Appwrite::Exception.new('Missing required parameter: "execute"')
66
- end
67
-
68
64
  if runtime.nil?
69
65
  raise Appwrite::Exception.new('Missing required parameter: "runtime"')
70
66
  end
@@ -159,7 +155,7 @@ module Appwrite
159
155
  # @param [] enabled Is function enabled?
160
156
  #
161
157
  # @return [Function]
162
- def update(function_id:, name:, execute:, events: nil, schedule: nil, timeout: nil, enabled: nil)
158
+ def update(function_id:, name:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil)
163
159
  path = '/functions/{functionId}'
164
160
  .gsub('{functionId}', function_id)
165
161
 
@@ -171,10 +167,6 @@ module Appwrite
171
167
  raise Appwrite::Exception.new('Missing required parameter: "name"')
172
168
  end
173
169
 
174
- if execute.nil?
175
- raise Appwrite::Exception.new('Missing required parameter: "execute"')
176
- end
177
-
178
170
  params = {
179
171
  name: name,
180
172
  execute: execute,
@@ -231,7 +223,7 @@ module Appwrite
231
223
  # params to filter your results.
232
224
  #
233
225
  # @param [String] function_id Function ID.
234
- # @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 the following attributes: entrypoint, size, buildId, activate
226
+ # @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. You may filter on the following attributes: entrypoint, size, buildId, activate
235
227
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
236
228
  #
237
229
  # @return [DeploymentList]
@@ -440,7 +432,7 @@ module Appwrite
440
432
  # @param [String] build_id Build unique ID.
441
433
  #
442
434
  # @return []
443
- def retry_build(function_id:, deployment_id:, build_id:)
435
+ def create_build(function_id:, deployment_id:, build_id:)
444
436
  path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'
445
437
  .gsub('{functionId}', function_id)
446
438
  .gsub('{deploymentId}', deployment_id)
@@ -475,12 +467,10 @@ module Appwrite
475
467
 
476
468
 
477
469
  # Get a list of all the current user function execution logs. You can use the
478
- # query params to filter your results. On admin mode, this endpoint will
479
- # return a list of all of the project's executions. [Learn more about
480
- # different API modes](/docs/admin).
470
+ # query params to filter your results.
481
471
  #
482
472
  # @param [String] function_id Function ID.
483
- # @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 the following attributes: trigger, status, statusCode, duration
473
+ # @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. You may filter on the following attributes: trigger, status, statusCode, duration
484
474
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
485
475
  #
486
476
  # @return [ExecutionList]
@@ -0,0 +1,71 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class Graphql < Service
5
+
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ # Execute a GraphQL mutation.
11
+ #
12
+ # @param [Hash] query The query or queries to execute.
13
+ #
14
+ # @return [Any]
15
+ def query(query:)
16
+ path = '/graphql'
17
+
18
+ if query.nil?
19
+ raise Appwrite::Exception.new('Missing required parameter: "query"')
20
+ end
21
+
22
+ params = {
23
+ query: query,
24
+ }
25
+
26
+ headers = {
27
+ "x-sdk-graphql": 'true',
28
+ "content-type": 'application/json',
29
+ }
30
+
31
+ @client.call(
32
+ method: 'POST',
33
+ path: path,
34
+ headers: headers,
35
+ params: params,
36
+ )
37
+ end
38
+
39
+
40
+ # Execute a GraphQL mutation.
41
+ #
42
+ # @param [Hash] query The query or queries to execute.
43
+ #
44
+ # @return [Any]
45
+ def mutation(query:)
46
+ path = '/graphql/mutation'
47
+
48
+ if query.nil?
49
+ raise Appwrite::Exception.new('Missing required parameter: "query"')
50
+ end
51
+
52
+ params = {
53
+ query: query,
54
+ }
55
+
56
+ headers = {
57
+ "x-sdk-graphql": 'true',
58
+ "content-type": 'application/json',
59
+ }
60
+
61
+ @client.call(
62
+ method: 'POST',
63
+ path: path,
64
+ headers: headers,
65
+ params: params,
66
+ )
67
+ end
68
+
69
+
70
+ end
71
+ end
@@ -10,7 +10,7 @@ module Appwrite
10
10
  # Get a list of all the storage buckets. You can use the query params to
11
11
  # filter your results.
12
12
  #
13
- # @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 the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus
13
+ # @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. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus
14
14
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
15
15
  #
16
16
  # @return [BucketList]
@@ -38,9 +38,9 @@ module Appwrite
38
38
 
39
39
  # Create a new storage bucket.
40
40
  #
41
- # @param [String] bucket_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.
41
+ # @param [String] bucket_id Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
42
42
  # @param [String] name Bucket name
43
- # @param [Array] permissions An array of permission strings. By default no user is granted with any permissions. [Learn more about permissions](/docs/permissions).
43
+ # @param [Array] permissions An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](/docs/permissions).
44
44
  # @param [] file_security Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](/docs/permissions).
45
45
  # @param [] enabled Is bucket enabled?
46
46
  # @param [Integer] 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)
@@ -123,7 +123,7 @@ module Appwrite
123
123
  #
124
124
  # @param [String] bucket_id Bucket unique ID.
125
125
  # @param [String] name Bucket name
126
- # @param [Array] permissions An array of permission strings. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).
126
+ # @param [Array] permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).
127
127
  # @param [] file_security Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](/docs/permissions).
128
128
  # @param [] enabled Is bucket enabled?
129
129
  # @param [Integer] 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)
@@ -201,11 +201,10 @@ module Appwrite
201
201
 
202
202
 
203
203
  # Get a list of all the user files. You can use the query params to filter
204
- # your results. On admin mode, this endpoint will return a list of all of the
205
- # project's files. [Learn more about different API modes](/docs/admin).
204
+ # your results.
206
205
  #
207
206
  # @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).
208
- # @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 the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
207
+ # @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. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
209
208
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
210
209
  #
211
210
  # @return [FileList]
@@ -256,9 +255,9 @@ module Appwrite
256
255
  #
257
256
  #
258
257
  # @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).
259
- # @param [String] file_id File 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.
260
- # @param [file] file Binary file.
261
- # @param [Array] permissions An array of permission strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).
258
+ # @param [String] file_id File ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
259
+ # @param [file] file Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](/docs/storage#file-input).
260
+ # @param [Array] permissions An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).
262
261
  #
263
262
  # @return [File]
264
263
  def create_file(bucket_id:, file_id:, file:, permissions: nil, on_progress: nil)
@@ -344,7 +343,7 @@ module Appwrite
344
343
  #
345
344
  # @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).
346
345
  # @param [String] file_id File unique ID.
347
- # @param [Array] permissions An array of permission string. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).
346
+ # @param [Array] permissions An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).
348
347
  #
349
348
  # @return [File]
350
349
  def update_file(bucket_id:, file_id:, permissions: nil)
@@ -8,12 +8,9 @@ module Appwrite
8
8
  end
9
9
 
10
10
  # Get a list of all the teams in which the current user is a member. You can
11
- # use the parameters to filter your results.
12
- #
13
- # In admin mode, this endpoint returns a list of all the teams in the current
14
- # project. [Learn more about different API modes](/docs/admin).
11
+ # use the parameters to filter your results.
15
12
  #
16
- # @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 the following attributes: name, total
13
+ # @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. You may filter on the following attributes: name, total
17
14
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
18
15
  #
19
16
  # @return [TeamList]
@@ -43,7 +40,7 @@ module Appwrite
43
40
  # assigned as the owner of the team. Only the users with the owner role can
44
41
  # invite new members, add new owners and delete or update the team.
45
42
  #
46
- # @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.
43
+ # @param [String] team_id Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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
44
  # @param [String] name Team name. Max length: 128 chars.
48
45
  # @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.
49
46
  #
@@ -109,14 +106,13 @@ module Appwrite
109
106
  end
110
107
 
111
108
 
112
- # Update a team using its ID. Only members with the owner role can update the
113
- # team.
109
+ # Update the team's name by its unique ID.
114
110
  #
115
111
  # @param [String] team_id Team ID.
116
112
  # @param [String] name New team name. Max length: 128 chars.
117
113
  #
118
114
  # @return [Team]
119
- def update(team_id:, name:)
115
+ def update_name(team_id:, name:)
120
116
  path = '/teams/{teamId}'
121
117
  .gsub('{teamId}', team_id)
122
118
 
@@ -180,7 +176,7 @@ module Appwrite
180
176
  # members have read access to this endpoint.
181
177
  #
182
178
  # @param [String] team_id Team ID.
183
- # @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 the following attributes: userId, teamId, invited, joined, confirm
179
+ # @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. You may filter on the following attributes: userId, teamId, invited, joined, confirm
184
180
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
185
181
  #
186
182
  # @return [MembershipList]
@@ -211,30 +207,38 @@ module Appwrite
211
207
  end
212
208
 
213
209
 
214
- # Invite a new member to join your team. If initiated from the client SDK, an
215
- # email with a link to join the team will be sent to the member's email
216
- # address and an account will be created for them should they not be signed
217
- # up already. If initiated from server-side SDKs, the new member will
218
- # automatically be added to the team.
210
+ # Invite a new member to join your team. Provide an ID for existing users, or
211
+ # invite unregistered users using an email or phone number. If initiated from
212
+ # a Client SDK, Appwrite will send an email or sms with a link to join the
213
+ # team to the invited user, and an account will be created for them if one
214
+ # doesn't exist. If initiated from a Server SDK, the new member will be added
215
+ # automatically to the team.
219
216
  #
220
- # Use the 'url' parameter to redirect the user from the invitation email back
221
- # to your app. When the user is redirected, use the [Update Team Membership
217
+ # You only need to provide one of a user ID, email, or phone number. Appwrite
218
+ # will prioritize accepting the user ID > email > phone number if you provide
219
+ # more than one of these parameters.
220
+ #
221
+ # Use the `url` parameter to redirect the user from the invitation email to
222
+ # your app. After the user is redirected, use the [Update Team Membership
222
223
  # Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
223
224
  # the user to accept the invitation to the team.
224
225
  #
225
226
  # Please note that to avoid a [Redirect
226
227
  # Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
227
- # the only valid redirect URL's are the once from domains you have set when
228
- # adding your platforms in the console interface.
228
+ # Appwrite will accept the only redirect URLs under the domains you have
229
+ # added as a platform on the Appwrite Console.
230
+ #
229
231
  #
230
232
  # @param [String] team_id Team ID.
231
- # @param [String] email Email of the new team member.
232
233
  # @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.
233
234
  # @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.
235
+ # @param [String] email Email of the new team member.
236
+ # @param [String] user_id ID of the user to be added to a team.
237
+ # @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
234
238
  # @param [String] name Name of the new team member. Max length: 128 chars.
235
239
  #
236
240
  # @return [Membership]
237
- def create_membership(team_id:, email:, roles:, url:, name: nil)
241
+ def create_membership(team_id:, roles:, url:, email: nil, user_id: nil, phone: nil, name: nil)
238
242
  path = '/teams/{teamId}/memberships'
239
243
  .gsub('{teamId}', team_id)
240
244
 
@@ -242,10 +246,6 @@ module Appwrite
242
246
  raise Appwrite::Exception.new('Missing required parameter: "teamId"')
243
247
  end
244
248
 
245
- if email.nil?
246
- raise Appwrite::Exception.new('Missing required parameter: "email"')
247
- end
248
-
249
249
  if roles.nil?
250
250
  raise Appwrite::Exception.new('Missing required parameter: "roles"')
251
251
  end
@@ -256,6 +256,8 @@ module Appwrite
256
256
 
257
257
  params = {
258
258
  email: email,
259
+ userId: user_id,
260
+ phone: phone,
259
261
  roles: roles,
260
262
  url: url,
261
263
  name: name,
@@ -281,7 +283,7 @@ module Appwrite
281
283
  # @param [String] team_id Team ID.
282
284
  # @param [String] membership_id Membership ID.
283
285
  #
284
- # @return [MembershipList]
286
+ # @return [Membership]
285
287
  def get_membership(team_id:, membership_id:)
286
288
  path = '/teams/{teamId}/memberships/{membershipId}'
287
289
  .gsub('{teamId}', team_id)
@@ -307,7 +309,7 @@ module Appwrite
307
309
  path: path,
308
310
  headers: headers,
309
311
  params: params,
310
- response_type: Models::MembershipList
312
+ response_type: Models::Membership
311
313
  )
312
314
  end
313
315
 
@@ -447,5 +449,75 @@ module Appwrite
447
449
  end
448
450
 
449
451
 
452
+ # Get the team's shared preferences by its unique ID. If a preference doesn't
453
+ # need to be shared by all team members, prefer storing them in [user
454
+ # preferences](/docs/client/account#accountGetPrefs).
455
+ #
456
+ # @param [String] team_id Team ID.
457
+ #
458
+ # @return [Preferences]
459
+ def get_prefs(team_id:)
460
+ path = '/teams/{teamId}/prefs'
461
+ .gsub('{teamId}', team_id)
462
+
463
+ if team_id.nil?
464
+ raise Appwrite::Exception.new('Missing required parameter: "teamId"')
465
+ end
466
+
467
+ params = {
468
+ }
469
+
470
+ headers = {
471
+ "content-type": 'application/json',
472
+ }
473
+
474
+ @client.call(
475
+ method: 'GET',
476
+ path: path,
477
+ headers: headers,
478
+ params: params,
479
+ response_type: Models::Preferences
480
+ )
481
+ end
482
+
483
+
484
+ # Update the team's preferences by its unique ID. The object you pass is
485
+ # stored as is and replaces any previous value. The maximum allowed prefs
486
+ # size is 64kB and throws an error if exceeded.
487
+ #
488
+ # @param [String] team_id Team ID.
489
+ # @param [Hash] prefs Prefs key-value JSON object.
490
+ #
491
+ # @return [Preferences]
492
+ def update_prefs(team_id:, prefs:)
493
+ path = '/teams/{teamId}/prefs'
494
+ .gsub('{teamId}', team_id)
495
+
496
+ if team_id.nil?
497
+ raise Appwrite::Exception.new('Missing required parameter: "teamId"')
498
+ end
499
+
500
+ if prefs.nil?
501
+ raise Appwrite::Exception.new('Missing required parameter: "prefs"')
502
+ end
503
+
504
+ params = {
505
+ prefs: prefs,
506
+ }
507
+
508
+ headers = {
509
+ "content-type": 'application/json',
510
+ }
511
+
512
+ @client.call(
513
+ method: 'PUT',
514
+ path: path,
515
+ headers: headers,
516
+ params: params,
517
+ response_type: Models::Preferences
518
+ )
519
+ end
520
+
521
+
450
522
  end
451
523
  end
@@ -10,7 +10,7 @@ module Appwrite
10
10
  # Get a list of all the project's users. You can use the query params to
11
11
  # filter your results.
12
12
  #
13
- # @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 the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification
13
+ # @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. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification
14
14
  # @param [String] search Search term to filter your list results. Max length: 256 chars.
15
15
  #
16
16
  # @return [UserList]
@@ -38,7 +38,7 @@ module Appwrite
38
38
 
39
39
  # Create a new user.
40
40
  #
41
- # @param [String] user_id User 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.
41
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
42
42
  # @param [String] email User email.
43
43
  # @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
44
44
  # @param [String] password Plain text user password. Must be at least 8 chars.
@@ -79,7 +79,7 @@ module Appwrite
79
79
  # /users](/docs/server/users#usersCreate) endpoint to create users with a
80
80
  # plain text password.
81
81
  #
82
- # @param [String] user_id User 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.
82
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
83
83
  # @param [String] email User email.
84
84
  # @param [String] password User password hashed using Argon2.
85
85
  # @param [String] name User name. Max length: 128 chars.
@@ -126,7 +126,7 @@ module Appwrite
126
126
  # /users](/docs/server/users#usersCreate) endpoint to create users with a
127
127
  # plain text password.
128
128
  #
129
- # @param [String] user_id User 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.
129
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
130
130
  # @param [String] email User email.
131
131
  # @param [String] password User password hashed using Bcrypt.
132
132
  # @param [String] name User name. Max length: 128 chars.
@@ -173,7 +173,7 @@ module Appwrite
173
173
  # /users](/docs/server/users#usersCreate) endpoint to create users with a
174
174
  # plain text password.
175
175
  #
176
- # @param [String] user_id User 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.
176
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
177
177
  # @param [String] email User email.
178
178
  # @param [String] password User password hashed using MD5.
179
179
  # @param [String] name User name. Max length: 128 chars.
@@ -220,7 +220,7 @@ module Appwrite
220
220
  # /users](/docs/server/users#usersCreate) endpoint to create users with a
221
221
  # plain text password.
222
222
  #
223
- # @param [String] user_id User 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.
223
+ # @param [String] user_id User ID. Choose a custom ID or pass the string `ID.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.
224
224
  # @param [String] email User email.
225
225
  # @param [String] password User password hashed using PHPass.
226
226
  # @param [String] name User name. Max length: 128 chars.
@@ -267,7 +267,7 @@ module Appwrite
267
267
  # /users](/docs/server/users#usersCreate) endpoint to create users with a
268
268
  # plain text password.
269
269
  #
270
- # @param [String] user_id User 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.
270
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
271
271
  # @param [String] email User email.
272
272
  # @param [String] password User password hashed using Scrypt.
273
273
  # @param [String] password_salt Optional salt used to hash password.
@@ -344,7 +344,7 @@ module Appwrite
344
344
  # algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint
345
345
  # to create users with a plain text password.
346
346
  #
347
- # @param [String] user_id User 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.
347
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
348
348
  # @param [String] email User email.
349
349
  # @param [String] password User password hashed using Scrypt Modified.
350
350
  # @param [String] password_salt Salt used to hash password.
@@ -409,7 +409,7 @@ module Appwrite
409
409
  # the [POST /users](/docs/server/users#usersCreate) endpoint to create users
410
410
  # with a plain text password.
411
411
  #
412
- # @param [String] user_id User 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.
412
+ # @param [String] user_id User ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.
413
413
  # @param [String] email User email.
414
414
  # @param [String] password User password hashed using SHA.
415
415
  # @param [String] password_version Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'
@@ -555,7 +555,7 @@ module Appwrite
555
555
  # Get the user activity logs list by its unique ID.
556
556
  #
557
557
  # @param [String] user_id User ID.
558
- # @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). Only supported methods are limit and offset
558
+ # @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). Only supported methods are limit and offset
559
559
  #
560
560
  # @return [LogList]
561
561
  def list_logs(user_id:, queries: nil)
data/lib/appwrite.rb CHANGED
@@ -45,6 +45,7 @@ require_relative 'appwrite/models/attribute_enum'
45
45
  require_relative 'appwrite/models/attribute_ip'
46
46
  require_relative 'appwrite/models/attribute_url'
47
47
  require_relative 'appwrite/models/attribute_datetime'
48
+ require_relative 'appwrite/models/attribute_relationship'
48
49
  require_relative 'appwrite/models/index'
49
50
  require_relative 'appwrite/models/document'
50
51
  require_relative 'appwrite/models/log'
@@ -56,7 +57,6 @@ require_relative 'appwrite/models/algo_bcrypt'
56
57
  require_relative 'appwrite/models/algo_scrypt'
57
58
  require_relative 'appwrite/models/algo_scrypt_modified'
58
59
  require_relative 'appwrite/models/algo_argon2'
59
- require_relative 'appwrite/models/account'
60
60
  require_relative 'appwrite/models/preferences'
61
61
  require_relative 'appwrite/models/session'
62
62
  require_relative 'appwrite/models/token'
@@ -84,6 +84,7 @@ require_relative 'appwrite/services/account'
84
84
  require_relative 'appwrite/services/avatars'
85
85
  require_relative 'appwrite/services/databases'
86
86
  require_relative 'appwrite/services/functions'
87
+ require_relative 'appwrite/services/graphql'
87
88
  require_relative 'appwrite/services/health'
88
89
  require_relative 'appwrite/services/locale'
89
90
  require_relative 'appwrite/services/storage'
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: 7.1.0
4
+ version: 8.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-09-22 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -35,7 +35,6 @@ files:
35
35
  - lib/appwrite/exception.rb
36
36
  - lib/appwrite/id.rb
37
37
  - lib/appwrite/input_file.rb
38
- - lib/appwrite/models/account.rb
39
38
  - lib/appwrite/models/algo_argon2.rb
40
39
  - lib/appwrite/models/algo_bcrypt.rb
41
40
  - lib/appwrite/models/algo_md5.rb
@@ -51,6 +50,7 @@ files:
51
50
  - lib/appwrite/models/attribute_integer.rb
52
51
  - lib/appwrite/models/attribute_ip.rb
53
52
  - lib/appwrite/models/attribute_list.rb
53
+ - lib/appwrite/models/attribute_relationship.rb
54
54
  - lib/appwrite/models/attribute_string.rb
55
55
  - lib/appwrite/models/attribute_url.rb
56
56
  - lib/appwrite/models/bucket.rb
@@ -110,6 +110,7 @@ files:
110
110
  - lib/appwrite/services/avatars.rb
111
111
  - lib/appwrite/services/databases.rb
112
112
  - lib/appwrite/services/functions.rb
113
+ - lib/appwrite/services/graphql.rb
113
114
  - lib/appwrite/services/health.rb
114
115
  - lib/appwrite/services/locale.rb
115
116
  - lib/appwrite/services/storage.rb
@@ -134,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
135
  - !ruby/object:Gem::Version
135
136
  version: '0'
136
137
  requirements: []
137
- rubygems_version: 3.0.8
138
+ rubygems_version: 3.1.6
138
139
  signing_key:
139
140
  specification_version: 4
140
141
  summary: Appwrite is an open-source self-hosted backend server that abstract and simplify