Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update sdks for appwrite 1.4.x #45

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
## 9.0.1

* Added a new `label` function to the `Role` helper class
* Update internal variable names to prevent name collision
* Fix: content range header inconsistency in chunked uploads [#648](https://github.com/appwrite/sdk-generator/pull/648)

## 8.0.1

* Added documentation comments
* Added unit tests
* Upgraded dependencies

## 9.0.0

* Support for Appwrite 1.4.0
* New endpoints for fetching user identities
* New endpoints for listing locale codes
* New endpoint for downloading a function deployment
* Updated documentation
* Breaking changes:
* The `createFunction` method has a new signature.
* The `createExecution` method has a new signature.
* The `updateFunction` method has a new signature.
* The `createDeployment` method no longer requires an entrypoint.
* The `updateFile` method now includes the ability to update the file name.
* The `updateMembershipRoles` method has been renamed to `updateMembership`.

## 8.0.0

* Added relationships support
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[![pub package](https://img.shields.io/pub/v/dart_appwrite.svg?style=flat-square)](https://pub.dartlang.org/packages/dart_appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.3.x-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.4.x-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**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).**
**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).**

> 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)

Expand All @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
dart_appwrite: ^8.0.1
dart_appwrite: ^9.0.1
```

You can install packages from the command line:
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

Future result = account.deleteIdentity(
identityId: '[IDENTITY_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
22 changes: 22 additions & 0 deletions docs/examples/account/list-identities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Account account = Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

Future result = account.listIdentities(
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
1 change: 0 additions & 1 deletion docs/examples/functions/create-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ void main() { // Init SDK

Future result = functions.createDeployment(
functionId: '[FUNCTION_ID]',
entrypoint: '[ENTRYPOINT]',
code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
activate: false,
);
Expand Down
24 changes: 24 additions & 0 deletions docs/examples/functions/download-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Functions functions = Functions(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = functions.downloadDeployment(
functionId: '[FUNCTION_ID]',
deploymentId: '[DEPLOYMENT_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
1 change: 1 addition & 0 deletions docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void main() { // Init SDK
Future result = functions.update(
functionId: '[FUNCTION_ID]',
name: '[NAME]',
runtime: 'node-14.5',
);

result
Expand Down
21 changes: 21 additions & 0 deletions docs/examples/health/get-pub-sub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Health health = Health(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = health.getPubSub();

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
21 changes: 21 additions & 0 deletions docs/examples/health/get-queue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Health health = Health(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = health.getQueue();

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
21 changes: 21 additions & 0 deletions docs/examples/locale/list-codes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = locale.listCodes();

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() { // Init SDK
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = teams.updateMembershipRoles(
Future result = teams.updateMembership(
teamId: '[TEAM_ID]',
membershipId: '[MEMBERSHIP_ID]',
roles: [],
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/users/delete-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Users users = Users(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = users.deleteIdentity(
identityId: '[IDENTITY_ID]',
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
22 changes: 22 additions & 0 deletions docs/examples/users/list-identities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Users users = Users(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = users.listIdentities(
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
24 changes: 24 additions & 0 deletions docs/examples/users/update-labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
Client client = Client();
Users users = Users(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

Future result = users.updateLabels(
userId: '[USER_ID]',
labels: [],
);

result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
2 changes: 1 addition & 1 deletion lib/dart_appwrite.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Appwrite Dart SDK
///
/// This SDK is compatible with Appwrite server version 1.3.x.
/// 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).
library dart_appwrite;
Expand Down
5 changes: 5 additions & 0 deletions lib/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ part 'src/models/database_list.dart';
part 'src/models/index_list.dart';
part 'src/models/user_list.dart';
part 'src/models/session_list.dart';
part 'src/models/identity_list.dart';
part 'src/models/log_list.dart';
part 'src/models/file_list.dart';
part 'src/models/bucket_list.dart';
Expand All @@ -23,6 +24,7 @@ part 'src/models/language_list.dart';
part 'src/models/currency_list.dart';
part 'src/models/phone_list.dart';
part 'src/models/variable_list.dart';
part 'src/models/locale_code_list.dart';
part 'src/models/database.dart';
part 'src/models/collection.dart';
part 'src/models/attribute_list.dart';
Expand All @@ -49,8 +51,10 @@ part 'src/models/algo_scrypt_modified.dart';
part 'src/models/algo_argon2.dart';
part 'src/models/preferences.dart';
part 'src/models/session.dart';
part 'src/models/identity.dart';
part 'src/models/token.dart';
part 'src/models/locale.dart';
part 'src/models/locale_code.dart';
part 'src/models/file.dart';
part 'src/models/bucket.dart';
part 'src/models/team.dart';
Expand All @@ -69,3 +73,4 @@ part 'src/models/health_antivirus.dart';
part 'src/models/health_queue.dart';
part 'src/models/health_status.dart';
part 'src/models/health_time.dart';
part 'src/models/headers.dart';
5 changes: 5 additions & 0 deletions lib/role.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,9 @@ class Role {
static String member(String id) {
return 'member:$id';
}

/// Grants access to a user with the specified label.
static String label(String name) {
return 'label:$name';
}
}
Loading