Skip to content

Commit b7e9bb8

Browse files
feat: introduce 0.15.x support
1 parent e0c4f64 commit b7e9bb8

Some content is hidden

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

70 files changed

+1848
-620
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 6.0.0
2+
* Support for Appwrite 0.15
3+
* **BREAKING** `Database` -> `Databases`
4+
* **BREAKING** `account.createSession()` -> `account.createEmailSession()`
5+
* **BREAKING** `dateCreated` attribute removed from `Team`, `Execution`, `File` models
6+
* **BREAKING** `dateCreated` and `dateUpdated` attribute removed from `Func`, `Deployment`, `Bucket` models
7+
* **BREAKING** Realtime channels
8+
* collections.[COLLECTION_ID] is now databases.[DATABASE_ID].ollections.[COLLECTION_ID]
9+
* collections.[COLLECTION_ID].documents is now databases.[DATABASE_ID].ollections.[COLLECTION_ID].documents
10+
11+
**Full Changelog for Appwrite 0.15 can be found here**: https://github.com/appwrite/appwrite/blob/master/CHANGES.md#version-0150
12+
113
## 5.0.1
214
* Code formatting fix
315

README.md

+5-5
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-0.14.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.15.0-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 0.14.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 0.15.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: ^5.0.1
26+
dart_appwrite: ^6.0.0
2727
```
2828
2929
You can install packages from the command line:
@@ -42,11 +42,11 @@ Once you add the dependencies, its extremely easy to get started with the SDK; A
4242
import 'package:dart_appwrite/dart_appwrite.dart';
4343
4444
void main() async {
45-
Client client = Client();
45+
Client client = Client()
4646
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
4747
.setProject('5ff3379a01d25') // Your project ID
4848
.setKey('cd868c7af8bdc893b4...93b7535db89')
49-
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
49+
.setSelfSigned(); // Use only on dev mode with a self-signed SSL cert
5050
5151
Users users = Users(client);
5252
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+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/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.createPhoneVerification();
14+
15+
result
16+
.then((response) {
17+
print(response);
18+
}).catchError((error) {
19+
print(error.response);
20+
});
21+
}
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+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/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.updatePhoneVerification(
14+
userId: '[USER_ID]',
15+
secret: '[SECRET]',
16+
);
17+
18+
result
19+
.then((response) {
20+
print(response);
21+
}).catchError((error) {
22+
print(error.response);
23+
});
24+
}

docs/examples/account/update-phone.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+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/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.updatePhone(
14+
number: '',
15+
password: 'password',
16+
);
17+
18+
result
19+
.then((response) {
20+
print(response);
21+
}).catchError((error) {
22+
print(error.response);
23+
});
24+
}

docs/examples/database/create-boolean-attribute.md docs/examples/databases/create-boolean-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createBooleanAttribute(
13+
Future result = databases.createBooleanAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
16-
required: false,
16+
xrequired: false,
1717
);
1818

1919
result

docs/examples/database/create-collection.md docs/examples/databases/create-collection.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createCollection(
13+
Future result = databases.createCollection(
1414
collectionId: '[COLLECTION_ID]',
1515
name: '[NAME]',
1616
permission: 'document',

docs/examples/database/create-document.md docs/examples/databases/create-document.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createDocument(
13+
Future result = databases.createDocument(
1414
collectionId: '[COLLECTION_ID]',
1515
documentId: '[DOCUMENT_ID]',
1616
data: {},

docs/examples/database/create-email-attribute.md docs/examples/databases/create-email-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createEmailAttribute(
13+
Future result = databases.createEmailAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
16-
required: false,
16+
xrequired: false,
1717
);
1818

1919
result

docs/examples/database/create-enum-attribute.md docs/examples/databases/create-enum-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createEnumAttribute(
13+
Future result = databases.createEnumAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
1616
elements: [],
17-
required: false,
17+
xrequired: false,
1818
);
1919

2020
result

docs/examples/database/create-float-attribute.md docs/examples/databases/create-float-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createFloatAttribute(
13+
Future result = databases.createFloatAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
16-
required: false,
16+
xrequired: false,
1717
);
1818

1919
result

docs/examples/database/create-index.md docs/examples/databases/create-index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createIndex(
13+
Future result = databases.createIndex(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
1616
type: 'key',

docs/examples/database/create-integer-attribute.md docs/examples/databases/create-integer-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createIntegerAttribute(
13+
Future result = databases.createIntegerAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
16-
required: false,
16+
xrequired: false,
1717
);
1818

1919
result

docs/examples/database/create-ip-attribute.md docs/examples/databases/create-ip-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createIpAttribute(
13+
Future result = databases.createIpAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
16-
required: false,
16+
xrequired: false,
1717
);
1818

1919
result

docs/examples/database/create-string-attribute.md docs/examples/databases/create-string-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createStringAttribute(
13+
Future result = databases.createStringAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
1616
size: 1,
17-
required: false,
17+
xrequired: false,
1818
);
1919

2020
result

docs/examples/database/create-url-attribute.md docs/examples/databases/create-url-attribute.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import 'package:dart_appwrite/dart_appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = database.createUrlAttribute(
13+
Future result = databases.createUrlAttribute(
1414
collectionId: '[COLLECTION_ID]',
1515
key: '',
16-
required: false,
16+
xrequired: false,
1717
);
1818

1919
result

docs/examples/databases/create.md

+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+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
;
12+
13+
Future result = databases.create(
14+
name: '[NAME]',
15+
);
16+
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}

0 commit comments

Comments
 (0)