Skip to content

Commit 78f9d7f

Browse files
authored
Merge pull request #300 from appwrite/dev
feat: Flutter SDK update for version 21.4.0
2 parents 4f97f1d + 74a4d6b commit 78f9d7f

9 files changed

Lines changed: 43 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
## 21.4.0
4+
5+
* Added upsert() to DocumentChannel and RowChannel to support upsert operations on documents and rows.
6+
* Added Query.contains, Query.containsAny, and Query.containsAll for enhanced filtering capabilities.
7+
8+
## 21.3.0
9+
10+
* Added memberships realtime channel helper
11+
312
## 21.1.0
413

514
* Add `queries` parameter to Realtime subscriptions for filtering events

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

10-
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
10+
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
1111

1212
Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -19,7 +19,7 @@ Add this to your package's `pubspec.yaml` file:
1919

2020
```yml
2121
dependencies:
22-
appwrite: ^21.3.0
22+
appwrite: ^21.4.0
2323
```
2424
2525
You can install packages from the command line:

lib/channel.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,15 @@ extension BucketChannel on Channel<_Bucket> {
130130
/// Only available on Channel<_Document>
131131
extension DocumentChannel on Channel<_Document> {
132132
Channel<_Resolved> create() => _resolve('create');
133+
Channel<_Resolved> upsert() => _resolve('upsert');
133134
Channel<_Resolved> update() => _resolve('update');
134135
Channel<_Resolved> delete() => _resolve('delete');
135136
}
136137

137138
/// Only available on Channel<_Row>
138139
extension RowChannel on Channel<_Row> {
139140
Channel<_Resolved> create() => _resolve('create');
141+
Channel<_Resolved> upsert() => _resolve('upsert');
140142
Channel<_Resolved> update() => _resolve('update');
141143
Channel<_Resolved> delete() => _resolve('delete');
142144
}

lib/query.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,26 @@ class Query {
9898
static String endsWith(String attribute, String value) =>
9999
Query._('endsWith', attribute, value).toString();
100100

101-
/// Filter resources where [attribute] contains [value]
101+
/// Filter resources where [attribute] contains [value].
102+
/// For string attributes, checks if the string contains the substring.
102103
/// [value] can be a single value or a list.
104+
///
105+
/// Note: For array attributes, use [containsAny] or [containsAll] instead.
103106
static String contains(String attribute, dynamic value) =>
104107
Query._('contains', attribute, value).toString();
105108

109+
/// Filter resources where [attribute] contains ANY of the specified [value]s.
110+
/// For array and relationship attributes, matches documents where the attribute
111+
/// contains at least one of the given values.
112+
static String containsAny(String attribute, List<dynamic> value) =>
113+
Query._('containsAny', attribute, value).toString();
114+
115+
/// Filter resources where [attribute] contains ALL of the specified [value]s.
116+
/// For array and relationship attributes, matches documents where the attribute
117+
/// contains every one of the given values.
118+
static String containsAll(String attribute, List<dynamic> value) =>
119+
Query._('containsAll', attribute, value).toString();
120+
106121
/// Filter resources where [attribute] does not contain [value]
107122
/// [value] can be a single value or a list.
108123
static String notContains(String attribute, dynamic value) =>

lib/src/client_browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
4040
'x-sdk-name': 'Flutter',
4141
'x-sdk-platform': 'client',
4242
'x-sdk-language': 'flutter',
43-
'x-sdk-version': '21.3.0',
43+
'x-sdk-version': '21.4.0',
4444
'X-Appwrite-Response-Format': '1.8.0',
4545
};
4646

lib/src/client_io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ClientIO extends ClientBase with ClientMixin {
5858
'x-sdk-name': 'Flutter',
5959
'x-sdk-platform': 'client',
6060
'x-sdk-language': 'flutter',
61-
'x-sdk-version': '21.3.0',
61+
'x-sdk-version': '21.4.0',
6262
'X-Appwrite-Response-Format': '1.8.0',
6363
};
6464

lib/src/enums/o_auth_provider.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ enum OAuthProvider {
3939
yammer(value: 'yammer'),
4040
yandex(value: 'yandex'),
4141
zoho(value: 'zoho'),
42-
zoom(value: 'zoom'),
43-
githubImagine(value: 'githubImagine'),
44-
googleImagine(value: 'googleImagine');
42+
zoom(value: 'zoom');
4543

4644
const OAuthProvider({required this.value});
4745

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: appwrite
2-
version: 21.3.0
2+
version: 21.4.0
33
description: Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API
44
homepage: https://appwrite.io
55
repository: https://github.com/appwrite/sdk-for-flutter

test/channel_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ void main() {
2626
.toString(),
2727
'databases.db1.collections.col1.documents.doc1.create');
2828
});
29+
30+
test('returns database channel with upsert action', () {
31+
expect(
32+
Channel.database('db1')
33+
.collection('col1')
34+
.document('doc1')
35+
.upsert()
36+
.toString(),
37+
'databases.db1.collections.col1.documents.doc1.upsert');
38+
});
2939
});
3040

3141
group('tablesdb()', () {

0 commit comments

Comments
 (0)