Skip to content

Commit a93cae2

Browse files
feat: support for 0.13.0
1 parent 6467698 commit a93cae2

Some content is hidden

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

73 files changed

+1188
-377
lines changed

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.12.1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.13.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.12.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.13.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
Lines changed: 23 additions & 0 deletions
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+
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.updateSession(
14+
sessionId: '[SESSION_ID]',
15+
);
16+
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}

docs/examples/functions/create-tag.md renamed to docs/examples/functions/create-deployment.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ void main() { // Init SDK
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = functions.createTag(
13+
Future result = functions.createDeployment(
1414
functionId: '[FUNCTION_ID]',
15-
command: '[COMMAND]',
15+
entrypoint: '[ENTRYPOINT]',
1616
code: await MultipartFile.fromPath('code', './path-to-files/image.jpg', 'image.jpg'),
17+
activate: false,
1718
);
1819

1920
result

docs/examples/functions/delete-tag.md renamed to docs/examples/functions/delete-deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ void main() { // Init SDK
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = functions.deleteTag(
13+
Future result = functions.deleteDeployment(
1414
functionId: '[FUNCTION_ID]',
15-
tagId: '[TAG_ID]',
15+
deploymentId: '[DEPLOYMENT_ID]',
1616
);
1717

1818
result
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ void main() { // Init SDK
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = functions.updateTag(
13+
Future result = functions.getDeployment(
1414
functionId: '[FUNCTION_ID]',
15-
tag: '[TAG]',
15+
deploymentId: '[DEPLOYMENT_ID]',
1616
);
1717

1818
result

docs/examples/functions/list-tags.md renamed to docs/examples/functions/list-deployments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void main() { // Init SDK
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = functions.listTags(
13+
Future result = functions.listDeployments(
1414
functionId: '[FUNCTION_ID]',
1515
);
1616

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+
Functions functions = Functions(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 = functions.retryBuild(
14+
functionId: '[FUNCTION_ID]',
15+
deploymentId: '[DEPLOYMENT_ID]',
16+
buildId: '[BUILD_ID]',
17+
);
18+
19+
result
20+
.then((response) {
21+
print(response);
22+
}).catchError((error) {
23+
print(error.response);
24+
});
25+
}

docs/examples/functions/get-tag.md renamed to docs/examples/functions/update-deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ void main() { // Init SDK
1010
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1111
;
1212

13-
Future result = functions.getTag(
13+
Future result = functions.updateDeployment(
1414
functionId: '[FUNCTION_ID]',
15-
tagId: '[TAG_ID]',
15+
deploymentId: '[DEPLOYMENT_ID]',
1616
);
1717

1818
result
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+
Storage storage = Storage(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 = storage.createBucket(
14+
bucketId: '[BUCKET_ID]',
15+
name: '[NAME]',
16+
permission: 'file',
17+
);
18+
19+
result
20+
.then((response) {
21+
print(response);
22+
}).catchError((error) {
23+
print(error.response);
24+
});
25+
}

docs/examples/storage/create-file.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

1414
Future result = storage.createFile(
15+
bucketId: '[BUCKET_ID]',
1516
fileId: '[FILE_ID]',
1617
file: await MultipartFile.fromPath('file', './path-to-files/image.jpg', 'image.jpg'),
1718
);

0 commit comments

Comments
 (0)