Skip to content

Commit 852e0bf

Browse files
committed
feat(version): support 0.12.0
1 parent 9bd3c08 commit 852e0bf

Some content is hidden

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

71 files changed

+1806
-312
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 2 additions & 2 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-0.11.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.12.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.11.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.12.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

docs/examples/account/get-logs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ void main() { // Init SDK
1010
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1111
;
1212

13-
Future result = account.getLogs();
13+
Future result = account.getLogs(
14+
);
1415

1516
result
1617
.then((response) {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Database database = Database(client);
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 = database.createBooleanAttribute(
14+
collectionId: '[COLLECTION_ID]',
15+
key: '',
16+
required: false,
17+
);
18+
19+
result
20+
.then((response) {
21+
print(response);
22+
}).catchError((error) {
23+
print(error.response);
24+
});
25+
}

docs/examples/database/create-collection.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ void main() { // Init SDK
1111
;
1212

1313
Future result = database.createCollection(
14+
collectionId: '',
1415
name: '[NAME]',
15-
read: [],
16-
write: [],
17-
rules: [],
16+
permission: 'document',
17+
read: ["role:all"],
18+
write: ["role:all"],
1819
);
1920

2021
result

docs/examples/database/create-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ void main() { // Init SDK
1212

1313
Future result = database.createDocument(
1414
collectionId: '[COLLECTION_ID]',
15+
documentId: '',
1516
data: {},
1617
);
1718

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Database database = Database(client);
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 = database.createEmailAttribute(
14+
collectionId: '[COLLECTION_ID]',
15+
key: '',
16+
required: false,
17+
);
18+
19+
result
20+
.then((response) {
21+
print(response);
22+
}).catchError((error) {
23+
print(error.response);
24+
});
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Database database = Database(client);
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 = database.createEnumAttribute(
14+
collectionId: '[COLLECTION_ID]',
15+
key: '',
16+
elements: [],
17+
required: false,
18+
);
19+
20+
result
21+
.then((response) {
22+
print(response);
23+
}).catchError((error) {
24+
print(error.response);
25+
});
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Database database = Database(client);
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 = database.createFloatAttribute(
14+
collectionId: '[COLLECTION_ID]',
15+
key: '',
16+
required: false,
17+
);
18+
19+
result
20+
.then((response) {
21+
print(response);
22+
}).catchError((error) {
23+
print(error.response);
24+
});
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'package:dart_appwrite/dart_appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Database database = Database(client);
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 = database.createIndex(
14+
collectionId: '[COLLECTION_ID]',
15+
key: '',
16+
type: 'key',
17+
attributes: [],
18+
);
19+
20+
result
21+
.then((response) {
22+
print(response);
23+
}).catchError((error) {
24+
print(error.response);
25+
});
26+
}

0 commit comments

Comments
 (0)