Skip to content

Commit 1c63c04

Browse files
authored
Merge pull request #87 from appwrite/dev
Add 1.8.x support
2 parents 041f94d + dacb79c commit 1c63c04

File tree

293 files changed

+7671
-1062
lines changed

Some content is hidden

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

293 files changed

+7671
-1062
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Analyze and test
2+
3+
on: pull_request
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: dart-lang/setup-dart@v1
11+
- name: Install dependencies
12+
run: dart pub get
13+
- name: Analyze
14+
run: dart analyze --no-fatal-warnings
15+
- name: Test
16+
run: dart test

CHANGELOG.md

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

3+
## 17.0.0
4+
5+
* Support for Appwrite 1.8
6+
* Added TablesDB service
7+
* Added new query types:
8+
* `notContains`
9+
* `notSearch`
10+
* `notBetween`
11+
* `notStartsWith`
12+
* `notEndsWith`
13+
* `createdBefore`
14+
* `createdAfter`
15+
* `updatedBefore`
16+
* `updatedAfter`
17+
* Deprecated `updateMagicURLSession`
18+
* Deprecated `updatePhoneSession`
19+
* Deprecated Databases service
20+
> The TablesDB service is the new recommended way to work with databases.
21+
> Existing databases/collections/attributes/documents can be managed using the TablesDB service.
22+
> Existing Databases service will continue to work, but new features may only be added to the TablesDB service.
23+
24+
325
## 16.2.0
426

527
* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service

README.md

Lines changed: 18 additions & 27 deletions
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.7.x-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.8.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.7.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.8.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: ^16.2.0
26+
dart_appwrite: ^17.0.0
2727
```
2828
2929
You can install packages from the command line:
@@ -39,38 +39,29 @@ dart pub add dart_appwrite
3939
Once you add the dependencies, its extremely easy to get started with the SDK; All you need to do is import the package in your code, set your Appwrite credentials, and start making API calls. Below is a simple example:
4040

4141
```dart
42-
import 'package:dart_appwrite/dart_appwrite.dart';
43-
44-
void main() async {
45-
Client client = Client()
46-
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
47-
.setProject('5ff3379a01d25') // Your project ID
48-
.setKey('cd868c7af8bdc893b4...93b7535db89')
49-
.setSelfSigned(); // Use only on dev mode with a self-signed SSL cert
50-
51-
Users users = Users(client);
52-
53-
try {
54-
final user = await users.create(userId: ID.unique(), email: "email@example.com", phone: "+123456789", password: "password", name: "Walter O'Brien");
55-
print(user.toMap());
56-
} on AppwriteException catch(e) {
57-
print(e.message);
58-
}
59-
}
42+
Client client = Client()
43+
.setProject('<YOUR_PROJECT_ID>')
44+
.setKey('<YOUR_API_KEY>');
45+
46+
Users users = Users(client);
47+
48+
User user = await users.create(
49+
userId: ID.unique(),
50+
email: 'email@example.com',
51+
phone: '+123456789',
52+
password: 'password',
53+
name: 'Walter O'Brien'
54+
);
6055
```
6156

6257
### Error handling
6358
The Appwrite Dart SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
6459

6560
```dart
66-
Users users = Users(client);
67-
6861
try {
69-
final user = await users.create(userId: ID.unique(), email: "email@example.com", phone: "+123456789", password: "password", name: "Walter O'Brien");
70-
print(user.toMap());
62+
User user = await users.create(...);
7163
} on AppwriteException catch(e) {
72-
//show message to user or do other operation based on error as required
73-
print(e.message);
64+
// Handle the error
7465
}
7566
```
7667

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:lints/recommended.yaml
File renamed without changes.
File renamed without changes.

docs/examples/account/create-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Client client = Client()
77

88
Account account = Account(client);
99

10-
MfaType result = await account.createMfaAuthenticator(
10+
MfaType result = await account.createMFAAuthenticator(
1111
type: AuthenticatorType.totp,
1212
);

docs/examples/account/create-mfa-challenge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Client client = Client()
66

77
Account account = Account(client);
88

9-
MfaChallenge result = await account.createMfaChallenge(
9+
MfaChallenge result = await account.createMFAChallenge(
1010
factor: AuthenticationFactor.email,
1111
);

docs/examples/account/create-mfa-recovery-codes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Client client = Client()
77

88
Account account = Account(client);
99

10-
MfaRecoveryCodes result = await account.createMfaRecoveryCodes();
10+
MfaRecoveryCodes result = await account.createMFARecoveryCodes();
File renamed without changes.

0 commit comments

Comments
 (0)