Skip to content

Commit 4d67f41

Browse files
authored
Merge pull request #45 from appwrite/dev
chore: update sdks for appwrite 1.4.x
2 parents 7483575 + 0d2078b commit 4d67f41

File tree

85 files changed

+2145
-810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2145
-810
lines changed

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1+
## 9.0.1
2+
3+
* Added a new `label` function to the `Role` helper class
4+
* Update internal variable names to prevent name collision
5+
* Fix: content range header inconsistency in chunked uploads [#648](https://github.com/appwrite/sdk-generator/pull/648)
6+
17
## 8.0.1
28

39
* Added documentation comments
410
* Added unit tests
511
* Upgraded dependencies
612

13+
## 9.0.0
14+
15+
* Support for Appwrite 1.4.0
16+
* New endpoints for fetching user identities
17+
* New endpoints for listing locale codes
18+
* New endpoint for downloading a function deployment
19+
* Updated documentation
20+
* Breaking changes:
21+
* The `createFunction` method has a new signature.
22+
* The `createExecution` method has a new signature.
23+
* The `updateFunction` method has a new signature.
24+
* The `createDeployment` method no longer requires an entrypoint.
25+
* The `updateFile` method now includes the ability to update the file name.
26+
* The `updateMembershipRoles` method has been renamed to `updateMembership`.
27+
728
## 8.0.0
829

930
* Added relationships support

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
[![pub package](https://img.shields.io/pub/v/dart_appwrite.svg?style=flat-square)](https://pub.dartlang.org/packages/dart_appwrite)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.3.x-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.4.x-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
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 1.3.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
10+
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
1111

1212
> This is the Dart SDK for integrating with Appwrite from your Dart server-side code. If you're looking for the Flutter SDK you should check [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter)
1313
@@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:
2323

2424
```yml
2525
dependencies:
26-
dart_appwrite: ^8.0.1
26+
dart_appwrite: ^9.0.1
2727
```
2828
2929
You can install packages from the command line:
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11+
;
12+
13+
Future result = account.deleteIdentity(
14+
identityId: '[IDENTITY_ID]',
15+
);
16+
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11+
;
12+
13+
Future result = account.listIdentities(
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

docs/examples/functions/create-deployment.md

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ void main() { // Init SDK
1212

1313
Future result = functions.createDeployment(
1414
functionId: '[FUNCTION_ID]',
15-
entrypoint: '[ENTRYPOINT]',
1615
code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
1716
activate: false,
1817
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Functions functions = Functions(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = functions.downloadDeployment(
14+
functionId: '[FUNCTION_ID]',
15+
deploymentId: '[DEPLOYMENT_ID]',
16+
);
17+
18+
result
19+
.then((response) {
20+
print(response);
21+
}).catchError((error) {
22+
print(error.response);
23+
});
24+
}

docs/examples/functions/update.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void main() { // Init SDK
1313
Future result = functions.update(
1414
functionId: '[FUNCTION_ID]',
1515
name: '[NAME]',
16+
runtime: 'node-14.5',
1617
);
1718

1819
result

docs/examples/health/get-pub-sub.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Health health = Health(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = health.getPubSub();
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}

docs/examples/health/get-queue.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Health health = Health(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = health.getQueue();
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}

docs/examples/locale/list-codes.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = locale.listCodes();
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}

docs/examples/teams/update-membership-roles.md docs/examples/teams/update-membership.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void main() { // Init SDK
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = teams.updateMembershipRoles(
13+
Future result = teams.updateMembership(
1414
teamId: '[TEAM_ID]',
1515
membershipId: '[MEMBERSHIP_ID]',
1616
roles: [],
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Users users = Users(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = users.deleteIdentity(
14+
identityId: '[IDENTITY_ID]',
15+
);
16+
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Users users = Users(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = users.listIdentities(
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

docs/examples/users/update-labels.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Users users = Users(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = users.updateLabels(
14+
userId: '[USER_ID]',
15+
labels: [],
16+
);
17+
18+
result
19+
.then((response) {
20+
print(response);
21+
}).catchError((error) {
22+
print(error.response);
23+
});
24+
}

lib/dart_appwrite.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// Appwrite Dart SDK
22
///
3-
/// This SDK is compatible with Appwrite server version 1.3.x.
3+
/// This SDK is compatible with Appwrite server version 1.4.x.
44
/// For older versions, please check
55
/// [previous releases](https://github.com/appwrite/sdk-for-dart/releases).
66
library dart_appwrite;

lib/models.dart

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ part 'src/models/database_list.dart';
88
part 'src/models/index_list.dart';
99
part 'src/models/user_list.dart';
1010
part 'src/models/session_list.dart';
11+
part 'src/models/identity_list.dart';
1112
part 'src/models/log_list.dart';
1213
part 'src/models/file_list.dart';
1314
part 'src/models/bucket_list.dart';
@@ -23,6 +24,7 @@ part 'src/models/language_list.dart';
2324
part 'src/models/currency_list.dart';
2425
part 'src/models/phone_list.dart';
2526
part 'src/models/variable_list.dart';
27+
part 'src/models/locale_code_list.dart';
2628
part 'src/models/database.dart';
2729
part 'src/models/collection.dart';
2830
part 'src/models/attribute_list.dart';
@@ -49,8 +51,10 @@ part 'src/models/algo_scrypt_modified.dart';
4951
part 'src/models/algo_argon2.dart';
5052
part 'src/models/preferences.dart';
5153
part 'src/models/session.dart';
54+
part 'src/models/identity.dart';
5255
part 'src/models/token.dart';
5356
part 'src/models/locale.dart';
57+
part 'src/models/locale_code.dart';
5458
part 'src/models/file.dart';
5559
part 'src/models/bucket.dart';
5660
part 'src/models/team.dart';
@@ -69,3 +73,4 @@ part 'src/models/health_antivirus.dart';
6973
part 'src/models/health_queue.dart';
7074
part 'src/models/health_status.dart';
7175
part 'src/models/health_time.dart';
76+
part 'src/models/headers.dart';

lib/role.dart

+5
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@ class Role {
5858
static String member(String id) {
5959
return 'member:$id';
6060
}
61+
62+
/// Grants access to a user with the specified label.
63+
static String label(String name) {
64+
return 'label:$name';
65+
}
6166
}

0 commit comments

Comments
 (0)