appwrite 5.0.0 → 6.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.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +29 -11
- data/lib/appwrite/input_file.rb +33 -0
- data/lib/appwrite/models/bucket.rb +10 -10
- data/lib/appwrite/models/collection.rb +15 -0
- data/lib/appwrite/models/database.rb +32 -0
- data/lib/appwrite/models/database_list.rb +32 -0
- data/lib/appwrite/models/deployment.rb +10 -5
- data/lib/appwrite/models/document.rb +10 -0
- data/lib/appwrite/models/execution.rb +10 -5
- data/lib/appwrite/models/file.rb +10 -5
- data/lib/appwrite/models/function.rb +10 -10
- data/lib/appwrite/models/membership.rb +10 -0
- data/lib/appwrite/models/session.rb +5 -0
- data/lib/appwrite/models/team.rb +10 -5
- data/lib/appwrite/models/token.rb +5 -0
- data/lib/appwrite/models/user.rb +20 -0
- data/lib/appwrite/services/account.rb +108 -2
- data/lib/appwrite/services/avatars.rb +1 -0
- data/lib/appwrite/services/{database.rb → databases.rb} +360 -68
- data/lib/appwrite/services/functions.rb +4 -3
- data/lib/appwrite/services/health.rb +1 -0
- data/lib/appwrite/services/locale.rb +1 -0
- data/lib/appwrite/services/storage.rb +3 -2
- data/lib/appwrite/services/teams.rb +3 -2
- data/lib/appwrite/services/users.rb +73 -2
- data/lib/appwrite.rb +4 -2
- metadata +6 -4
- data/lib/appwrite/file.rb +0 -17
@@ -3,6 +3,7 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Functions < Service
|
5
5
|
|
6
|
+
|
6
7
|
# Get a list of all the project's functions. You can use the query params to
|
7
8
|
# filter your results.
|
8
9
|
#
|
@@ -10,7 +11,7 @@ module Appwrite
|
|
10
11
|
# @param [number] limit Maximum number of functions to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
11
12
|
# @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)
|
12
13
|
# @param [string] cursor ID of the function used as the starting point for the query, excluding the function itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
13
|
-
# @param [string] cursor_direction Direction of the cursor
|
14
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
14
15
|
# @param [string] order_type Order result by ASC or DESC order.
|
15
16
|
#
|
16
17
|
# @return [FunctionList]
|
@@ -233,7 +234,7 @@ module Appwrite
|
|
233
234
|
# @param [number] limit Maximum number of deployments to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
234
235
|
# @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)
|
235
236
|
# @param [string] cursor ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
236
|
-
# @param [string] cursor_direction Direction of the cursor
|
237
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
237
238
|
# @param [string] order_type Order result by ASC or DESC order.
|
238
239
|
#
|
239
240
|
# @return [DeploymentList]
|
@@ -484,7 +485,7 @@ module Appwrite
|
|
484
485
|
# @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)
|
485
486
|
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
486
487
|
# @param [string] cursor ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
487
|
-
# @param [string] cursor_direction Direction of the cursor
|
488
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
488
489
|
#
|
489
490
|
# @return [ExecutionList]
|
490
491
|
def list_executions(function_id:, limit: nil, offset: nil, search: nil, cursor: nil, cursor_direction: nil)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Locale < Service
|
5
5
|
|
6
|
+
|
6
7
|
# Get the current user location based on IP. Returns an object with user
|
7
8
|
# country code, country name, continent name, continent code, ip address and
|
8
9
|
# suggested currency. You can use the locale header to get the data in a
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Storage < Service
|
5
5
|
|
6
|
+
|
6
7
|
# Get a list of all the storage buckets. You can use the query params to
|
7
8
|
# filter your results.
|
8
9
|
#
|
@@ -10,7 +11,7 @@ module Appwrite
|
|
10
11
|
# @param [number] limit Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
11
12
|
# @param [number] offset Results offset. The default value is 0. Use this param to manage pagination.
|
12
13
|
# @param [string] cursor ID of the bucket used as the starting point for the query, excluding the bucket itself. Should be used for efficient pagination when working with large sets of data.
|
13
|
-
# @param [string] cursor_direction Direction of the cursor
|
14
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
14
15
|
# @param [string] order_type Order result by ASC or DESC order.
|
15
16
|
#
|
16
17
|
# @return [BucketList]
|
@@ -216,7 +217,7 @@ module Appwrite
|
|
216
217
|
# @param [number] limit Maximum number of files to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
217
218
|
# @param [number] offset Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
218
219
|
# @param [string] cursor ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
219
|
-
# @param [string] cursor_direction Direction of the cursor
|
220
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
220
221
|
# @param [string] order_type Order result by ASC or DESC order.
|
221
222
|
#
|
222
223
|
# @return [FileList]
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Teams < Service
|
5
5
|
|
6
|
+
|
6
7
|
# Get a list of all the teams in which the current user is a member. You can
|
7
8
|
# use the parameters to filter your results.
|
8
9
|
#
|
@@ -13,7 +14,7 @@ module Appwrite
|
|
13
14
|
# @param [number] limit Maximum number of teams to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
14
15
|
# @param [number] offset Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
15
16
|
# @param [string] cursor ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
16
|
-
# @param [string] cursor_direction Direction of the cursor
|
17
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
17
18
|
# @param [string] order_type Order result by ASC or DESC order.
|
18
19
|
#
|
19
20
|
# @return [TeamList]
|
@@ -183,7 +184,7 @@ module Appwrite
|
|
183
184
|
# @param [number] limit Maximum number of memberships to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
184
185
|
# @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)
|
185
186
|
# @param [string] cursor ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
186
|
-
# @param [string] cursor_direction Direction of the cursor
|
187
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
187
188
|
# @param [string] order_type Order result by ASC or DESC order.
|
188
189
|
#
|
189
190
|
# @return [MembershipList]
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Appwrite
|
4
4
|
class Users < Service
|
5
5
|
|
6
|
+
|
6
7
|
# Get a list of all the project's users. You can use the query params to
|
7
8
|
# filter your results.
|
8
9
|
#
|
@@ -10,7 +11,7 @@ module Appwrite
|
|
10
11
|
# @param [number] limit Maximum number of users to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
11
12
|
# @param [number] offset Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
12
13
|
# @param [string] cursor ID of the user used as the starting point for the query, excluding the user itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
13
|
-
# @param [string] cursor_direction Direction of the cursor
|
14
|
+
# @param [string] cursor_direction Direction of the cursor, can be either 'before' or 'after'.
|
14
15
|
# @param [string] order_type Order result by ASC or DESC order.
|
15
16
|
#
|
16
17
|
# @return [UserList]
|
@@ -310,6 +311,41 @@ module Appwrite
|
|
310
311
|
)
|
311
312
|
end
|
312
313
|
|
314
|
+
# Update the user phone by its unique ID.
|
315
|
+
#
|
316
|
+
# @param [string] user_id User ID.
|
317
|
+
# @param [string] number User phone number.
|
318
|
+
#
|
319
|
+
# @return [User]
|
320
|
+
def update_phone(user_id:, number:)
|
321
|
+
if user_id.nil?
|
322
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
323
|
+
end
|
324
|
+
|
325
|
+
if number.nil?
|
326
|
+
raise Appwrite::Exception.new('Missing required parameter: "number"')
|
327
|
+
end
|
328
|
+
|
329
|
+
path = '/users/{userId}/phone'
|
330
|
+
.gsub('{userId}', user_id)
|
331
|
+
|
332
|
+
params = {
|
333
|
+
number: number,
|
334
|
+
}
|
335
|
+
|
336
|
+
headers = {
|
337
|
+
"content-type": 'application/json',
|
338
|
+
}
|
339
|
+
|
340
|
+
@client.call(
|
341
|
+
method: 'PATCH',
|
342
|
+
path: path,
|
343
|
+
headers: headers,
|
344
|
+
params: params,
|
345
|
+
response_type: Models::User
|
346
|
+
)
|
347
|
+
end
|
348
|
+
|
313
349
|
# Get the user preferences by its unique ID.
|
314
350
|
#
|
315
351
|
# @param [string] user_id User ID.
|
@@ -509,7 +545,7 @@ module Appwrite
|
|
509
545
|
# @param [boolean] email_verification User email verification status.
|
510
546
|
#
|
511
547
|
# @return [User]
|
512
|
-
def
|
548
|
+
def update_email_verification(user_id:, email_verification:)
|
513
549
|
if user_id.nil?
|
514
550
|
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
515
551
|
end
|
@@ -538,5 +574,40 @@ module Appwrite
|
|
538
574
|
)
|
539
575
|
end
|
540
576
|
|
577
|
+
# Update the user phone verification status by its unique ID.
|
578
|
+
#
|
579
|
+
# @param [string] user_id User ID.
|
580
|
+
# @param [boolean] phone_verification User phone verification status.
|
581
|
+
#
|
582
|
+
# @return [User]
|
583
|
+
def update_phone_verification(user_id:, phone_verification:)
|
584
|
+
if user_id.nil?
|
585
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
586
|
+
end
|
587
|
+
|
588
|
+
if phone_verification.nil?
|
589
|
+
raise Appwrite::Exception.new('Missing required parameter: "phoneVerification"')
|
590
|
+
end
|
591
|
+
|
592
|
+
path = '/users/{userId}/verification/phone'
|
593
|
+
.gsub('{userId}', user_id)
|
594
|
+
|
595
|
+
params = {
|
596
|
+
phoneVerification: phone_verification,
|
597
|
+
}
|
598
|
+
|
599
|
+
headers = {
|
600
|
+
"content-type": 'application/json',
|
601
|
+
}
|
602
|
+
|
603
|
+
@client.call(
|
604
|
+
method: 'PATCH',
|
605
|
+
path: path,
|
606
|
+
headers: headers,
|
607
|
+
params: params,
|
608
|
+
response_type: Models::User
|
609
|
+
)
|
610
|
+
end
|
611
|
+
|
541
612
|
end
|
542
613
|
end
|
data/lib/appwrite.rb
CHANGED
@@ -6,10 +6,11 @@ require 'mime/types'
|
|
6
6
|
require_relative 'appwrite/client'
|
7
7
|
require_relative 'appwrite/service'
|
8
8
|
require_relative 'appwrite/exception'
|
9
|
-
require_relative 'appwrite/
|
9
|
+
require_relative 'appwrite/input_file'
|
10
10
|
|
11
11
|
require_relative 'appwrite/models/document_list'
|
12
12
|
require_relative 'appwrite/models/collection_list'
|
13
|
+
require_relative 'appwrite/models/database_list'
|
13
14
|
require_relative 'appwrite/models/index_list'
|
14
15
|
require_relative 'appwrite/models/user_list'
|
15
16
|
require_relative 'appwrite/models/session_list'
|
@@ -27,6 +28,7 @@ require_relative 'appwrite/models/continent_list'
|
|
27
28
|
require_relative 'appwrite/models/language_list'
|
28
29
|
require_relative 'appwrite/models/currency_list'
|
29
30
|
require_relative 'appwrite/models/phone_list'
|
31
|
+
require_relative 'appwrite/models/database'
|
30
32
|
require_relative 'appwrite/models/collection'
|
31
33
|
require_relative 'appwrite/models/attribute_list'
|
32
34
|
require_relative 'appwrite/models/attribute_string'
|
@@ -65,7 +67,7 @@ require_relative 'appwrite/models/health_time'
|
|
65
67
|
|
66
68
|
require_relative 'appwrite/services/account'
|
67
69
|
require_relative 'appwrite/services/avatars'
|
68
|
-
require_relative 'appwrite/services/
|
70
|
+
require_relative 'appwrite/services/databases'
|
69
71
|
require_relative 'appwrite/services/functions'
|
70
72
|
require_relative 'appwrite/services/health'
|
71
73
|
require_relative 'appwrite/services/locale'
|
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: 6.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-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -33,7 +33,7 @@ files:
|
|
33
33
|
- lib/appwrite.rb
|
34
34
|
- lib/appwrite/client.rb
|
35
35
|
- lib/appwrite/exception.rb
|
36
|
-
- lib/appwrite/
|
36
|
+
- lib/appwrite/input_file.rb
|
37
37
|
- lib/appwrite/models/attribute_boolean.rb
|
38
38
|
- lib/appwrite/models/attribute_email.rb
|
39
39
|
- lib/appwrite/models/attribute_enum.rb
|
@@ -53,6 +53,8 @@ files:
|
|
53
53
|
- lib/appwrite/models/country_list.rb
|
54
54
|
- lib/appwrite/models/currency.rb
|
55
55
|
- lib/appwrite/models/currency_list.rb
|
56
|
+
- lib/appwrite/models/database.rb
|
57
|
+
- lib/appwrite/models/database_list.rb
|
56
58
|
- lib/appwrite/models/deployment.rb
|
57
59
|
- lib/appwrite/models/deployment_list.rb
|
58
60
|
- lib/appwrite/models/document.rb
|
@@ -92,7 +94,7 @@ files:
|
|
92
94
|
- lib/appwrite/service.rb
|
93
95
|
- lib/appwrite/services/account.rb
|
94
96
|
- lib/appwrite/services/avatars.rb
|
95
|
-
- lib/appwrite/services/
|
97
|
+
- lib/appwrite/services/databases.rb
|
96
98
|
- lib/appwrite/services/functions.rb
|
97
99
|
- lib/appwrite/services/health.rb
|
98
100
|
- lib/appwrite/services/locale.rb
|
data/lib/appwrite/file.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'mime/types'
|
2
|
-
|
3
|
-
module Appwrite
|
4
|
-
class File
|
5
|
-
attr_reader :path
|
6
|
-
attr_reader :name
|
7
|
-
attr_reader :content
|
8
|
-
attr_reader :mime_type
|
9
|
-
|
10
|
-
def initialize(path, content)
|
11
|
-
@path = path
|
12
|
-
@content = content
|
13
|
-
@name = ::File.basename(path)
|
14
|
-
@mime_type = MIME::Types.type_for(path)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|