Skip to content

Commit f028e7d

Browse files
authored
Merge pull request #54 from appwrite/dev
Dev
2 parents e29166b + 0c07cab commit f028e7d

File tree

347 files changed

+9196
-3409
lines changed

Some content is hidden

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

347 files changed

+9196
-3409
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 11.0.0
2+
3+
* Added enum support
4+
* Added SSR support
5+
* Added messaging service support
6+
* Added contains query support
7+
* Added or query support
8+
19
## 10.1.0
210

311
* Add new queue health endpoints

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
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.4.x-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.5.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.4.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.5.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
1414
Appwrite is an open-source backend as a service server that abstract and simplify 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 Dart 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)
1515

1616

1717

18-
![Appwrite](https://appwrite.io/images/github.png)
18+
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1919

2020
## Installation
2121

2222
Add this to your package's `pubspec.yaml` file:
2323

2424
```yml
2525
dependencies:
26-
dart_appwrite: ^10.1.1
26+
dart_appwrite: ^11.0.0
2727
```
2828
2929
You can install packages from the command line:
@@ -51,7 +51,7 @@ void main() async {
5151
Users users = Users(client);
5252
5353
try {
54-
final user = await users.create(userId: ID.unique(), email: [email protected]’,password: password, name: ‘name’);
54+
final user = await users.create(userId: ID.unique(), email: "[email protected]", phone: "+123456789", password: "password", name: "Walter O'Brien");
5555
print(user.toMap());
5656
} on AppwriteException catch(e) {
5757
print(e.message);
@@ -66,7 +66,7 @@ The Appwrite Dart SDK raises `AppwriteException` object with `message`, `code` a
6666
Users users = Users(client);
6767
6868
try {
69-
final user = await users.create(userId: ID.unique(), email: [email protected]’,password: password, name: ‘name’);
69+
final user = await users.create(userId: ID.unique(), email: "[email protected]", phone: "+123456789", password: "password", name: "Walter O'Brien");
7070
print(user.toMap());
7171
} on AppwriteException catch(e) {
7272
//show message to user or do other operation based on error as required
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Session result = await account.createAnonymousSession();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Session result = await account.createEmailPasswordSession(
10+
11+
password: 'password',
12+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Token result = await account.createEmailToken(
10+
userId: '<USER_ID>',
11+
12+
phrase: false, // (optional)
13+
);

docs/examples/account/create-j-w-t.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Jwt result = await account.createJWT();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Token result = await account.createMagicURLToken(
10+
userId: '<USER_ID>',
11+
12+
url: 'https://example.com', // (optional)
13+
phrase: false, // (optional)
14+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2') // Your project ID
6+
.setSession(''); // The user session to authenticate with
7+
8+
Account account = Account(client);
9+
10+
MfaType result = await account.createMfaAuthenticator(
11+
type: AuthenticatorType.totp,
12+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
MfaChallenge result = await account.createMfaChallenge(
10+
factor: AuthenticationFactor.email,
11+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2') // Your project ID
6+
.setSession(''); // The user session to authenticate with
7+
8+
Account account = Account(client);
9+
10+
MfaRecoveryCodes result = await account.createMfaRecoveryCodes();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
await account.createOAuth2Token(
10+
provider: OAuthProvider.amazon,
11+
success: 'https://example.com', // (optional)
12+
failure: 'https://example.com', // (optional)
13+
scopes: [], // (optional)
14+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Token result = await account.createPhoneToken(
10+
userId: '<USER_ID>',
11+
phone: '+12065550100',
12+
);
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
import 'package:dart_appwrite/dart_appwrite.dart';
22

3-
void main() { // Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
6-
7-
client
3+
Client client = Client()
84
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
95
.setProject('5df5acd0d48c2') // Your project ID
10-
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11-
;
6+
.setSession(''); // The user session to authenticate with
127

13-
Future result = account.createPhoneVerification();
8+
Account account = Account(client);
149

15-
result
16-
.then((response) {
17-
print(response);
18-
}).catchError((error) {
19-
print(error.response);
20-
});
21-
}
10+
Token result = await account.createPhoneVerification();
+6-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
import 'package:dart_appwrite/dart_appwrite.dart';
22

3-
void main() { // Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
6-
7-
client
3+
Client client = Client()
84
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
95
.setProject('5df5acd0d48c2') // Your project ID
10-
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11-
;
6+
.setSession(''); // The user session to authenticate with
7+
8+
Account account = Account(client);
129

13-
Future result = account.createRecovery(
10+
Token result = await account.createRecovery(
1411
1512
url: 'https://example.com',
16-
);
17-
18-
result
19-
.then((response) {
20-
print(response);
21-
}).catchError((error) {
22-
print(error.response);
23-
});
24-
}
13+
);
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
Session result = await account.createSession(
10+
userId: '<USER_ID>',
11+
secret: '<SECRET>',
12+
);
+6-17
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
import 'package:dart_appwrite/dart_appwrite.dart';
22

3-
void main() { // Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
6-
7-
client
3+
Client client = Client()
84
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
95
.setProject('5df5acd0d48c2') // Your project ID
10-
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11-
;
6+
.setSession(''); // The user session to authenticate with
127

13-
Future result = account.createVerification(
14-
url: 'https://example.com',
15-
);
8+
Account account = Account(client);
169

17-
result
18-
.then((response) {
19-
print(response);
20-
}).catchError((error) {
21-
print(error.response);
22-
});
23-
}
10+
Token result = await account.createVerification(
11+
url: 'https://example.com',
12+
);

docs/examples/account/create.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
Account account = Account(client);
8+
9+
User result = await account.create(
10+
userId: '<USER_ID>',
11+
12+
password: '',
13+
name: '<NAME>', // (optional)
14+
);
+6-17
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
import 'package:dart_appwrite/dart_appwrite.dart';
22

3-
void main() { // Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
6-
7-
client
3+
Client client = Client()
84
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
95
.setProject('5df5acd0d48c2') // Your project ID
10-
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11-
;
6+
.setSession(''); // The user session to authenticate with
127

13-
Future result = account.deleteIdentity(
14-
identityId: '[IDENTITY_ID]',
15-
);
8+
Account account = Account(client);
169

17-
result
18-
.then((response) {
19-
print(response);
20-
}).catchError((error) {
21-
print(error.response);
22-
});
23-
}
10+
await account.deleteIdentity(
11+
identityId: '<IDENTITY_ID>',
12+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2') // Your project ID
6+
.setSession(''); // The user session to authenticate with
7+
8+
Account account = Account(client);
9+
10+
await account.deleteMfaAuthenticator(
11+
type: AuthenticatorType.totp,
12+
otp: '<OTP>',
13+
);
+6-17
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
import 'package:dart_appwrite/dart_appwrite.dart';
22

3-
void main() { // Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
6-
7-
client
3+
Client client = Client()
84
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
95
.setProject('5df5acd0d48c2') // Your project ID
10-
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11-
;
6+
.setSession(''); // The user session to authenticate with
127

13-
Future result = account.deleteSession(
14-
sessionId: '[SESSION_ID]',
15-
);
8+
Account account = Account(client);
169

17-
result
18-
.then((response) {
19-
print(response);
20-
}).catchError((error) {
21-
print(error.response);
22-
});
23-
}
10+
await account.deleteSession(
11+
sessionId: '<SESSION_ID>',
12+
);

0 commit comments

Comments
 (0)