appwrite 16.0.0 → 16.1.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 +1 -1
- data/lib/appwrite/enums/build_runtime.rb +2 -0
- data/lib/appwrite/enums/image_format.rb +1 -0
- data/lib/appwrite/enums/runtime.rb +2 -0
- data/lib/appwrite/models/attribute_string.rb +8 -3
- data/lib/appwrite/models/document.rb +5 -0
- data/lib/appwrite/services/databases.rb +182 -1
- data/lib/appwrite/services/tokens.rb +1 -1
- data/lib/appwrite/services/users.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9193f83f9fdd856e7fbd5bb4faf41068d704b186cf8c2d94c5bd2e0aedd46f02
|
4
|
+
data.tar.gz: eed8c67533a26ee6694fb21a15e6926db1a0b1c2fbeb99f8cbb0fc5781970245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42a25e4d3c1516c3bd9103a7def46b70abfa7c58ef412b9674afe74693ec2c96f699262e8ee261013893ab3ec2edc54325407e56f3964b5f061891249581a7bb
|
7
|
+
data.tar.gz: 21d35a7d8e6100c686f6b3e4109a5ef871956f8e764eb793a806d65142e11f5b5d513ee2fd281f5364d1e96df777005b0a614f4fcf351c97ba2e97f99e0effb6
|
data/lib/appwrite/client.rb
CHANGED
@@ -38,6 +38,7 @@ module Appwrite
|
|
38
38
|
DART_3_1 = 'dart-3.1'
|
39
39
|
DART_3_3 = 'dart-3.3'
|
40
40
|
DART_3_5 = 'dart-3.5'
|
41
|
+
DART_3_8 = 'dart-3.8'
|
41
42
|
DOTNET_6_0 = 'dotnet-6.0'
|
42
43
|
DOTNET_7_0 = 'dotnet-7.0'
|
43
44
|
DOTNET_8_0 = 'dotnet-8.0'
|
@@ -64,6 +65,7 @@ module Appwrite
|
|
64
65
|
FLUTTER_3_24 = 'flutter-3.24'
|
65
66
|
FLUTTER_3_27 = 'flutter-3.27'
|
66
67
|
FLUTTER_3_29 = 'flutter-3.29'
|
68
|
+
FLUTTER_3_32 = 'flutter-3.32'
|
67
69
|
end
|
68
70
|
end
|
69
71
|
end
|
@@ -38,6 +38,7 @@ module Appwrite
|
|
38
38
|
DART_3_1 = 'dart-3.1'
|
39
39
|
DART_3_3 = 'dart-3.3'
|
40
40
|
DART_3_5 = 'dart-3.5'
|
41
|
+
DART_3_8 = 'dart-3.8'
|
41
42
|
DOTNET_6_0 = 'dotnet-6.0'
|
42
43
|
DOTNET_7_0 = 'dotnet-7.0'
|
43
44
|
DOTNET_8_0 = 'dotnet-8.0'
|
@@ -64,6 +65,7 @@ module Appwrite
|
|
64
65
|
FLUTTER_3_24 = 'flutter-3.24'
|
65
66
|
FLUTTER_3_27 = 'flutter-3.27'
|
66
67
|
FLUTTER_3_29 = 'flutter-3.29'
|
68
|
+
FLUTTER_3_32 = 'flutter-3.32'
|
67
69
|
end
|
68
70
|
end
|
69
71
|
end
|
@@ -13,6 +13,7 @@ module Appwrite
|
|
13
13
|
attr_reader :updated_at
|
14
14
|
attr_reader :size
|
15
15
|
attr_reader :default
|
16
|
+
attr_reader :encrypt
|
16
17
|
|
17
18
|
def initialize(
|
18
19
|
key:,
|
@@ -24,7 +25,8 @@ module Appwrite
|
|
24
25
|
created_at:,
|
25
26
|
updated_at:,
|
26
27
|
size:,
|
27
|
-
default:
|
28
|
+
default: ,
|
29
|
+
encrypt:
|
28
30
|
)
|
29
31
|
@key = key
|
30
32
|
@type = type
|
@@ -36,6 +38,7 @@ module Appwrite
|
|
36
38
|
@updated_at = updated_at
|
37
39
|
@size = size
|
38
40
|
@default = default
|
41
|
+
@encrypt = encrypt
|
39
42
|
end
|
40
43
|
|
41
44
|
def self.from(map:)
|
@@ -49,7 +52,8 @@ module Appwrite
|
|
49
52
|
created_at: map["$createdAt"],
|
50
53
|
updated_at: map["$updatedAt"],
|
51
54
|
size: map["size"],
|
52
|
-
default: map["default"]
|
55
|
+
default: map["default"],
|
56
|
+
encrypt: map["encrypt"]
|
53
57
|
)
|
54
58
|
end
|
55
59
|
|
@@ -64,7 +68,8 @@ module Appwrite
|
|
64
68
|
"$createdAt": @created_at,
|
65
69
|
"$updatedAt": @updated_at,
|
66
70
|
"size": @size,
|
67
|
-
"default": @default
|
71
|
+
"default": @default,
|
72
|
+
"encrypt": @encrypt
|
68
73
|
}
|
69
74
|
end
|
70
75
|
end
|
@@ -4,6 +4,7 @@ module Appwrite
|
|
4
4
|
module Models
|
5
5
|
class Document
|
6
6
|
attr_reader :id
|
7
|
+
attr_reader :sequence
|
7
8
|
attr_reader :collection_id
|
8
9
|
attr_reader :database_id
|
9
10
|
attr_reader :created_at
|
@@ -13,6 +14,7 @@ module Appwrite
|
|
13
14
|
|
14
15
|
def initialize(
|
15
16
|
id:,
|
17
|
+
sequence:,
|
16
18
|
collection_id:,
|
17
19
|
database_id:,
|
18
20
|
created_at:,
|
@@ -21,6 +23,7 @@ module Appwrite
|
|
21
23
|
data:
|
22
24
|
)
|
23
25
|
@id = id
|
26
|
+
@sequence = sequence
|
24
27
|
@collection_id = collection_id
|
25
28
|
@database_id = database_id
|
26
29
|
@created_at = created_at
|
@@ -32,6 +35,7 @@ module Appwrite
|
|
32
35
|
def self.from(map:)
|
33
36
|
Document.new(
|
34
37
|
id: map["$id"],
|
38
|
+
sequence: map["$sequence"],
|
35
39
|
collection_id: map["$collectionId"],
|
36
40
|
database_id: map["$databaseId"],
|
37
41
|
created_at: map["$createdAt"],
|
@@ -44,6 +48,7 @@ module Appwrite
|
|
44
48
|
def to_map
|
45
49
|
{
|
46
50
|
"$id": @id,
|
51
|
+
"$sequence": @sequence,
|
47
52
|
"$collectionId": @collection_id,
|
48
53
|
"$databaseId": @database_id,
|
49
54
|
"$createdAt": @created_at,
|
@@ -1729,6 +1729,10 @@ module Appwrite
|
|
1729
1729
|
end
|
1730
1730
|
|
1731
1731
|
|
1732
|
+
# **WARNING: Experimental Feature** - This endpoint is experimental and not
|
1733
|
+
# yet officially supported. It may be subject to breaking changes or removal
|
1734
|
+
# in future versions.
|
1735
|
+
#
|
1732
1736
|
# Create new Documents. Before using this route, you should create a new
|
1733
1737
|
# collection resource using either a [server
|
1734
1738
|
# integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
@@ -1774,6 +1778,10 @@ module Appwrite
|
|
1774
1778
|
end
|
1775
1779
|
|
1776
1780
|
|
1781
|
+
# **WARNING: Experimental Feature** - This endpoint is experimental and not
|
1782
|
+
# yet officially supported. It may be subject to breaking changes or removal
|
1783
|
+
# in future versions.
|
1784
|
+
#
|
1777
1785
|
# Create or update Documents. Before using this route, you should create a
|
1778
1786
|
# new collection resource using either a [server
|
1779
1787
|
# integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
@@ -1785,7 +1793,7 @@ module Appwrite
|
|
1785
1793
|
# @param [Array] documents Array of document data as JSON objects. May contain partial documents.
|
1786
1794
|
#
|
1787
1795
|
# @return [DocumentList]
|
1788
|
-
def upsert_documents(database_id:, collection_id:, documents:
|
1796
|
+
def upsert_documents(database_id:, collection_id:, documents:)
|
1789
1797
|
api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
|
1790
1798
|
.gsub('{databaseId}', database_id)
|
1791
1799
|
.gsub('{collectionId}', collection_id)
|
@@ -1798,6 +1806,10 @@ module Appwrite
|
|
1798
1806
|
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1799
1807
|
end
|
1800
1808
|
|
1809
|
+
if documents.nil?
|
1810
|
+
raise Appwrite::Exception.new('Missing required parameter: "documents"')
|
1811
|
+
end
|
1812
|
+
|
1801
1813
|
api_params = {
|
1802
1814
|
documents: documents,
|
1803
1815
|
}
|
@@ -1816,6 +1828,10 @@ module Appwrite
|
|
1816
1828
|
end
|
1817
1829
|
|
1818
1830
|
|
1831
|
+
# **WARNING: Experimental Feature** - This endpoint is experimental and not
|
1832
|
+
# yet officially supported. It may be subject to breaking changes or removal
|
1833
|
+
# in future versions.
|
1834
|
+
#
|
1819
1835
|
# Update all documents that match your queries, if no queries are submitted
|
1820
1836
|
# then all documents are updated. You can pass only specific fields to be
|
1821
1837
|
# updated.
|
@@ -1858,6 +1874,10 @@ module Appwrite
|
|
1858
1874
|
end
|
1859
1875
|
|
1860
1876
|
|
1877
|
+
# **WARNING: Experimental Feature** - This endpoint is experimental and not
|
1878
|
+
# yet officially supported. It may be subject to breaking changes or removal
|
1879
|
+
# in future versions.
|
1880
|
+
#
|
1861
1881
|
# Bulk delete documents using queries, if no queries are passed then all
|
1862
1882
|
# documents are deleted.
|
1863
1883
|
#
|
@@ -1941,6 +1961,63 @@ module Appwrite
|
|
1941
1961
|
end
|
1942
1962
|
|
1943
1963
|
|
1964
|
+
# **WARNING: Experimental Feature** - This endpoint is experimental and not
|
1965
|
+
# yet officially supported. It may be subject to breaking changes or removal
|
1966
|
+
# in future versions.
|
1967
|
+
#
|
1968
|
+
# Create or update a Document. Before using this route, you should create a
|
1969
|
+
# new collection resource using either a [server
|
1970
|
+
# integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
1971
|
+
# API or directly from your database console.
|
1972
|
+
#
|
1973
|
+
# @param [String] database_id Database ID.
|
1974
|
+
# @param [String] collection_id Collection ID.
|
1975
|
+
# @param [String] document_id Document ID.
|
1976
|
+
# @param [Hash] data Document data as JSON object. Include all required attributes of the document to be created or updated.
|
1977
|
+
# @param [Array] permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
1978
|
+
#
|
1979
|
+
# @return [Document]
|
1980
|
+
def upsert_document(database_id:, collection_id:, document_id:, data:, permissions: nil)
|
1981
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
1982
|
+
.gsub('{databaseId}', database_id)
|
1983
|
+
.gsub('{collectionId}', collection_id)
|
1984
|
+
.gsub('{documentId}', document_id)
|
1985
|
+
|
1986
|
+
if database_id.nil?
|
1987
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
1988
|
+
end
|
1989
|
+
|
1990
|
+
if collection_id.nil?
|
1991
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
1992
|
+
end
|
1993
|
+
|
1994
|
+
if document_id.nil?
|
1995
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
1996
|
+
end
|
1997
|
+
|
1998
|
+
if data.nil?
|
1999
|
+
raise Appwrite::Exception.new('Missing required parameter: "data"')
|
2000
|
+
end
|
2001
|
+
|
2002
|
+
api_params = {
|
2003
|
+
data: data,
|
2004
|
+
permissions: permissions,
|
2005
|
+
}
|
2006
|
+
|
2007
|
+
api_headers = {
|
2008
|
+
"content-type": 'application/json',
|
2009
|
+
}
|
2010
|
+
|
2011
|
+
@client.call(
|
2012
|
+
method: 'PUT',
|
2013
|
+
path: api_path,
|
2014
|
+
headers: api_headers,
|
2015
|
+
params: api_params,
|
2016
|
+
response_type: Models::Document
|
2017
|
+
)
|
2018
|
+
end
|
2019
|
+
|
2020
|
+
|
1944
2021
|
# Update a document by its unique ID. Using the patch method you can pass
|
1945
2022
|
# only specific fields that will get updated.
|
1946
2023
|
#
|
@@ -2029,6 +2106,110 @@ module Appwrite
|
|
2029
2106
|
end
|
2030
2107
|
|
2031
2108
|
|
2109
|
+
# Decrement a specific attribute of a document by a given value.
|
2110
|
+
#
|
2111
|
+
# @param [String] database_id Database ID.
|
2112
|
+
# @param [String] collection_id Collection ID.
|
2113
|
+
# @param [String] document_id Document ID.
|
2114
|
+
# @param [String] attribute Attribute key.
|
2115
|
+
# @param [Float] value Value to decrement the attribute by. The value must be a number.
|
2116
|
+
# @param [Float] min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
2117
|
+
#
|
2118
|
+
# @return [Document]
|
2119
|
+
def decrement_document_attribute(database_id:, collection_id:, document_id:, attribute:, value: nil, min: nil)
|
2120
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'
|
2121
|
+
.gsub('{databaseId}', database_id)
|
2122
|
+
.gsub('{collectionId}', collection_id)
|
2123
|
+
.gsub('{documentId}', document_id)
|
2124
|
+
.gsub('{attribute}', attribute)
|
2125
|
+
|
2126
|
+
if database_id.nil?
|
2127
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
2128
|
+
end
|
2129
|
+
|
2130
|
+
if collection_id.nil?
|
2131
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
2132
|
+
end
|
2133
|
+
|
2134
|
+
if document_id.nil?
|
2135
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
2136
|
+
end
|
2137
|
+
|
2138
|
+
if attribute.nil?
|
2139
|
+
raise Appwrite::Exception.new('Missing required parameter: "attribute"')
|
2140
|
+
end
|
2141
|
+
|
2142
|
+
api_params = {
|
2143
|
+
value: value,
|
2144
|
+
min: min,
|
2145
|
+
}
|
2146
|
+
|
2147
|
+
api_headers = {
|
2148
|
+
"content-type": 'application/json',
|
2149
|
+
}
|
2150
|
+
|
2151
|
+
@client.call(
|
2152
|
+
method: 'PATCH',
|
2153
|
+
path: api_path,
|
2154
|
+
headers: api_headers,
|
2155
|
+
params: api_params,
|
2156
|
+
response_type: Models::Document
|
2157
|
+
)
|
2158
|
+
end
|
2159
|
+
|
2160
|
+
|
2161
|
+
# Increment a specific attribute of a document by a given value.
|
2162
|
+
#
|
2163
|
+
# @param [String] database_id Database ID.
|
2164
|
+
# @param [String] collection_id Collection ID.
|
2165
|
+
# @param [String] document_id Document ID.
|
2166
|
+
# @param [String] attribute Attribute key.
|
2167
|
+
# @param [Float] value Value to increment the attribute by. The value must be a number.
|
2168
|
+
# @param [Float] max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
2169
|
+
#
|
2170
|
+
# @return [Document]
|
2171
|
+
def increment_document_attribute(database_id:, collection_id:, document_id:, attribute:, value: nil, max: nil)
|
2172
|
+
api_path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'
|
2173
|
+
.gsub('{databaseId}', database_id)
|
2174
|
+
.gsub('{collectionId}', collection_id)
|
2175
|
+
.gsub('{documentId}', document_id)
|
2176
|
+
.gsub('{attribute}', attribute)
|
2177
|
+
|
2178
|
+
if database_id.nil?
|
2179
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
2180
|
+
end
|
2181
|
+
|
2182
|
+
if collection_id.nil?
|
2183
|
+
raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
|
2184
|
+
end
|
2185
|
+
|
2186
|
+
if document_id.nil?
|
2187
|
+
raise Appwrite::Exception.new('Missing required parameter: "documentId"')
|
2188
|
+
end
|
2189
|
+
|
2190
|
+
if attribute.nil?
|
2191
|
+
raise Appwrite::Exception.new('Missing required parameter: "attribute"')
|
2192
|
+
end
|
2193
|
+
|
2194
|
+
api_params = {
|
2195
|
+
value: value,
|
2196
|
+
max: max,
|
2197
|
+
}
|
2198
|
+
|
2199
|
+
api_headers = {
|
2200
|
+
"content-type": 'application/json',
|
2201
|
+
}
|
2202
|
+
|
2203
|
+
@client.call(
|
2204
|
+
method: 'PATCH',
|
2205
|
+
path: api_path,
|
2206
|
+
headers: api_headers,
|
2207
|
+
params: api_params,
|
2208
|
+
response_type: Models::Document
|
2209
|
+
)
|
2210
|
+
end
|
2211
|
+
|
2212
|
+
|
2032
2213
|
# List indexes in the collection.
|
2033
2214
|
#
|
2034
2215
|
# @param [String] database_id Database ID.
|
@@ -46,7 +46,7 @@ module Appwrite
|
|
46
46
|
|
47
47
|
|
48
48
|
# Create a new token. A token is linked to a file. Token can be passed as a
|
49
|
-
#
|
49
|
+
# request URL search parameter.
|
50
50
|
#
|
51
51
|
# @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).
|
52
52
|
# @param [String] file_id File unique ID.
|
@@ -1290,7 +1290,7 @@ module Appwrite
|
|
1290
1290
|
# List the messaging targets that are associated with a user.
|
1291
1291
|
#
|
1292
1292
|
# @param [String] user_id User ID.
|
1293
|
-
# @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:
|
1293
|
+
# @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, providerId, identifier, providerType
|
1294
1294
|
#
|
1295
1295
|
# @return [TargetList]
|
1296
1296
|
def list_targets(user_id:, queries: nil)
|
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: 16.
|
4
|
+
version: 16.1.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: 2025-
|
11
|
+
date: 2025-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|