appwrite 10.1.2 → 11.0.0.pre.rc.4
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 +43 -4
- data/lib/appwrite/enums/authentication_factor.rb +9 -0
- data/lib/appwrite/enums/authenticator_type.rb +7 -0
- data/lib/appwrite/enums/browser.rb +20 -0
- data/lib/appwrite/enums/compression.rb +9 -0
- data/lib/appwrite/enums/credit_card.rb +22 -0
- data/lib/appwrite/enums/encryption.rb +9 -0
- data/lib/appwrite/enums/execution_method.rb +12 -0
- data/lib/appwrite/enums/flag.rb +200 -0
- data/lib/appwrite/enums/image_format.rb +11 -0
- data/lib/appwrite/enums/image_gravity.rb +15 -0
- data/lib/appwrite/enums/index_type.rb +10 -0
- data/lib/appwrite/enums/message_status.rb +9 -0
- data/lib/appwrite/enums/messaging_provider_type.rb +9 -0
- data/lib/appwrite/enums/name.rb +18 -0
- data/lib/appwrite/enums/o_auth_provider.rb +45 -0
- data/lib/appwrite/enums/password_hash.rb +17 -0
- data/lib/appwrite/enums/relation_mutate.rb +9 -0
- data/lib/appwrite/enums/relationship_type.rb +10 -0
- data/lib/appwrite/enums/runtime.rb +42 -0
- data/lib/appwrite/models/health_certificate.rb +52 -0
- data/lib/appwrite/models/jwt.rb +27 -0
- data/lib/appwrite/models/membership.rb +5 -0
- data/lib/appwrite/models/message.rb +87 -0
- data/lib/appwrite/models/message_list.rb +32 -0
- data/lib/appwrite/models/mfa_challenge.rb +42 -0
- data/lib/appwrite/models/mfa_factors.rb +37 -0
- data/lib/appwrite/models/mfa_type.rb +37 -0
- data/lib/appwrite/models/provider.rb +67 -0
- data/lib/appwrite/models/provider_list.rb +32 -0
- data/lib/appwrite/models/session.rb +13 -3
- data/lib/appwrite/models/subscriber.rb +67 -0
- data/lib/appwrite/models/subscriber_list.rb +32 -0
- data/lib/appwrite/models/target.rb +62 -0
- data/lib/appwrite/models/target_list.rb +32 -0
- data/lib/appwrite/models/token.rb +8 -3
- data/lib/appwrite/models/topic.rb +62 -0
- data/lib/appwrite/models/topic_list.rb +32 -0
- data/lib/appwrite/models/user.rb +15 -0
- data/lib/appwrite/query.rb +53 -28
- data/lib/appwrite/services/account.rb +650 -12
- data/lib/appwrite/services/avatars.rb +3 -3
- data/lib/appwrite/services/databases.rb +6 -6
- data/lib/appwrite/services/functions.rb +3 -3
- data/lib/appwrite/services/health.rb +59 -0
- data/lib/appwrite/services/messaging.rb +1879 -0
- data/lib/appwrite/services/storage.rb +4 -4
- data/lib/appwrite/services/teams.rb +1 -1
- data/lib/appwrite/services/users.rb +382 -4
- data/lib/appwrite.rb +36 -0
- metadata +39 -4
@@ -18,7 +18,7 @@ module Appwrite
|
|
18
18
|
# image at source quality. If dimensions are not specified, the default size
|
19
19
|
# of image returned is 100x100px.
|
20
20
|
#
|
21
|
-
# @param [
|
21
|
+
# @param [Browser] code Browser Code.
|
22
22
|
# @param [Integer] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
23
23
|
# @param [Integer] height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
24
24
|
# @param [Integer] quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
|
@@ -61,7 +61,7 @@ module Appwrite
|
|
61
61
|
# of image returned is 100x100px.
|
62
62
|
#
|
63
63
|
#
|
64
|
-
# @param [
|
64
|
+
# @param [CreditCard] code Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.
|
65
65
|
# @param [Integer] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
66
66
|
# @param [Integer] height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
67
67
|
# @param [Integer] quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
|
@@ -136,7 +136,7 @@ module Appwrite
|
|
136
136
|
# of image returned is 100x100px.
|
137
137
|
#
|
138
138
|
#
|
139
|
-
# @param [
|
139
|
+
# @param [Flag] code Country Code. ISO Alpha-2 country code format.
|
140
140
|
# @param [Integer] width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
141
141
|
# @param [Integer] height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
142
142
|
# @param [Integer] quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
|
@@ -532,7 +532,7 @@ module Appwrite
|
|
532
532
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
533
533
|
# @param [String] key Attribute Key.
|
534
534
|
# @param [] required Is attribute required?
|
535
|
-
# @param [String] default Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.
|
535
|
+
# @param [String] default Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.
|
536
536
|
# @param [] array Is attribute an array?
|
537
537
|
#
|
538
538
|
# @return [AttributeDatetime]
|
@@ -1229,11 +1229,11 @@ module Appwrite
|
|
1229
1229
|
# @param [String] database_id Database ID.
|
1230
1230
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
1231
1231
|
# @param [String] related_collection_id Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
1232
|
-
# @param [
|
1232
|
+
# @param [RelationshipType] type Relation type
|
1233
1233
|
# @param [] two_way Is Two Way?
|
1234
1234
|
# @param [String] key Attribute Key.
|
1235
1235
|
# @param [String] two_way_key Two Way Attribute Key.
|
1236
|
-
# @param [
|
1236
|
+
# @param [RelationMutate] on_delete Constraints option
|
1237
1237
|
#
|
1238
1238
|
# @return [AttributeRelationship]
|
1239
1239
|
def create_relationship_attribute(database_id:, collection_id:, related_collection_id:, type:, two_way: nil, key: nil, two_way_key: nil, on_delete: nil)
|
@@ -1595,7 +1595,7 @@ module Appwrite
|
|
1595
1595
|
# @param [String] database_id Database ID.
|
1596
1596
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
1597
1597
|
# @param [String] key Attribute Key.
|
1598
|
-
# @param [
|
1598
|
+
# @param [RelationMutate] on_delete Constraints option
|
1599
1599
|
#
|
1600
1600
|
# @return [AttributeRelationship]
|
1601
1601
|
def update_relationship_attribute(database_id:, collection_id:, key:, on_delete: nil)
|
@@ -1732,7 +1732,7 @@ module Appwrite
|
|
1732
1732
|
# @param [String] database_id Database ID.
|
1733
1733
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
1734
1734
|
# @param [String] document_id Document ID.
|
1735
|
-
# @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/
|
1735
|
+
# @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.
|
1736
1736
|
#
|
1737
1737
|
# @return [Document]
|
1738
1738
|
def get_document(database_id:, collection_id:, document_id:, queries: nil)
|
@@ -1902,7 +1902,7 @@ module Appwrite
|
|
1902
1902
|
# @param [String] database_id Database ID.
|
1903
1903
|
# @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
1904
1904
|
# @param [String] key Index Key.
|
1905
|
-
# @param [
|
1905
|
+
# @param [IndexType] type Index type.
|
1906
1906
|
# @param [Array] attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
1907
1907
|
# @param [Array] orders Array of index orders. Maximum of 100 orders are allowed.
|
1908
1908
|
#
|
@@ -43,7 +43,7 @@ module Appwrite
|
|
43
43
|
#
|
44
44
|
# @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.
|
45
45
|
# @param [String] name Function name. Max length: 128 chars.
|
46
|
-
# @param [
|
46
|
+
# @param [Runtime] runtime Execution runtime.
|
47
47
|
# @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
48
48
|
# @param [Array] events Events list. Maximum of 100 events are allowed.
|
49
49
|
# @param [String] schedule Schedule CRON syntax.
|
@@ -173,7 +173,7 @@ module Appwrite
|
|
173
173
|
#
|
174
174
|
# @param [String] function_id Function ID.
|
175
175
|
# @param [String] name Function name. Max length: 128 chars.
|
176
|
-
# @param [
|
176
|
+
# @param [Runtime] runtime Execution runtime.
|
177
177
|
# @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
178
178
|
# @param [Array] events Events list. Maximum of 100 events are allowed.
|
179
179
|
# @param [String] schedule Schedule CRON syntax.
|
@@ -588,7 +588,7 @@ module Appwrite
|
|
588
588
|
# @param [String] body HTTP body of execution. Default value is empty string.
|
589
589
|
# @param [] async Execute code in the background. Default value is false.
|
590
590
|
# @param [String] xpath HTTP path of execution. Path can include query params. Default value is /
|
591
|
-
# @param [
|
591
|
+
# @param [ExecutionMethod] method HTTP method of execution. Default value is GET.
|
592
592
|
# @param [Hash] headers HTTP headers of execution. Defaults to empty.
|
593
593
|
#
|
594
594
|
# @return [Execution]
|
@@ -80,6 +80,32 @@ module Appwrite
|
|
80
80
|
end
|
81
81
|
|
82
82
|
|
83
|
+
# Get the SSL certificate for a domain
|
84
|
+
#
|
85
|
+
# @param [String] domain string
|
86
|
+
#
|
87
|
+
# @return [HealthCertificate]
|
88
|
+
def get_certificate(domain: nil)
|
89
|
+
api_path = '/health/certificate'
|
90
|
+
|
91
|
+
api_params = {
|
92
|
+
domain: domain,
|
93
|
+
}
|
94
|
+
|
95
|
+
api_headers = {
|
96
|
+
"content-type": 'application/json',
|
97
|
+
}
|
98
|
+
|
99
|
+
@client.call(
|
100
|
+
method: 'GET',
|
101
|
+
path: api_path,
|
102
|
+
headers: api_headers,
|
103
|
+
params: api_params,
|
104
|
+
response_type: Models::HealthCertificate
|
105
|
+
)
|
106
|
+
end
|
107
|
+
|
108
|
+
|
83
109
|
# Check the Appwrite database servers are up and connection is successful.
|
84
110
|
#
|
85
111
|
#
|
@@ -264,6 +290,39 @@ module Appwrite
|
|
264
290
|
end
|
265
291
|
|
266
292
|
|
293
|
+
# Returns the amount of failed jobs in a given queue.
|
294
|
+
#
|
295
|
+
#
|
296
|
+
# @param [Name] name The name of the queue
|
297
|
+
# @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
298
|
+
#
|
299
|
+
# @return [HealthQueue]
|
300
|
+
def get_failed_jobs(name:, threshold: nil)
|
301
|
+
api_path = '/health/queue/failed/{name}'
|
302
|
+
.gsub('{name}', name)
|
303
|
+
|
304
|
+
if name.nil?
|
305
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
306
|
+
end
|
307
|
+
|
308
|
+
api_params = {
|
309
|
+
threshold: threshold,
|
310
|
+
}
|
311
|
+
|
312
|
+
api_headers = {
|
313
|
+
"content-type": 'application/json',
|
314
|
+
}
|
315
|
+
|
316
|
+
@client.call(
|
317
|
+
method: 'GET',
|
318
|
+
path: api_path,
|
319
|
+
headers: api_headers,
|
320
|
+
params: api_params,
|
321
|
+
response_type: Models::HealthQueue
|
322
|
+
)
|
323
|
+
end
|
324
|
+
|
325
|
+
|
267
326
|
#
|
268
327
|
#
|
269
328
|
# @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|