diff --git a/CHANGELOG.md b/CHANGELOG.md index b1f1e1b1..290809b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# Change Log + +## 16.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Remove `search` param from `listExecutions` method + ## 14.0.0 * Breaking changes: diff --git a/README.md b/README.md index 555b377c..f859780e 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ [![pub package](https://img.shields.io/pub/v/dart_appwrite.svg?style=flat-square)](https://pub.dartlang.org/packages/dart_appwrite) ![License](https://img.shields.io/github/license/appwrite/sdk-for-dart.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.x-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.x-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).** +**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).** > 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) @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - dart_appwrite: ^15.0.0 + dart_appwrite: ^16.0.0 ``` You can install packages from the command line: diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 2363017b..7b1cc083 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index bd423de9..2305367d 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index b57a5f06..e9696f92 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 205e2449..4288c71c 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 3c071b82..791b9cbd 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 38ffb363..87797fa6 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 5578e32f..62f3eaf2 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index d89ccd1d..5ebe0e9e 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index a23fa723..4a26a9fd 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index e59ad503..7011b3cf 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index a47ad80f..8616834b 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 0479b71c..f56d4227 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 209f5502..1e56fc71 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 414a193a..150833cd 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 59523e62..f0384f46 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index a0db3ccc..124e6ada 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 27a5883c..efd5263e 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index ffbe4160..d02808bb 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index ae93cf9b..9406ca39 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 2b201831..b073d402 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 355075c8..94e10db1 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index c4b4aced..3a81954b 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 64c923ce..76a139a4 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 28996370..a0b67851 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 78f527ca..d3c50af1 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 1140e5c0..32b269fb 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 0a512d43..73cf462a 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 91c701f8..cf6a56ed 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index f029979e..947d862e 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index e9f24349..475e464f 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 3f5d6997..5a0f98f5 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 2843d2f1..749c4cd6 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 0ee6e92d..7e274f0e 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 4eb46121..82cc3358 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index d379268e..27d360ba 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 0648c637..046dd0a7 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID Account account = Account(client); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index bb7443dd..f4b0c6fe 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 996e057b..d861561b 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 1c555085..f4533cbe 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 5c4c0735..162ad58a 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index cb1930c1..a317a084 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 502522ce..2ee15d60 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 1f0d0c1a..61904fd3 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index ba298590..8d528751 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -11,5 +11,5 @@ UInt8List result = await avatars.getBrowser( code: Browser.avantBrowser, width: 0, // (optional) height: 0, // (optional) - quality: 0, // (optional) + quality: -1, // (optional) ); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index e8495823..88fe35eb 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -11,5 +11,5 @@ UInt8List result = await avatars.getCreditCard( code: CreditCard.americanExpress, width: 0, // (optional) height: 0, // (optional) - quality: 0, // (optional) + quality: -1, // (optional) ); diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index d6d8c654..d4cd8eae 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index cda8d0fd..56046681 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -11,5 +11,5 @@ UInt8List result = await avatars.getFlag( code: Flag.afghanistan, width: 0, // (optional) height: 0, // (optional) - quality: 0, // (optional) + quality: -1, // (optional) ); diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index da2541f3..b6db1858 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index f1261d1c..7dc0989b 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 1a9e906c..f64fe8a4 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 65537bab..13ca9928 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 8b01aaad..61401761 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 6a53b045..25910114 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 10382e3a..1c9af511 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,9 +1,10 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setSession(''); // The user session to authenticate with + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setKey('') // Your secret API key + .setJWT(''); // Your secret JSON Web Token Databases databases = Databases(client); diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md new file mode 100644 index 00000000..7b4409a0 --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.createDocuments( + databaseId: '', + collectionId: '', + documents: [], +); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index fe77148e..216d0202 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index f0bdb6a6..d45ca447 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 29568ca0..75d47f44 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index b7c0c04b..c3fa1abd 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key @@ -14,4 +14,5 @@ Index result = await databases.createIndex( type: IndexType.key, attributes: [], orders: [], // (optional) + lengths: [], // (optional) ); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 35b60850..6511696f 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index a7c3116b..10ddb47b 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 37ba8eb7..dcdf34fc 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 974c7dad..8785ea76 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 034ee47d..9088f8df 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 199b982f..a2e978bd 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index f0bcf3b0..f9cbbd42 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index b97f2740..919e1789 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 89347017..dd04d899 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md new file mode 100644 index 00000000..66bd5584 --- /dev/null +++ b/docs/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +await databases.deleteDocuments( + databaseId: '', + collectionId: '', + queries: [], // (optional) +); diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 9f0e92f6..f16c84b9 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 0d4853d6..5e9042e5 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 33e4a4a6..8329f8db 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 42dcea34..b6784201 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index ecda80ef..45745186 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 0bbf4f55..84825796 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index b2c0a0a2..28d3d2bd 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 4bacaa97..64aaf331 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index e9bc5107..69c2a0fe 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 244d4a7d..cdecc59e 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index e9534e78..38b95d5d 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 2678ede9..2de4e97c 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 489ce409..46e3ef4c 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index a8d1593c..c3c565b2 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 73f61e26..ddc8f26a 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index c25b23f2..47a1867c 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md new file mode 100644 index 00000000..70b7cbf8 --- /dev/null +++ b/docs/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.updateDocuments( + databaseId: '', + collectionId: '', + data: {}, // (optional) + queries: [], // (optional) +); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 37bcd4d7..ee0e0971 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index f47078c8..61ef4d08 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index b85ebf7a..36f360ee 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 486c1927..9089cc8b 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index dc83bd00..e698a59e 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 6d14f52d..28aac964 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index f9498aa3..7674f51c 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 20c11faf..3aaa01b4 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 0139f280..a46f1163 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md new file mode 100644 index 00000000..46611b3b --- /dev/null +++ b/docs/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Databases databases = Databases(client); + +DocumentList result = await databases.upsertDocuments( + databaseId: '', + collectionId: '', + documents: [], // (optional) +); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 297bdc61..f459b3dd 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-duplicate-deployment.md similarity index 70% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index 2835f823..34ff5b20 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -1,13 +1,13 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key Functions functions = Functions(client); - result = await functions.createBuild( +Deployment result = await functions.createDuplicateDeployment( functionId: '', deploymentId: '', buildId: '', // (optional) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 2bf146e2..2ae64bce 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md new file mode 100644 index 00000000..cc293b0c --- /dev/null +++ b/docs/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createTemplateDeployment( + functionId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', + activate: false, // (optional) +); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 5333f88d..03e36d82 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key @@ -11,4 +11,5 @@ Variable result = await functions.createVariable( functionId: '', key: '', value: '', + secret: false, // (optional) ); diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md new file mode 100644 index 00000000..ed315a54 --- /dev/null +++ b/docs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Functions functions = Functions(client); + +Deployment result = await functions.createVcsDeployment( + functionId: '', + type: VCSDeploymentType.branch, + reference: '', + activate: false, // (optional) +); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index b4283a99..f3f26830 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key @@ -25,9 +25,5 @@ Func result = await functions.create( providerBranch: '', // (optional) providerSilentMode: false, // (optional) providerRootDirectory: '', // (optional) - templateRepository: '', // (optional) - templateOwner: '', // (optional) - templateRootDirectory: '', // (optional) - templateVersion: '', // (optional) specification: '', // (optional) ); diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index e7938124..8e4167f7 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index a69267f6..d077bc93 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 1a52f916..d4b28328 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 9ee35f1a..38d360b7 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index bbf9561e..e7bbacf3 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key @@ -10,4 +10,5 @@ Functions functions = Functions(client); UInt8List result = await functions.getDeploymentDownload( functionId: '', deploymentId: '', + type: DeploymentDownloadType.source, // (optional) ); diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index e2438024..805ca0b6 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 3ba1795f..e0026e0c 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index e9ba9591..fe61cee5 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index e81ac8d1..c92a4f74 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index c2db9a76..d07d2b32 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 573634e7..1dfd3909 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -10,5 +10,4 @@ Functions functions = Functions(client); ExecutionList result = await functions.listExecutions( functionId: '', queries: [], // (optional) - search: '', // (optional) ); diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index d2316a96..a99f872b 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 4a773169..bec5d5e6 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 6c882090..0fa3b002 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 96516e70..8eaeec06 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment-status.md similarity index 68% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-deployment-status.md index 61e4d22e..2b068098 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment-status.md @@ -1,13 +1,13 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key Functions functions = Functions(client); -Func result = await functions.updateDeployment( +Deployment result = await functions.updateDeploymentStatus( functionId: '', deploymentId: '', ); diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-function-deployment.md similarity index 69% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-function-deployment.md index ecd4d37b..0a5c09dd 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-function-deployment.md @@ -1,13 +1,13 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key Functions functions = Functions(client); -Build result = await functions.updateDeploymentBuild( +Func result = await functions.updateFunctionDeployment( functionId: '', deploymentId: '', ); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 570d4df3..7330d9f8 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key @@ -12,4 +12,5 @@ Variable result = await functions.updateVariable( variableId: '', key: '', value: '', // (optional) + secret: false, // (optional) ); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 42aff7b8..ebe3be8c 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 1eed406b..a8874985 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 3e2700cd..2dca8f29 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index d492d0e3..395d1f84 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 9a3ccbd0..6312e3cb 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 2c1c60b7..eac30a6a 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 201f787f..25ad9607 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 324a6420..6f80718f 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index dab221fb..d544fbfc 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 42b3913f..b48623ec 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index bdd2913b..d72ac97b 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 66f58227..b9d8e8bc 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 1b3666d6..3074cbb8 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 83689100..727fd239 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 074d1a82..32d3e3bb 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 5960e944..93ec9938 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 9b287116..4ffd769d 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 80ad6d25..fab19875 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index d0b443e3..89a3d031 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index a8990b1d..473dcd15 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 10e5787e..523c1007 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 34b8f7e3..c33cf555 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index d3745bca..cb6c5721 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 539e0984..f4439957 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 6286018d..31344908 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index b5b6878b..dec6f068 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 0b37c79f..9f9eac9f 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 9c8fb6d2..276738ea 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index e114831e..59596c62 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 6f73ed37..2a2d32ea 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 404b9a12..6b8343c6 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 8e74090b..48247d98 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 3a2d54b6..2376f189 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index fc7c30ef..82c1eb5d 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index de06809f..78c695c7 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 480a6ed5..25c2cb8c 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 6617ff8c..10d803d6 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 785c55ce..b283b753 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index e496de9d..58d82c7a 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 2f6d51d2..e759a260 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 8d31dc63..04a71587 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 352369a8..6201987f 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 5fdd4c84..5fd4859f 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setJWT(''); // Your secret JSON Web Token diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 4fef6312..5417b951 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index b7b456de..4cf6463b 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 0e831032..67e47412 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 1d9e4f44..8c3370ba 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 2bbad659..d625f382 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 189cdb31..361bacc2 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 7cfbdae0..e4a044c2 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setJWT(''); // Your secret JSON Web Token diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index a64056fc..59c5592c 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 0cbc89ab..14b680ae 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index b95babd1..ccc98961 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 1ba21b81..a82ef157 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 9a6711ba..03f78b7f 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 2418390f..204f8757 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 09c669dd..1d2b1805 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index e58ab7f7..2c0a142e 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index fb8b6296..9f40a5fa 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 5ff2ac53..df7a8a02 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 8ccbe9c8..3a9593ca 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 81db0613..19d907cd 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index af02c235..5a327773 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index afb80a24..0ab02eaa 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1516056c..c5fdb490 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 72eb8744..edc0a1f7 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a53209ab..b725cee5 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 4b2bf6bd..1e2d8a8c 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 6acc4950..c042a6fa 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 10a8aa16..24290e95 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index f5d75332..f7cc117b 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index ce00ee26..53b8c33d 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 795d03e9..f4356dee 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index c85e62ee..16530c01 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index d313321a..4bf76fbc 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index dc966ecc..86bb9857 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 8c149c57..5311fd5e 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index a246dd62..8ace9752 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index d848a648..e0d95d1c 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md new file mode 100644 index 00000000..93f9615b --- /dev/null +++ b/docs/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +import 'dart:io'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createDeployment( + siteId: '', + code: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'), + activate: false, + installCommand: '', // (optional) + buildCommand: '', // (optional) + outputDirectory: '', // (optional) +); diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 00000000..1a3e84a3 --- /dev/null +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createDuplicateDeployment( + siteId: '', + deploymentId: '', +); diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md new file mode 100644 index 00000000..348b4652 --- /dev/null +++ b/docs/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createTemplateDeployment( + siteId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', + activate: false, // (optional) +); diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md new file mode 100644 index 00000000..aa3c8761 --- /dev/null +++ b/docs/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.createVariable( + siteId: '', + key: '', + value: '', + secret: false, // (optional) +); diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md new file mode 100644 index 00000000..50f65b96 --- /dev/null +++ b/docs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.createVcsDeployment( + siteId: '', + type: VCSDeploymentType.branch, + reference: '', + activate: false, // (optional) +); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md new file mode 100644 index 00000000..448abab1 --- /dev/null +++ b/docs/examples/sites/create.md @@ -0,0 +1,29 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.create( + siteId: '', + name: '', + framework: .analog, + buildRuntime: .node145, + enabled: false, // (optional) + logging: false, // (optional) + timeout: 1, // (optional) + installCommand: '', // (optional) + buildCommand: '', // (optional) + outputDirectory: '', // (optional) + adapter: .static, // (optional) + installationId: '', // (optional) + fallbackFile: '', // (optional) + providerRepositoryId: '', // (optional) + providerBranch: '', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '', // (optional) + specification: '', // (optional) +); diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md new file mode 100644 index 00000000..ca93ac66 --- /dev/null +++ b/docs/examples/sites/delete-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteDeployment( + siteId: '', + deploymentId: '', +); diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md new file mode 100644 index 00000000..c11ecab7 --- /dev/null +++ b/docs/examples/sites/delete-log.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteLog( + siteId: '', + logId: '', +); diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md new file mode 100644 index 00000000..f04b9451 --- /dev/null +++ b/docs/examples/sites/delete-variable.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +await sites.deleteVariable( + siteId: '', + variableId: '', +); diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md new file mode 100644 index 00000000..e81df372 --- /dev/null +++ b/docs/examples/sites/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +await sites.delete( + siteId: '', +); diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md new file mode 100644 index 00000000..ad21070b --- /dev/null +++ b/docs/examples/sites/get-deployment-download.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +UInt8List result = await sites.getDeploymentDownload( + siteId: '', + deploymentId: '', + type: DeploymentDownloadType.source, // (optional) +); diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md new file mode 100644 index 00000000..9acc89b5 --- /dev/null +++ b/docs/examples/sites/get-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.getDeployment( + siteId: '', + deploymentId: '', +); diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md new file mode 100644 index 00000000..195f8aad --- /dev/null +++ b/docs/examples/sites/get-log.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Execution result = await sites.getLog( + siteId: '', + logId: '', +); diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md new file mode 100644 index 00000000..637e08a5 --- /dev/null +++ b/docs/examples/sites/get-variable.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.getVariable( + siteId: '', + variableId: '', +); diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md new file mode 100644 index 00000000..32abcfcf --- /dev/null +++ b/docs/examples/sites/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.get( + siteId: '', +); diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md new file mode 100644 index 00000000..6f6c9ce3 --- /dev/null +++ b/docs/examples/sites/list-deployments.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +DeploymentList result = await sites.listDeployments( + siteId: '', + queries: [], // (optional) + search: '', // (optional) +); diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md new file mode 100644 index 00000000..72a600fa --- /dev/null +++ b/docs/examples/sites/list-frameworks.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +FrameworkList result = await sites.listFrameworks(); diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md new file mode 100644 index 00000000..4ccf170f --- /dev/null +++ b/docs/examples/sites/list-logs.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +ExecutionList result = await sites.listLogs( + siteId: '', + queries: [], // (optional) +); diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md new file mode 100644 index 00000000..b81faf0e --- /dev/null +++ b/docs/examples/sites/list-specifications.md @@ -0,0 +1,10 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +SpecificationList result = await sites.listSpecifications(); diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md new file mode 100644 index 00000000..14be9662 --- /dev/null +++ b/docs/examples/sites/list-variables.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +VariableList result = await sites.listVariables( + siteId: '', +); diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md new file mode 100644 index 00000000..0dd52262 --- /dev/null +++ b/docs/examples/sites/list.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +SiteList result = await sites.list( + queries: [], // (optional) + search: '', // (optional) +); diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md new file mode 100644 index 00000000..bd031cf2 --- /dev/null +++ b/docs/examples/sites/update-deployment-status.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Deployment result = await sites.updateDeploymentStatus( + siteId: '', + deploymentId: '', +); diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md new file mode 100644 index 00000000..dbb4e27a --- /dev/null +++ b/docs/examples/sites/update-site-deployment.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.updateSiteDeployment( + siteId: '', + deploymentId: '', +); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md new file mode 100644 index 00000000..af2123c9 --- /dev/null +++ b/docs/examples/sites/update-variable.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Variable result = await sites.updateVariable( + siteId: '', + variableId: '', + key: '', + value: '', // (optional) + secret: false, // (optional) +); diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md new file mode 100644 index 00000000..c13acfb2 --- /dev/null +++ b/docs/examples/sites/update.md @@ -0,0 +1,29 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Sites sites = Sites(client); + +Site result = await sites.update( + siteId: '', + name: '', + framework: .analog, + enabled: false, // (optional) + logging: false, // (optional) + timeout: 1, // (optional) + installCommand: '', // (optional) + buildCommand: '', // (optional) + outputDirectory: '', // (optional) + buildRuntime: .node145, // (optional) + adapter: .static, // (optional) + fallbackFile: '', // (optional) + installationId: '', // (optional) + providerRepositoryId: '', // (optional) + providerBranch: '', // (optional) + providerSilentMode: false, // (optional) + providerRootDirectory: '', // (optional) + specification: '', // (optional) +); diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index e9b817f3..c09a4f2c 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 0e06f422..e631416e 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 51fa7aaf..1eb1b51c 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 25f74b68..26dd602c 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 20dfac75..3464d223 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index ddbc538b..8c119c38 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -10,4 +10,5 @@ Storage storage = Storage(client); UInt8List result = await storage.getFileDownload( bucketId: '', fileId: '', + token: '', // (optional) ); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 0f9cada9..a1f3c09b 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -13,7 +13,7 @@ UInt8List result = await storage.getFilePreview( width: 0, // (optional) height: 0, // (optional) gravity: ImageGravity.center, // (optional) - quality: 0, // (optional) + quality: -1, // (optional) borderWidth: 0, // (optional) borderColor: '', // (optional) borderRadius: 0, // (optional) @@ -21,4 +21,5 @@ UInt8List result = await storage.getFilePreview( rotation: -360, // (optional) background: '', // (optional) output: ImageFormat.jpg, // (optional) + token: '', // (optional) ); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index d9854177..d48b51c1 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with @@ -10,4 +10,5 @@ Storage storage = Storage(client); UInt8List result = await storage.getFileView( bucketId: '', fileId: '', + token: '', // (optional) ); diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index c79b608c..f765c623 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 7d9afb7e..c20dac19 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 02e52ba4..28f85b09 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 23bfdb73..b4e45e05 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index d03e6040..966883a1 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 96b037a1..f13a6e69 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index f6575bc4..772f3cfa 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 6f495ef4..9d99cbbd 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 021368cb..1c08ab8e 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 1d5c3b35..0bdc63f8 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 1e89d0e2..e2063933 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 31d238ab..bb3bcaf7 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 1cb91dd4..3c01dec4 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index e4c764c5..093a139f 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 71c34366..c947162f 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 256c0823..87a43258 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index a1727ced..fe3a9faa 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 1b3208b7..57518ada 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md new file mode 100644 index 00000000..cc75a917 --- /dev/null +++ b/docs/examples/tokens/create-file-token.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.createFileToken( + bucketId: '', + fileId: '', + expire: '', // (optional) +); diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md new file mode 100644 index 00000000..ce95e7b7 --- /dev/null +++ b/docs/examples/tokens/delete.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Tokens tokens = Tokens(client); + +await tokens.delete( + tokenId: '', +); diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md new file mode 100644 index 00000000..3112b5e1 --- /dev/null +++ b/docs/examples/tokens/get.md @@ -0,0 +1,12 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.get( + tokenId: '', +); diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md new file mode 100644 index 00000000..5331e44d --- /dev/null +++ b/docs/examples/tokens/list.md @@ -0,0 +1,14 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceTokenList result = await tokens.list( + bucketId: '', + fileId: '', + queries: [], // (optional) +); diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md new file mode 100644 index 00000000..47e910d5 --- /dev/null +++ b/docs/examples/tokens/update.md @@ -0,0 +1,13 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +Tokens tokens = Tokens(client); + +ResourceToken result = await tokens.update( + tokenId: '', + expire: '', // (optional) +); diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 68dd9884..38b0255e 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index cb000391..aa898ba2 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 2a9c67be..6e8b7a2b 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 4ade88bc..e08edd61 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 598cef49..c2b9562e 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 1c95cbe2..9f23baae 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 17122072..628cf329 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 063fc97d..34bfbf66 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 03717bd7..20cf911a 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 013707bc..4293e7ed 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 88c0c19e..354a8dbb 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 16040215..ab7acba3 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index a0f0c3fe..b4953748 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 07ba4976..7ac2da90 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index d48ab6d4..eed7dbd4 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index a2c985a7..68d243e5 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index e86e0e29..07c3566a 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index bae674cd..aa27b32d 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index dbee4e8c..93819b72 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 1e8baf2b..cf66c676 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 9fa4c8bd..146cff68 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 2a62d94e..9ddaafb5 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 04dfcb6a..a171b795 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index aa20d3f6..2c14775e 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 18b34a10..5885dcb8 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 495ab938..dabe5a12 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key @@ -9,4 +9,6 @@ Users users = Users(client); MembershipList result = await users.listMemberships( userId: '', + queries: [], // (optional) + search: '', // (optional) ); diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index cca4df00..7134ee5d 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 4e1a47bc..22a37c05 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 459d0cd4..971fbea0 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index b909d76e..6d34bb47 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index e350eb68..9930e30b 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index af995fc5..129a8e24 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 5cd609d2..d247bf5e 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 3fdfc7c5..3b7d81f5 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index e1efba91..f26b1055 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 2a742bcc..905cee0e 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 8650291b..14e27482 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index cb8efa4a..b57aafab 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 5334986f..aa891d23 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 2a1f0572..87fc2968 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 2948e6e6..4d8dca03 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index c3e90717..f66f0b74 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,7 +1,7 @@ import 'package:dart_appwrite/dart_appwrite.dart'; Client client = Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/lib/dart_appwrite.dart b/lib/dart_appwrite.dart index 26412fe3..0848a050 100644 --- a/lib/dart_appwrite.dart +++ b/lib/dart_appwrite.dart @@ -1,6 +1,6 @@ /// Appwrite Dart SDK /// -/// This SDK is compatible with Appwrite server version 1.6.x. +/// 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). library dart_appwrite; @@ -35,6 +35,8 @@ part 'services/graphql.dart'; part 'services/health.dart'; part 'services/locale.dart'; part 'services/messaging.dart'; +part 'services/sites.dart'; part 'services/storage.dart'; part 'services/teams.dart'; +part 'services/tokens.dart'; part 'services/users.dart'; diff --git a/lib/enums.dart b/lib/enums.dart index 313d70c2..dd69b671 100644 --- a/lib/enums.dart +++ b/lib/enums.dart @@ -11,10 +11,15 @@ part 'src/enums/relationship_type.dart'; part 'src/enums/relation_mutate.dart'; part 'src/enums/index_type.dart'; part 'src/enums/runtime.dart'; +part 'src/enums/vcs_deployment_type.dart'; +part 'src/enums/deployment_download_type.dart'; part 'src/enums/execution_method.dart'; part 'src/enums/name.dart'; part 'src/enums/message_priority.dart'; part 'src/enums/smtp_encryption.dart'; +part 'src/enums/framework.dart'; +part 'src/enums/build_runtime.dart'; +part 'src/enums/adapter.dart'; part 'src/enums/compression.dart'; part 'src/enums/image_gravity.dart'; part 'src/enums/image_format.dart'; diff --git a/lib/models.dart b/lib/models.dart index 98fd7d19..59b862d5 100644 --- a/lib/models.dart +++ b/lib/models.dart @@ -12,9 +12,12 @@ part 'src/models/identity_list.dart'; part 'src/models/log_list.dart'; part 'src/models/file_list.dart'; part 'src/models/bucket_list.dart'; +part 'src/models/resource_token_list.dart'; part 'src/models/team_list.dart'; part 'src/models/membership_list.dart'; +part 'src/models/site_list.dart'; part 'src/models/function_list.dart'; +part 'src/models/framework_list.dart'; part 'src/models/runtime_list.dart'; part 'src/models/deployment_list.dart'; part 'src/models/execution_list.dart'; @@ -64,13 +67,16 @@ part 'src/models/locale.dart'; part 'src/models/locale_code.dart'; part 'src/models/file.dart'; part 'src/models/bucket.dart'; +part 'src/models/resource_token.dart'; part 'src/models/team.dart'; part 'src/models/membership.dart'; +part 'src/models/site.dart'; part 'src/models/function.dart'; part 'src/models/runtime.dart'; +part 'src/models/framework.dart'; +part 'src/models/framework_adapter.dart'; part 'src/models/deployment.dart'; part 'src/models/execution.dart'; -part 'src/models/build.dart'; part 'src/models/variable.dart'; part 'src/models/country.dart'; part 'src/models/continent.dart'; diff --git a/lib/services/databases.dart b/lib/services/databases.dart index 6727adbb..4b26a220 100644 --- a/lib/services/databases.dart +++ b/lib/services/databases.dart @@ -1098,7 +1098,6 @@ class Databases extends Service { /// collection resource using either a [server /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) /// API or directly from your database console. - /// Future createDocument({ required String databaseId, required String collectionId, @@ -1129,6 +1128,117 @@ class Databases extends Service { return models.Document.fromMap(res.data); } + /// Create new Documents. Before using this route, you should create a new + /// collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. + Future createDocuments({ + required String databaseId, + required String collectionId, + required List documents, + }) async { + final String apiPath = + '/databases/{databaseId}/collections/{collectionId}/documents' + .replaceAll('{databaseId}', databaseId) + .replaceAll('{collectionId}', collectionId); + + final Map apiParams = {'documents': documents}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.DocumentList.fromMap(res.data); + } + + /// Create or update Documents. Before using this route, you should create a + /// new collection resource using either a [server + /// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) + /// API or directly from your database console. + /// + Future upsertDocuments({ + required String databaseId, + required String collectionId, + List? documents, + }) async { + final String apiPath = + '/databases/{databaseId}/collections/{collectionId}/documents' + .replaceAll('{databaseId}', databaseId) + .replaceAll('{collectionId}', collectionId); + + final Map apiParams = {'documents': documents}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.put, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.DocumentList.fromMap(res.data); + } + + /// Update all documents that match your queries, if no queries are submitted + /// then all documents are updated. You can pass only specific fields to be + /// updated. + Future updateDocuments({ + required String databaseId, + required String collectionId, + Map? data, + List? queries, + }) async { + final String apiPath = + '/databases/{databaseId}/collections/{collectionId}/documents' + .replaceAll('{databaseId}', databaseId) + .replaceAll('{collectionId}', collectionId); + + final Map apiParams = {'data': data, 'queries': queries}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.patch, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.DocumentList.fromMap(res.data); + } + + /// Bulk delete documents using queries, if no queries are passed then all + /// documents are deleted. + Future deleteDocuments({ + required String databaseId, + required String collectionId, + List? queries, + }) async { + final String apiPath = + '/databases/{databaseId}/collections/{collectionId}/documents' + .replaceAll('{databaseId}', databaseId) + .replaceAll('{collectionId}', collectionId); + + final Map apiParams = {'queries': queries}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.delete, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.DocumentList.fromMap(res.data); + } + /// Get a document by its unique ID. This endpoint response returns a JSON /// object with the document data. Future getDocument({ @@ -1250,6 +1360,7 @@ class Databases extends Service { required enums.IndexType type, required List attributes, List? orders, + List? lengths, }) async { final String apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes' @@ -1261,6 +1372,7 @@ class Databases extends Service { 'type': type.value, 'attributes': attributes, 'orders': orders, + 'lengths': lengths, }; final Map apiHeaders = {'content-type': 'application/json'}; diff --git a/lib/services/functions.dart b/lib/services/functions.dart index 60a5def9..e86f1afe 100644 --- a/lib/services/functions.dart +++ b/lib/services/functions.dart @@ -52,10 +52,6 @@ class Functions extends Service { String? providerBranch, bool? providerSilentMode, String? providerRootDirectory, - String? templateRepository, - String? templateOwner, - String? templateRootDirectory, - String? templateVersion, String? specification, }) async { final String apiPath = '/functions'; @@ -78,10 +74,6 @@ class Functions extends Service { 'providerBranch': providerBranch, 'providerSilentMode': providerSilentMode, 'providerRootDirectory': providerRootDirectory, - 'templateRepository': templateRepository, - 'templateOwner': templateOwner, - 'templateRootDirectory': templateRootDirectory, - 'templateVersion': templateVersion, 'specification': specification, }; @@ -116,7 +108,6 @@ class Functions extends Service { } /// List allowed function specifications for this instance. - /// Future listSpecifications() async { final String apiPath = '/functions/specifications'; @@ -234,7 +225,32 @@ class Functions extends Service { return res.data; } - /// Get a list of all the project's code deployments. You can use the query + /// Update the function active deployment. Use this endpoint to switch the code + /// deployment that should be used when visitor opens your function. + Future updateFunctionDeployment({ + required String functionId, + required String deploymentId, + }) async { + final String apiPath = '/functions/{functionId}/deployment'.replaceAll( + '{functionId}', + functionId, + ); + + final Map apiParams = {'deploymentId': deploymentId}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.patch, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Func.fromMap(res.data); + } + + /// Get a list of all the function's code deployments. You can use the query /// params to filter your results. Future listDeployments({ required String functionId, @@ -311,21 +327,28 @@ class Functions extends Service { return models.Deployment.fromMap(res.data); } - /// Get a code deployment by its unique ID. - Future getDeployment({ + /// Create a new build for an existing function deployment. This endpoint + /// allows you to rebuild a deployment with the updated function configuration, + /// including its entrypoint and build commands if they have been modified. The + /// build process will be queued and executed asynchronously. The original + /// deployment's code will be preserved and used for the new build. + Future createDuplicateDeployment({ required String functionId, required String deploymentId, + String? buildId, }) async { - final String apiPath = '/functions/{functionId}/deployments/{deploymentId}' - .replaceAll('{functionId}', functionId) - .replaceAll('{deploymentId}', deploymentId); + final String apiPath = '/functions/{functionId}/deployments/duplicate' + .replaceAll('{functionId}', functionId); - final Map apiParams = {}; + final Map apiParams = { + 'deploymentId': deploymentId, + 'buildId': buildId, + }; - final Map apiHeaders = {}; + final Map apiHeaders = {'content-type': 'application/json'}; final res = await client.call( - HttpMethod.get, + HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders, @@ -334,116 +357,127 @@ class Functions extends Service { return models.Deployment.fromMap(res.data); } - /// Update the function code deployment ID using the unique function ID. Use - /// this endpoint to switch the code deployment that should be executed by the - /// execution endpoint. - Future updateDeployment({ + /// Create a deployment based on a template. + /// + /// Use this endpoint with combination of + /// [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to + /// find the template details. + Future createTemplateDeployment({ required String functionId, - required String deploymentId, + required String repository, + required String owner, + required String rootDirectory, + required String version, + bool? activate, }) async { - final String apiPath = '/functions/{functionId}/deployments/{deploymentId}' - .replaceAll('{functionId}', functionId) - .replaceAll('{deploymentId}', deploymentId); + final String apiPath = '/functions/{functionId}/deployments/template' + .replaceAll('{functionId}', functionId); - final Map apiParams = {}; + final Map apiParams = { + 'repository': repository, + 'owner': owner, + 'rootDirectory': rootDirectory, + 'version': version, + 'activate': activate, + }; final Map apiHeaders = {'content-type': 'application/json'}; final res = await client.call( - HttpMethod.patch, + HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders, ); - return models.Func.fromMap(res.data); + return models.Deployment.fromMap(res.data); } - /// Delete a code deployment by its unique ID. - Future deleteDeployment({ + /// Create a deployment when a function is connected to VCS. + /// + /// This endpoint lets you create deployment from a branch, commit, or a tag. + Future createVcsDeployment({ required String functionId, - required String deploymentId, + required enums.VCSDeploymentType type, + required String reference, + bool? activate, }) async { - final String apiPath = '/functions/{functionId}/deployments/{deploymentId}' - .replaceAll('{functionId}', functionId) - .replaceAll('{deploymentId}', deploymentId); + final String apiPath = '/functions/{functionId}/deployments/vcs'.replaceAll( + '{functionId}', + functionId, + ); - final Map apiParams = {}; + final Map apiParams = { + 'type': type.value, + 'reference': reference, + 'activate': activate, + }; final Map apiHeaders = {'content-type': 'application/json'}; final res = await client.call( - HttpMethod.delete, + HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders, ); - return res.data; + return models.Deployment.fromMap(res.data); } - /// Create a new build for an existing function deployment. This endpoint - /// allows you to rebuild a deployment with the updated function configuration, - /// including its entrypoint and build commands if they have been modified The - /// build process will be queued and executed asynchronously. The original - /// deployment's code will be preserved and used for the new build. - Future createBuild({ + /// Get a function deployment by its unique ID. + Future getDeployment({ required String functionId, required String deploymentId, - String? buildId, }) async { - final String apiPath = - '/functions/{functionId}/deployments/{deploymentId}/build' - .replaceAll('{functionId}', functionId) - .replaceAll('{deploymentId}', deploymentId); + final String apiPath = '/functions/{functionId}/deployments/{deploymentId}' + .replaceAll('{functionId}', functionId) + .replaceAll('{deploymentId}', deploymentId); - final Map apiParams = {'buildId': buildId}; + final Map apiParams = {}; - final Map apiHeaders = {'content-type': 'application/json'}; + final Map apiHeaders = {}; final res = await client.call( - HttpMethod.post, + HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders, ); - return res.data; + return models.Deployment.fromMap(res.data); } - /// Cancel an ongoing function deployment build. If the build is already in - /// progress, it will be stopped and marked as canceled. If the build hasn't - /// started yet, it will be marked as canceled without executing. You cannot - /// cancel builds that have already completed (status 'ready') or failed. The - /// response includes the final build status and details. - Future updateDeploymentBuild({ + /// Delete a code deployment by its unique ID. + Future deleteDeployment({ required String functionId, required String deploymentId, }) async { - final String apiPath = - '/functions/{functionId}/deployments/{deploymentId}/build' - .replaceAll('{functionId}', functionId) - .replaceAll('{deploymentId}', deploymentId); + final String apiPath = '/functions/{functionId}/deployments/{deploymentId}' + .replaceAll('{functionId}', functionId) + .replaceAll('{deploymentId}', deploymentId); final Map apiParams = {}; final Map apiHeaders = {'content-type': 'application/json'}; final res = await client.call( - HttpMethod.patch, + HttpMethod.delete, path: apiPath, params: apiParams, headers: apiHeaders, ); - return models.Build.fromMap(res.data); + return res.data; } - /// Get a Deployment's contents by its unique ID. This endpoint supports range - /// requests for partial or streaming file download. + /// Get a function deployment content by its unique ID. The endpoint response + /// return with a 'Content-Disposition: attachment' header that tells the + /// browser to start downloading the file to user downloads directory. Future getDeploymentDownload({ required String functionId, required String deploymentId, + enums.DeploymentDownloadType? type, }) async { final String apiPath = '/functions/{functionId}/deployments/{deploymentId}/download' @@ -451,6 +485,8 @@ class Functions extends Service { .replaceAll('{deploymentId}', deploymentId); final Map params = { + 'type': type?.value, + 'project': client.config['project'], 'key': client.config['key'], }; @@ -464,22 +500,46 @@ class Functions extends Service { return res.data; } + /// Cancel an ongoing function deployment build. If the build is already in + /// progress, it will be stopped and marked as canceled. If the build hasn't + /// started yet, it will be marked as canceled without executing. You cannot + /// cancel builds that have already completed (status 'ready') or failed. The + /// response includes the final build status and details. + Future updateDeploymentStatus({ + required String functionId, + required String deploymentId, + }) async { + final String apiPath = + '/functions/{functionId}/deployments/{deploymentId}/status' + .replaceAll('{functionId}', functionId) + .replaceAll('{deploymentId}', deploymentId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.patch, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Deployment.fromMap(res.data); + } + /// Get a list of all the current user function execution logs. You can use the /// query params to filter your results. Future listExecutions({ required String functionId, List? queries, - String? search, }) async { final String apiPath = '/functions/{functionId}/executions'.replaceAll( '{functionId}', functionId, ); - final Map apiParams = { - 'queries': queries, - 'search': search, - }; + final Map apiParams = {'queries': queries}; final Map apiHeaders = {}; @@ -556,7 +616,6 @@ class Functions extends Service { } /// Delete a function execution by its unique ID. - /// Future deleteExecution({ required String functionId, required String executionId, @@ -608,13 +667,18 @@ class Functions extends Service { required String functionId, required String key, required String value, + bool? secret, }) async { final String apiPath = '/functions/{functionId}/variables'.replaceAll( '{functionId}', functionId, ); - final Map apiParams = {'key': key, 'value': value}; + final Map apiParams = { + 'key': key, + 'value': value, + 'secret': secret, + }; final Map apiHeaders = {'content-type': 'application/json'}; @@ -657,12 +721,17 @@ class Functions extends Service { required String variableId, required String key, String? value, + bool? secret, }) async { final String apiPath = '/functions/{functionId}/variables/{variableId}' .replaceAll('{functionId}', functionId) .replaceAll('{variableId}', variableId); - final Map apiParams = {'key': key, 'value': value}; + final Map apiParams = { + 'key': key, + 'value': value, + 'secret': secret, + }; final Map apiHeaders = {'content-type': 'application/json'}; diff --git a/lib/services/sites.dart b/lib/services/sites.dart new file mode 100644 index 00000000..d89f2192 --- /dev/null +++ b/lib/services/sites.dart @@ -0,0 +1,704 @@ +part of '../dart_appwrite.dart'; + +/// The Sites Service allows you view, create and manage your web applications. +class Sites extends Service { + Sites(super.client); + + /// Get a list of all the project's sites. You can use the query params to + /// filter your results. + Future list({List? queries, String? search}) async { + final String apiPath = '/sites'; + + final Map apiParams = { + 'queries': queries, + 'search': search, + }; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.SiteList.fromMap(res.data); + } + + /// Create a new site. + Future create({ + required String siteId, + required String name, + required enums.Framework framework, + required enums.BuildRuntime buildRuntime, + bool? enabled, + bool? logging, + int? timeout, + String? installCommand, + String? buildCommand, + String? outputDirectory, + enums.Adapter? adapter, + String? installationId, + String? fallbackFile, + String? providerRepositoryId, + String? providerBranch, + bool? providerSilentMode, + String? providerRootDirectory, + String? specification, + }) async { + final String apiPath = '/sites'; + + final Map apiParams = { + 'siteId': siteId, + 'name': name, + 'framework': framework.value, + 'enabled': enabled, + 'logging': logging, + 'timeout': timeout, + 'installCommand': installCommand, + 'buildCommand': buildCommand, + 'outputDirectory': outputDirectory, + 'buildRuntime': buildRuntime.value, + 'adapter': adapter?.value, + 'installationId': installationId, + 'fallbackFile': fallbackFile, + 'providerRepositoryId': providerRepositoryId, + 'providerBranch': providerBranch, + 'providerSilentMode': providerSilentMode, + 'providerRootDirectory': providerRootDirectory, + 'specification': specification, + }; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Site.fromMap(res.data); + } + + /// Get a list of all frameworks that are currently available on the server + /// instance. + Future listFrameworks() async { + final String apiPath = '/sites/frameworks'; + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.FrameworkList.fromMap(res.data); + } + + /// List allowed site specifications for this instance. + Future listSpecifications() async { + final String apiPath = '/sites/specifications'; + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.SpecificationList.fromMap(res.data); + } + + /// Get a site by its unique ID. + Future get({required String siteId}) async { + final String apiPath = '/sites/{siteId}'.replaceAll('{siteId}', siteId); + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Site.fromMap(res.data); + } + + /// Update site by its unique ID. + Future update({ + required String siteId, + required String name, + required enums.Framework framework, + bool? enabled, + bool? logging, + int? timeout, + String? installCommand, + String? buildCommand, + String? outputDirectory, + enums.BuildRuntime? buildRuntime, + enums.Adapter? adapter, + String? fallbackFile, + String? installationId, + String? providerRepositoryId, + String? providerBranch, + bool? providerSilentMode, + String? providerRootDirectory, + String? specification, + }) async { + final String apiPath = '/sites/{siteId}'.replaceAll('{siteId}', siteId); + + final Map apiParams = { + 'name': name, + 'framework': framework.value, + 'enabled': enabled, + 'logging': logging, + 'timeout': timeout, + 'installCommand': installCommand, + 'buildCommand': buildCommand, + 'outputDirectory': outputDirectory, + 'buildRuntime': buildRuntime?.value, + 'adapter': adapter?.value, + 'fallbackFile': fallbackFile, + 'installationId': installationId, + 'providerRepositoryId': providerRepositoryId, + 'providerBranch': providerBranch, + 'providerSilentMode': providerSilentMode, + 'providerRootDirectory': providerRootDirectory, + 'specification': specification, + }; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.put, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Site.fromMap(res.data); + } + + /// Delete a site by its unique ID. + Future delete({required String siteId}) async { + final String apiPath = '/sites/{siteId}'.replaceAll('{siteId}', siteId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.delete, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return res.data; + } + + /// Update the site active deployment. Use this endpoint to switch the code + /// deployment that should be used when visitor opens your site. + Future updateSiteDeployment({ + required String siteId, + required String deploymentId, + }) async { + final String apiPath = '/sites/{siteId}/deployment'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = {'deploymentId': deploymentId}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.patch, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Site.fromMap(res.data); + } + + /// Get a list of all the site's code deployments. You can use the query params + /// to filter your results. + Future listDeployments({ + required String siteId, + List? queries, + String? search, + }) async { + final String apiPath = '/sites/{siteId}/deployments'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = { + 'queries': queries, + 'search': search, + }; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.DeploymentList.fromMap(res.data); + } + + /// Create a new site code deployment. Use this endpoint to upload a new + /// version of your site code. To activate your newly uploaded code, you'll + /// need to update the function's deployment to use your new deployment ID. + Future createDeployment({ + required String siteId, + required InputFile code, + required bool activate, + String? installCommand, + String? buildCommand, + String? outputDirectory, + Function(UploadProgress)? onProgress, + }) async { + final String apiPath = '/sites/{siteId}/deployments'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = { + 'installCommand': installCommand, + 'buildCommand': buildCommand, + 'outputDirectory': outputDirectory, + 'code': code, + 'activate': activate, + }; + + final Map apiHeaders = { + 'content-type': 'multipart/form-data', + }; + + String idParamName = ''; + final paramName = 'code'; + final res = await client.chunkedUpload( + path: apiPath, + params: apiParams, + paramName: paramName, + idParamName: idParamName, + headers: apiHeaders, + onProgress: onProgress, + ); + + return models.Deployment.fromMap(res.data); + } + + /// Create a new build for an existing site deployment. This endpoint allows + /// you to rebuild a deployment with the updated site configuration, including + /// its commands and output directory if they have been modified. The build + /// process will be queued and executed asynchronously. The original + /// deployment's code will be preserved and used for the new build. + Future createDuplicateDeployment({ + required String siteId, + required String deploymentId, + }) async { + final String apiPath = '/sites/{siteId}/deployments/duplicate'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = {'deploymentId': deploymentId}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Deployment.fromMap(res.data); + } + + /// Create a deployment based on a template. + /// + /// Use this endpoint with combination of + /// [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to + /// find the template details. + Future createTemplateDeployment({ + required String siteId, + required String repository, + required String owner, + required String rootDirectory, + required String version, + bool? activate, + }) async { + final String apiPath = '/sites/{siteId}/deployments/template'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = { + 'repository': repository, + 'owner': owner, + 'rootDirectory': rootDirectory, + 'version': version, + 'activate': activate, + }; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Deployment.fromMap(res.data); + } + + /// Create a deployment when a site is connected to VCS. + /// + /// This endpoint lets you create deployment from a branch, commit, or a tag. + Future createVcsDeployment({ + required String siteId, + required enums.VCSDeploymentType type, + required String reference, + bool? activate, + }) async { + final String apiPath = '/sites/{siteId}/deployments/vcs'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = { + 'type': type.value, + 'reference': reference, + 'activate': activate, + }; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Deployment.fromMap(res.data); + } + + /// Get a site deployment by its unique ID. + Future getDeployment({ + required String siteId, + required String deploymentId, + }) async { + final String apiPath = '/sites/{siteId}/deployments/{deploymentId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{deploymentId}', deploymentId); + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Deployment.fromMap(res.data); + } + + /// Delete a site deployment by its unique ID. + Future deleteDeployment({ + required String siteId, + required String deploymentId, + }) async { + final String apiPath = '/sites/{siteId}/deployments/{deploymentId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{deploymentId}', deploymentId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.delete, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return res.data; + } + + /// Get a site deployment content by its unique ID. The endpoint response + /// return with a 'Content-Disposition: attachment' header that tells the + /// browser to start downloading the file to user downloads directory. + Future getDeploymentDownload({ + required String siteId, + required String deploymentId, + enums.DeploymentDownloadType? type, + }) async { + final String apiPath = '/sites/{siteId}/deployments/{deploymentId}/download' + .replaceAll('{siteId}', siteId) + .replaceAll('{deploymentId}', deploymentId); + + final Map params = { + 'type': type?.value, + + 'project': client.config['project'], + 'key': client.config['key'], + }; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: params, + responseType: ResponseType.bytes, + ); + return res.data; + } + + /// Cancel an ongoing site deployment build. If the build is already in + /// progress, it will be stopped and marked as canceled. If the build hasn't + /// started yet, it will be marked as canceled without executing. You cannot + /// cancel builds that have already completed (status 'ready') or failed. The + /// response includes the final build status and details. + Future updateDeploymentStatus({ + required String siteId, + required String deploymentId, + }) async { + final String apiPath = '/sites/{siteId}/deployments/{deploymentId}/status' + .replaceAll('{siteId}', siteId) + .replaceAll('{deploymentId}', deploymentId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.patch, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Deployment.fromMap(res.data); + } + + /// Get a list of all site logs. You can use the query params to filter your + /// results. + Future listLogs({ + required String siteId, + List? queries, + }) async { + final String apiPath = '/sites/{siteId}/logs'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = {'queries': queries}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.ExecutionList.fromMap(res.data); + } + + /// Get a site request log by its unique ID. + Future getLog({ + required String siteId, + required String logId, + }) async { + final String apiPath = '/sites/{siteId}/logs/{logId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{logId}', logId); + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Execution.fromMap(res.data); + } + + /// Delete a site log by its unique ID. + Future deleteLog({required String siteId, required String logId}) async { + final String apiPath = '/sites/{siteId}/logs/{logId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{logId}', logId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.delete, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return res.data; + } + + /// Get a list of all variables of a specific site. + Future listVariables({required String siteId}) async { + final String apiPath = '/sites/{siteId}/variables'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.VariableList.fromMap(res.data); + } + + /// Create a new site variable. These variables can be accessed during build + /// and runtime (server-side rendering) as environment variables. + Future createVariable({ + required String siteId, + required String key, + required String value, + bool? secret, + }) async { + final String apiPath = '/sites/{siteId}/variables'.replaceAll( + '{siteId}', + siteId, + ); + + final Map apiParams = { + 'key': key, + 'value': value, + 'secret': secret, + }; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Variable.fromMap(res.data); + } + + /// Get a variable by its unique ID. + Future getVariable({ + required String siteId, + required String variableId, + }) async { + final String apiPath = '/sites/{siteId}/variables/{variableId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{variableId}', variableId); + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Variable.fromMap(res.data); + } + + /// Update variable by its unique ID. + Future updateVariable({ + required String siteId, + required String variableId, + required String key, + String? value, + bool? secret, + }) async { + final String apiPath = '/sites/{siteId}/variables/{variableId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{variableId}', variableId); + + final Map apiParams = { + 'key': key, + 'value': value, + 'secret': secret, + }; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.put, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.Variable.fromMap(res.data); + } + + /// Delete a variable by its unique ID. + Future deleteVariable({ + required String siteId, + required String variableId, + }) async { + final String apiPath = '/sites/{siteId}/variables/{variableId}' + .replaceAll('{siteId}', siteId) + .replaceAll('{variableId}', variableId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.delete, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return res.data; + } +} diff --git a/lib/services/storage.dart b/lib/services/storage.dart index 37641215..ee630883 100644 --- a/lib/services/storage.dart +++ b/lib/services/storage.dart @@ -318,12 +318,15 @@ class Storage extends Service { Future getFileDownload({ required String bucketId, required String fileId, + String? token, }) async { final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download' .replaceAll('{bucketId}', bucketId) .replaceAll('{fileId}', fileId); final Map params = { + 'token': token, + 'project': client.config['project'], 'session': client.config['session'], }; @@ -356,6 +359,7 @@ class Storage extends Service { int? rotation, String? background, enums.ImageFormat? output, + String? token, }) async { final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview' .replaceAll('{bucketId}', bucketId) @@ -373,6 +377,7 @@ class Storage extends Service { 'rotation': rotation, 'background': background, 'output': output?.value, + 'token': token, 'project': client.config['project'], 'session': client.config['session'], @@ -393,12 +398,15 @@ class Storage extends Service { Future getFileView({ required String bucketId, required String fileId, + String? token, }) async { final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view' .replaceAll('{bucketId}', bucketId) .replaceAll('{fileId}', fileId); final Map params = { + 'token': token, + 'project': client.config['project'], 'session': client.config['session'], }; diff --git a/lib/services/tokens.dart b/lib/services/tokens.dart new file mode 100644 index 00000000..0224b0a5 --- /dev/null +++ b/lib/services/tokens.dart @@ -0,0 +1,113 @@ +part of '../dart_appwrite.dart'; + +class Tokens extends Service { + Tokens(super.client); + + /// List all the tokens created for a specific file or bucket. You can use the + /// query params to filter your results. + Future list({ + required String bucketId, + required String fileId, + List? queries, + }) async { + final String apiPath = '/tokens/buckets/{bucketId}/files/{fileId}' + .replaceAll('{bucketId}', bucketId) + .replaceAll('{fileId}', fileId); + + final Map apiParams = {'queries': queries}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.ResourceTokenList.fromMap(res.data); + } + + /// Create a new token. A token is linked to a file. Token can be passed as a + /// header or request get parameter. + Future createFileToken({ + required String bucketId, + required String fileId, + String? expire, + }) async { + final String apiPath = '/tokens/buckets/{bucketId}/files/{fileId}' + .replaceAll('{bucketId}', bucketId) + .replaceAll('{fileId}', fileId); + + final Map apiParams = {'expire': expire}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.post, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.ResourceToken.fromMap(res.data); + } + + /// Get a token by its unique ID. + Future get({required String tokenId}) async { + final String apiPath = '/tokens/{tokenId}'.replaceAll('{tokenId}', tokenId); + + final Map apiParams = {}; + + final Map apiHeaders = {}; + + final res = await client.call( + HttpMethod.get, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.ResourceToken.fromMap(res.data); + } + + /// Update a token by its unique ID. Use this endpoint to update a token's + /// expiry date. + Future update({ + required String tokenId, + String? expire, + }) async { + final String apiPath = '/tokens/{tokenId}'.replaceAll('{tokenId}', tokenId); + + final Map apiParams = {'expire': expire}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.patch, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return models.ResourceToken.fromMap(res.data); + } + + /// Delete a token by its unique ID. + Future delete({required String tokenId}) async { + final String apiPath = '/tokens/{tokenId}'.replaceAll('{tokenId}', tokenId); + + final Map apiParams = {}; + + final Map apiHeaders = {'content-type': 'application/json'}; + + final res = await client.call( + HttpMethod.delete, + path: apiPath, + params: apiParams, + headers: apiHeaders, + ); + + return res.data; + } +} diff --git a/lib/services/users.dart b/lib/services/users.dart index f4d31233..c98182b7 100644 --- a/lib/services/users.dart +++ b/lib/services/users.dart @@ -488,13 +488,18 @@ class Users extends Service { /// Get the user membership list by its unique ID. Future listMemberships({ required String userId, + List? queries, + String? search, }) async { final String apiPath = '/users/{userId}/memberships'.replaceAll( '{userId}', userId, ); - final Map apiParams = {}; + final Map apiParams = { + 'queries': queries, + 'search': search, + }; final Map apiHeaders = {}; diff --git a/lib/src/client_browser.dart b/lib/src/client_browser.dart index c473ab61..aa59d03e 100644 --- a/lib/src/client_browser.dart +++ b/lib/src/client_browser.dart @@ -30,8 +30,8 @@ class ClientBrowser extends ClientBase with ClientMixin { 'x-sdk-name': 'Dart', 'x-sdk-platform': 'server', 'x-sdk-language': 'dart', - 'x-sdk-version': '15.0.0', - 'X-Appwrite-Response-Format': '1.6.0', + 'x-sdk-version': '16.0.0', + 'X-Appwrite-Response-Format': '1.7.0', }; config = {}; diff --git a/lib/src/client_io.dart b/lib/src/client_io.dart index 0496f7e7..b942cfe4 100644 --- a/lib/src/client_io.dart +++ b/lib/src/client_io.dart @@ -37,10 +37,10 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-name': 'Dart', 'x-sdk-platform': 'server', 'x-sdk-language': 'dart', - 'x-sdk-version': '15.0.0', + 'x-sdk-version': '16.0.0', 'user-agent': - 'AppwriteDartSDK/15.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})', - 'X-Appwrite-Response-Format': '1.6.0', + 'AppwriteDartSDK/16.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})', + 'X-Appwrite-Response-Format': '1.7.0', }; config = {}; diff --git a/lib/src/client_mixin.dart b/lib/src/client_mixin.dart index cd8d3867..310bc3ca 100644 --- a/lib/src/client_mixin.dart +++ b/lib/src/client_mixin.dart @@ -63,10 +63,14 @@ mixin ClientMixin { (request as http.Request).body = jsonEncode(params); } - headers['User-Agent'] = Uri.encodeFull(headers['User-Agent'] ?? ''); - headers['X-Forwarded-User-Agent'] = Uri.encodeFull( - headers['X-Forwarded-User-Agent'] ?? '', - ); + if (headers['User-Agent'] != null) { + headers['User-Agent'] = Uri.encodeFull(headers['User-Agent']!); + } + if (headers['X-Forwarded-User-Agent'] != null) { + headers['X-Forwarded-User-Agent'] = Uri.encodeFull( + headers['X-Forwarded-User-Agent']!, + ); + } request.headers.addAll(headers); return request; diff --git a/lib/src/enums/adapter.dart b/lib/src/enums/adapter.dart new file mode 100644 index 00000000..d1af0722 --- /dev/null +++ b/lib/src/enums/adapter.dart @@ -0,0 +1,12 @@ +part of '../../enums.dart'; + +enum Adapter { + static(value: 'static'), + ssr(value: 'ssr'); + + const Adapter({required this.value}); + + final String value; + + String toJson() => value; +} diff --git a/lib/src/enums/build_runtime.dart b/lib/src/enums/build_runtime.dart new file mode 100644 index 00000000..88ffbfa6 --- /dev/null +++ b/lib/src/enums/build_runtime.dart @@ -0,0 +1,73 @@ +part of '../../enums.dart'; + +enum BuildRuntime { + node145(value: 'node-14.5'), + node160(value: 'node-16.0'), + node180(value: 'node-18.0'), + node190(value: 'node-19.0'), + node200(value: 'node-20.0'), + node210(value: 'node-21.0'), + node22(value: 'node-22'), + php80(value: 'php-8.0'), + php81(value: 'php-8.1'), + php82(value: 'php-8.2'), + php83(value: 'php-8.3'), + ruby30(value: 'ruby-3.0'), + ruby31(value: 'ruby-3.1'), + ruby32(value: 'ruby-3.2'), + ruby33(value: 'ruby-3.3'), + python38(value: 'python-3.8'), + python39(value: 'python-3.9'), + python310(value: 'python-3.10'), + python311(value: 'python-3.11'), + python312(value: 'python-3.12'), + pythonMl311(value: 'python-ml-3.11'), + pythonMl312(value: 'python-ml-3.12'), + deno121(value: 'deno-1.21'), + deno124(value: 'deno-1.24'), + deno135(value: 'deno-1.35'), + deno140(value: 'deno-1.40'), + deno146(value: 'deno-1.46'), + deno20(value: 'deno-2.0'), + dart215(value: 'dart-2.15'), + dart216(value: 'dart-2.16'), + dart217(value: 'dart-2.17'), + dart218(value: 'dart-2.18'), + dart219(value: 'dart-2.19'), + dart30(value: 'dart-3.0'), + dart31(value: 'dart-3.1'), + dart33(value: 'dart-3.3'), + dart35(value: 'dart-3.5'), + dotnet60(value: 'dotnet-6.0'), + dotnet70(value: 'dotnet-7.0'), + dotnet80(value: 'dotnet-8.0'), + java80(value: 'java-8.0'), + java110(value: 'java-11.0'), + java170(value: 'java-17.0'), + java180(value: 'java-18.0'), + java210(value: 'java-21.0'), + java22(value: 'java-22'), + swift55(value: 'swift-5.5'), + swift58(value: 'swift-5.8'), + swift59(value: 'swift-5.9'), + swift510(value: 'swift-5.10'), + kotlin16(value: 'kotlin-1.6'), + kotlin18(value: 'kotlin-1.8'), + kotlin19(value: 'kotlin-1.9'), + kotlin20(value: 'kotlin-2.0'), + cpp17(value: 'cpp-17'), + cpp20(value: 'cpp-20'), + bun10(value: 'bun-1.0'), + bun11(value: 'bun-1.1'), + go123(value: 'go-1.23'), + static1(value: 'static-1'), + flutter324(value: 'flutter-3.24'), + flutter327(value: 'flutter-3.27'), + flutter329(value: 'flutter-3.29'); + + const BuildRuntime({required this.value}); + + final String value; + + String toJson() => value; +} diff --git a/lib/src/enums/deployment_download_type.dart b/lib/src/enums/deployment_download_type.dart new file mode 100644 index 00000000..1788f892 --- /dev/null +++ b/lib/src/enums/deployment_download_type.dart @@ -0,0 +1,12 @@ +part of '../../enums.dart'; + +enum DeploymentDownloadType { + source(value: 'source'), + output(value: 'output'); + + const DeploymentDownloadType({required this.value}); + + final String value; + + String toJson() => value; +} diff --git a/lib/src/enums/framework.dart b/lib/src/enums/framework.dart new file mode 100644 index 00000000..e20f48c6 --- /dev/null +++ b/lib/src/enums/framework.dart @@ -0,0 +1,24 @@ +part of '../../enums.dart'; + +enum Framework { + analog(value: 'analog'), + angular(value: 'angular'), + nextjs(value: 'nextjs'), + react(value: 'react'), + nuxt(value: 'nuxt'), + vue(value: 'vue'), + sveltekit(value: 'sveltekit'), + astro(value: 'astro'), + remix(value: 'remix'), + lynx(value: 'lynx'), + flutter(value: 'flutter'), + reactNative(value: 'react-native'), + vite(value: 'vite'), + other(value: 'other'); + + const Framework({required this.value}); + + final String value; + + String toJson() => value; +} diff --git a/lib/src/enums/image_format.dart b/lib/src/enums/image_format.dart index 4d07af18..120c93f4 100644 --- a/lib/src/enums/image_format.dart +++ b/lib/src/enums/image_format.dart @@ -3,7 +3,6 @@ part of '../../enums.dart'; enum ImageFormat { jpg(value: 'jpg'), jpeg(value: 'jpeg'), - gif(value: 'gif'), png(value: 'png'), webp(value: 'webp'), heic(value: 'heic'), diff --git a/lib/src/enums/runtime.dart b/lib/src/enums/runtime.dart index a71f5a65..fec56a9b 100644 --- a/lib/src/enums/runtime.dart +++ b/lib/src/enums/runtime.dart @@ -22,6 +22,7 @@ enum Runtime { python311(value: 'python-3.11'), python312(value: 'python-3.12'), pythonMl311(value: 'python-ml-3.11'), + pythonMl312(value: 'python-ml-3.12'), deno121(value: 'deno-1.21'), deno124(value: 'deno-1.24'), deno135(value: 'deno-1.35'), @@ -32,6 +33,7 @@ enum Runtime { dart216(value: 'dart-2.16'), dart217(value: 'dart-2.17'), dart218(value: 'dart-2.18'), + dart219(value: 'dart-2.19'), dart30(value: 'dart-3.0'), dart31(value: 'dart-3.1'), dart33(value: 'dart-3.3'), @@ -59,7 +61,9 @@ enum Runtime { bun11(value: 'bun-1.1'), go123(value: 'go-1.23'), static1(value: 'static-1'), - flutter324(value: 'flutter-3.24'); + flutter324(value: 'flutter-3.24'), + flutter327(value: 'flutter-3.27'), + flutter329(value: 'flutter-3.29'); const Runtime({required this.value}); diff --git a/lib/src/enums/vcs_deployment_type.dart b/lib/src/enums/vcs_deployment_type.dart new file mode 100644 index 00000000..f01fcb01 --- /dev/null +++ b/lib/src/enums/vcs_deployment_type.dart @@ -0,0 +1,13 @@ +part of '../../enums.dart'; + +enum VCSDeploymentType { + branch(value: 'branch'), + commit(value: 'commit'), + tag(value: 'tag'); + + const VCSDeploymentType({required this.value}); + + final String value; + + String toJson() => value; +} diff --git a/lib/src/models/build.dart b/lib/src/models/build.dart deleted file mode 100644 index ea4a3137..00000000 --- a/lib/src/models/build.dart +++ /dev/null @@ -1,71 +0,0 @@ -part of '../../models.dart'; - -/// Build -class Build implements Model { - /// Build ID. - final String $id; - - /// The deployment that created this build. - final String deploymentId; - - /// The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built - final String status; - - /// The stdout of the build. - final String stdout; - - /// The stderr of the build. - final String stderr; - - /// The deployment creation date in ISO 8601 format. - final String startTime; - - /// The time the build was finished in ISO 8601 format. - final String endTime; - - /// The build duration in seconds. - final int duration; - - /// The code size in bytes. - final int size; - - Build({ - required this.$id, - required this.deploymentId, - required this.status, - required this.stdout, - required this.stderr, - required this.startTime, - required this.endTime, - required this.duration, - required this.size, - }); - - factory Build.fromMap(Map map) { - return Build( - $id: map['\$id'].toString(), - deploymentId: map['deploymentId'].toString(), - status: map['status'].toString(), - stdout: map['stdout'].toString(), - stderr: map['stderr'].toString(), - startTime: map['startTime'].toString(), - endTime: map['endTime'].toString(), - duration: map['duration'], - size: map['size'], - ); - } - - Map toMap() { - return { - "\$id": $id, - "deploymentId": deploymentId, - "status": status, - "stdout": stdout, - "stderr": stderr, - "startTime": startTime, - "endTime": endTime, - "duration": duration, - "size": size, - }; - } -} diff --git a/lib/src/models/deployment.dart b/lib/src/models/deployment.dart index f01fb11e..448c62c7 100644 --- a/lib/src/models/deployment.dart +++ b/lib/src/models/deployment.dart @@ -24,25 +24,34 @@ class Deployment implements Model { final String entrypoint; /// The code size in bytes. - final int size; + final int sourceSize; /// The build output size in bytes. final int buildSize; + /// The total size in bytes (source and build output). + final int totalSize; + /// The current build ID. final String buildId; /// Whether the deployment should be automatically activated. final bool activate; - /// The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed". + /// Screenshot with light theme preference file ID. + final String screenshotLight; + + /// Screenshot with dark theme preference file ID. + final String screenshotDark; + + /// The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed". final String status; /// The build logs. final String buildLogs; /// The current build time in seconds. - final int buildTime; + final int buildDuration; /// The name of the vcs provider repository final String providerRepositoryName; @@ -82,13 +91,16 @@ class Deployment implements Model { required this.resourceId, required this.resourceType, required this.entrypoint, - required this.size, + required this.sourceSize, required this.buildSize, + required this.totalSize, required this.buildId, required this.activate, + required this.screenshotLight, + required this.screenshotDark, required this.status, required this.buildLogs, - required this.buildTime, + required this.buildDuration, required this.providerRepositoryName, required this.providerRepositoryOwner, required this.providerRepositoryUrl, @@ -110,13 +122,16 @@ class Deployment implements Model { resourceId: map['resourceId'].toString(), resourceType: map['resourceType'].toString(), entrypoint: map['entrypoint'].toString(), - size: map['size'], + sourceSize: map['sourceSize'], buildSize: map['buildSize'], + totalSize: map['totalSize'], buildId: map['buildId'].toString(), activate: map['activate'], + screenshotLight: map['screenshotLight'].toString(), + screenshotDark: map['screenshotDark'].toString(), status: map['status'].toString(), buildLogs: map['buildLogs'].toString(), - buildTime: map['buildTime'], + buildDuration: map['buildDuration'], providerRepositoryName: map['providerRepositoryName'].toString(), providerRepositoryOwner: map['providerRepositoryOwner'].toString(), providerRepositoryUrl: map['providerRepositoryUrl'].toString(), @@ -139,13 +154,16 @@ class Deployment implements Model { "resourceId": resourceId, "resourceType": resourceType, "entrypoint": entrypoint, - "size": size, + "sourceSize": sourceSize, "buildSize": buildSize, + "totalSize": totalSize, "buildId": buildId, "activate": activate, + "screenshotLight": screenshotLight, + "screenshotDark": screenshotDark, "status": status, "buildLogs": buildLogs, - "buildTime": buildTime, + "buildDuration": buildDuration, "providerRepositoryName": providerRepositoryName, "providerRepositoryOwner": providerRepositoryOwner, "providerRepositoryUrl": providerRepositoryUrl, diff --git a/lib/src/models/execution.dart b/lib/src/models/execution.dart index 3a7a3535..8618bcd6 100644 --- a/lib/src/models/execution.dart +++ b/lib/src/models/execution.dart @@ -47,7 +47,7 @@ class Execution implements Model { /// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. final String errors; - /// Function execution duration in seconds. + /// Resource(function/site) execution duration in seconds. final double duration; /// The scheduled time for execution. If left empty, execution will be queued immediately. diff --git a/lib/src/models/framework.dart b/lib/src/models/framework.dart new file mode 100644 index 00000000..693c9b07 --- /dev/null +++ b/lib/src/models/framework.dart @@ -0,0 +1,49 @@ +part of '../../models.dart'; + +/// Framework +class Framework implements Model { + /// Framework key. + final String key; + + /// Framework Name. + final String name; + + /// Default runtime version. + final String buildRuntime; + + /// List of supported runtime versions. + final List runtimes; + + /// List of supported adapters. + final List adapters; + + Framework({ + required this.key, + required this.name, + required this.buildRuntime, + required this.runtimes, + required this.adapters, + }); + + factory Framework.fromMap(Map map) { + return Framework( + key: map['key'].toString(), + name: map['name'].toString(), + buildRuntime: map['buildRuntime'].toString(), + runtimes: List.from(map['runtimes'] ?? []), + adapters: List.from( + map['adapters'].map((p) => FrameworkAdapter.fromMap(p)), + ), + ); + } + + Map toMap() { + return { + "key": key, + "name": name, + "buildRuntime": buildRuntime, + "runtimes": runtimes, + "adapters": adapters.map((p) => p.toMap()).toList(), + }; + } +} diff --git a/lib/src/models/framework_adapter.dart b/lib/src/models/framework_adapter.dart new file mode 100644 index 00000000..0b908240 --- /dev/null +++ b/lib/src/models/framework_adapter.dart @@ -0,0 +1,47 @@ +part of '../../models.dart'; + +/// Framework Adapter +class FrameworkAdapter implements Model { + /// Adapter key. + final String key; + + /// Default command to download dependencies. + final String installCommand; + + /// Default command to build site into output directory. + final String buildCommand; + + /// Default output directory of build. + final String outputDirectory; + + /// Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + final String fallbackFile; + + FrameworkAdapter({ + required this.key, + required this.installCommand, + required this.buildCommand, + required this.outputDirectory, + required this.fallbackFile, + }); + + factory FrameworkAdapter.fromMap(Map map) { + return FrameworkAdapter( + key: map['key'].toString(), + installCommand: map['installCommand'].toString(), + buildCommand: map['buildCommand'].toString(), + outputDirectory: map['outputDirectory'].toString(), + fallbackFile: map['fallbackFile'].toString(), + ); + } + + Map toMap() { + return { + "key": key, + "installCommand": installCommand, + "buildCommand": buildCommand, + "outputDirectory": outputDirectory, + "fallbackFile": fallbackFile, + }; + } +} diff --git a/lib/src/models/framework_list.dart b/lib/src/models/framework_list.dart new file mode 100644 index 00000000..266d8edf --- /dev/null +++ b/lib/src/models/framework_list.dart @@ -0,0 +1,28 @@ +part of '../../models.dart'; + +/// Frameworks List +class FrameworkList implements Model { + /// Total number of frameworks documents that matched your query. + final int total; + + /// List of frameworks. + final List frameworks; + + FrameworkList({required this.total, required this.frameworks}); + + factory FrameworkList.fromMap(Map map) { + return FrameworkList( + total: map['total'], + frameworks: List.from( + map['frameworks'].map((p) => Framework.fromMap(p)), + ), + ); + } + + Map toMap() { + return { + "total": total, + "frameworks": frameworks.map((p) => p.toMap()).toList(), + }; + } +} diff --git a/lib/src/models/function.dart b/lib/src/models/function.dart index fccea87e..56c2eded 100644 --- a/lib/src/models/function.dart +++ b/lib/src/models/function.dart @@ -23,14 +23,26 @@ class Func implements Model { /// Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. final bool live; - /// Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + /// When disabled, executions will exclude logs and errors, and will be slightly faster. final bool logging; - /// Function execution runtime. + /// Function execution and build runtime. final String runtime; /// Function's active deployment ID. - final String deployment; + final String deploymentId; + + /// Active deployment creation date in ISO 8601 format. + final String deploymentCreatedAt; + + /// Function's latest deployment ID. + final String latestDeploymentId; + + /// Latest deployment creation date in ISO 8601 format. + final String latestDeploymentCreatedAt; + + /// Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + final String latestDeploymentStatus; /// Allowed permission scopes. final List scopes; @@ -84,7 +96,11 @@ class Func implements Model { required this.live, required this.logging, required this.runtime, - required this.deployment, + required this.deploymentId, + required this.deploymentCreatedAt, + required this.latestDeploymentId, + required this.latestDeploymentCreatedAt, + required this.latestDeploymentStatus, required this.scopes, required this.vars, required this.events, @@ -112,7 +128,11 @@ class Func implements Model { live: map['live'], logging: map['logging'], runtime: map['runtime'].toString(), - deployment: map['deployment'].toString(), + deploymentId: map['deploymentId'].toString(), + deploymentCreatedAt: map['deploymentCreatedAt'].toString(), + latestDeploymentId: map['latestDeploymentId'].toString(), + latestDeploymentCreatedAt: map['latestDeploymentCreatedAt'].toString(), + latestDeploymentStatus: map['latestDeploymentStatus'].toString(), scopes: List.from(map['scopes'] ?? []), vars: List.from(map['vars'].map((p) => Variable.fromMap(p))), events: List.from(map['events'] ?? []), @@ -141,7 +161,11 @@ class Func implements Model { "live": live, "logging": logging, "runtime": runtime, - "deployment": deployment, + "deploymentId": deploymentId, + "deploymentCreatedAt": deploymentCreatedAt, + "latestDeploymentId": latestDeploymentId, + "latestDeploymentCreatedAt": latestDeploymentCreatedAt, + "latestDeploymentStatus": latestDeploymentStatus, "scopes": scopes, "vars": vars.map((p) => p.toMap()).toList(), "events": events, diff --git a/lib/src/models/index.dart b/lib/src/models/index.dart index b24bf242..961b9e5e 100644 --- a/lib/src/models/index.dart +++ b/lib/src/models/index.dart @@ -17,6 +17,9 @@ class Index implements Model { /// Index attributes. final List attributes; + /// Index attributes length. + final List lengths; + /// Index orders. final List? orders; @@ -32,6 +35,7 @@ class Index implements Model { required this.status, required this.error, required this.attributes, + required this.lengths, this.orders, required this.$createdAt, required this.$updatedAt, @@ -44,6 +48,7 @@ class Index implements Model { status: map['status'].toString(), error: map['error'].toString(), attributes: List.from(map['attributes'] ?? []), + lengths: List.from(map['lengths'] ?? []), orders: List.from(map['orders'] ?? []), $createdAt: map['\$createdAt'].toString(), $updatedAt: map['\$updatedAt'].toString(), @@ -57,6 +62,7 @@ class Index implements Model { "status": status, "error": error, "attributes": attributes, + "lengths": lengths, "orders": orders, "\$createdAt": $createdAt, "\$updatedAt": $updatedAt, diff --git a/lib/src/models/resource_token.dart b/lib/src/models/resource_token.dart new file mode 100644 index 00000000..dad35dcc --- /dev/null +++ b/lib/src/models/resource_token.dart @@ -0,0 +1,59 @@ +part of '../../models.dart'; + +/// ResourceToken +class ResourceToken implements Model { + /// Token ID. + final String $id; + + /// Token creation date in ISO 8601 format. + final String $createdAt; + + /// Resource ID. + final String resourceId; + + /// Resource type. + final String resourceType; + + /// Token expiration date in ISO 8601 format. + final String expire; + + /// JWT encoded string. + final String secret; + + /// Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + final String accessedAt; + + ResourceToken({ + required this.$id, + required this.$createdAt, + required this.resourceId, + required this.resourceType, + required this.expire, + required this.secret, + required this.accessedAt, + }); + + factory ResourceToken.fromMap(Map map) { + return ResourceToken( + $id: map['\$id'].toString(), + $createdAt: map['\$createdAt'].toString(), + resourceId: map['resourceId'].toString(), + resourceType: map['resourceType'].toString(), + expire: map['expire'].toString(), + secret: map['secret'].toString(), + accessedAt: map['accessedAt'].toString(), + ); + } + + Map toMap() { + return { + "\$id": $id, + "\$createdAt": $createdAt, + "resourceId": resourceId, + "resourceType": resourceType, + "expire": expire, + "secret": secret, + "accessedAt": accessedAt, + }; + } +} diff --git a/lib/src/models/resource_token_list.dart b/lib/src/models/resource_token_list.dart new file mode 100644 index 00000000..f30531f4 --- /dev/null +++ b/lib/src/models/resource_token_list.dart @@ -0,0 +1,25 @@ +part of '../../models.dart'; + +/// Resource Tokens List +class ResourceTokenList implements Model { + /// Total number of tokens documents that matched your query. + final int total; + + /// List of tokens. + final List tokens; + + ResourceTokenList({required this.total, required this.tokens}); + + factory ResourceTokenList.fromMap(Map map) { + return ResourceTokenList( + total: map['total'], + tokens: List.from( + map['tokens'].map((p) => ResourceToken.fromMap(p)), + ), + ); + } + + Map toMap() { + return {"total": total, "tokens": tokens.map((p) => p.toMap()).toList()}; + } +} diff --git a/lib/src/models/site.dart b/lib/src/models/site.dart new file mode 100644 index 00000000..1449f8bd --- /dev/null +++ b/lib/src/models/site.dart @@ -0,0 +1,191 @@ +part of '../../models.dart'; + +/// Site +class Site implements Model { + /// Site ID. + final String $id; + + /// Site creation date in ISO 8601 format. + final String $createdAt; + + /// Site update date in ISO 8601 format. + final String $updatedAt; + + /// Site name. + final String name; + + /// Site enabled. + final bool enabled; + + /// Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. + final bool live; + + /// When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + final bool logging; + + /// Site framework. + final String framework; + + /// Site's active deployment ID. + final String deploymentId; + + /// Active deployment creation date in ISO 8601 format. + final String deploymentCreatedAt; + + /// Screenshot of active deployment with light theme preference file ID. + final String deploymentScreenshotLight; + + /// Screenshot of active deployment with dark theme preference file ID. + final String deploymentScreenshotDark; + + /// Site's latest deployment ID. + final String latestDeploymentId; + + /// Latest deployment creation date in ISO 8601 format. + final String latestDeploymentCreatedAt; + + /// Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + final String latestDeploymentStatus; + + /// Site variables. + final List vars; + + /// Site request timeout in seconds. + final int timeout; + + /// The install command used to install the site dependencies. + final String installCommand; + + /// The build command used to build the site. + final String buildCommand; + + /// The directory where the site build output is located. + final String outputDirectory; + + /// Site VCS (Version Control System) installation id. + final String installationId; + + /// VCS (Version Control System) Repository ID + final String providerRepositoryId; + + /// VCS (Version Control System) branch name + final String providerBranch; + + /// Path to site in VCS (Version Control System) repository + final String providerRootDirectory; + + /// Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests + final bool providerSilentMode; + + /// Machine specification for builds and executions. + final String specification; + + /// Site build runtime. + final String buildRuntime; + + /// Site framework adapter. + final String adapter; + + /// Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + final String fallbackFile; + + Site({ + required this.$id, + required this.$createdAt, + required this.$updatedAt, + required this.name, + required this.enabled, + required this.live, + required this.logging, + required this.framework, + required this.deploymentId, + required this.deploymentCreatedAt, + required this.deploymentScreenshotLight, + required this.deploymentScreenshotDark, + required this.latestDeploymentId, + required this.latestDeploymentCreatedAt, + required this.latestDeploymentStatus, + required this.vars, + required this.timeout, + required this.installCommand, + required this.buildCommand, + required this.outputDirectory, + required this.installationId, + required this.providerRepositoryId, + required this.providerBranch, + required this.providerRootDirectory, + required this.providerSilentMode, + required this.specification, + required this.buildRuntime, + required this.adapter, + required this.fallbackFile, + }); + + factory Site.fromMap(Map map) { + return Site( + $id: map['\$id'].toString(), + $createdAt: map['\$createdAt'].toString(), + $updatedAt: map['\$updatedAt'].toString(), + name: map['name'].toString(), + enabled: map['enabled'], + live: map['live'], + logging: map['logging'], + framework: map['framework'].toString(), + deploymentId: map['deploymentId'].toString(), + deploymentCreatedAt: map['deploymentCreatedAt'].toString(), + deploymentScreenshotLight: map['deploymentScreenshotLight'].toString(), + deploymentScreenshotDark: map['deploymentScreenshotDark'].toString(), + latestDeploymentId: map['latestDeploymentId'].toString(), + latestDeploymentCreatedAt: map['latestDeploymentCreatedAt'].toString(), + latestDeploymentStatus: map['latestDeploymentStatus'].toString(), + vars: List.from(map['vars'].map((p) => Variable.fromMap(p))), + timeout: map['timeout'], + installCommand: map['installCommand'].toString(), + buildCommand: map['buildCommand'].toString(), + outputDirectory: map['outputDirectory'].toString(), + installationId: map['installationId'].toString(), + providerRepositoryId: map['providerRepositoryId'].toString(), + providerBranch: map['providerBranch'].toString(), + providerRootDirectory: map['providerRootDirectory'].toString(), + providerSilentMode: map['providerSilentMode'], + specification: map['specification'].toString(), + buildRuntime: map['buildRuntime'].toString(), + adapter: map['adapter'].toString(), + fallbackFile: map['fallbackFile'].toString(), + ); + } + + Map toMap() { + return { + "\$id": $id, + "\$createdAt": $createdAt, + "\$updatedAt": $updatedAt, + "name": name, + "enabled": enabled, + "live": live, + "logging": logging, + "framework": framework, + "deploymentId": deploymentId, + "deploymentCreatedAt": deploymentCreatedAt, + "deploymentScreenshotLight": deploymentScreenshotLight, + "deploymentScreenshotDark": deploymentScreenshotDark, + "latestDeploymentId": latestDeploymentId, + "latestDeploymentCreatedAt": latestDeploymentCreatedAt, + "latestDeploymentStatus": latestDeploymentStatus, + "vars": vars.map((p) => p.toMap()).toList(), + "timeout": timeout, + "installCommand": installCommand, + "buildCommand": buildCommand, + "outputDirectory": outputDirectory, + "installationId": installationId, + "providerRepositoryId": providerRepositoryId, + "providerBranch": providerBranch, + "providerRootDirectory": providerRootDirectory, + "providerSilentMode": providerSilentMode, + "specification": specification, + "buildRuntime": buildRuntime, + "adapter": adapter, + "fallbackFile": fallbackFile, + }; + } +} diff --git a/lib/src/models/site_list.dart b/lib/src/models/site_list.dart new file mode 100644 index 00000000..a403dd5b --- /dev/null +++ b/lib/src/models/site_list.dart @@ -0,0 +1,23 @@ +part of '../../models.dart'; + +/// Sites List +class SiteList implements Model { + /// Total number of sites documents that matched your query. + final int total; + + /// List of sites. + final List sites; + + SiteList({required this.total, required this.sites}); + + factory SiteList.fromMap(Map map) { + return SiteList( + total: map['total'], + sites: List.from(map['sites'].map((p) => Site.fromMap(p))), + ); + } + + Map toMap() { + return {"total": total, "sites": sites.map((p) => p.toMap()).toList()}; + } +} diff --git a/lib/src/models/variable.dart b/lib/src/models/variable.dart index a233010a..2a8e276a 100644 --- a/lib/src/models/variable.dart +++ b/lib/src/models/variable.dart @@ -17,6 +17,9 @@ class Variable implements Model { /// Variable value. final String value; + /// Variable secret flag. Secret variables can only be updated or deleted, but never read. + final bool secret; + /// Service to which the variable belongs. Possible values are "project", "function" final String resourceType; @@ -29,6 +32,7 @@ class Variable implements Model { required this.$updatedAt, required this.key, required this.value, + required this.secret, required this.resourceType, required this.resourceId, }); @@ -40,6 +44,7 @@ class Variable implements Model { $updatedAt: map['\$updatedAt'].toString(), key: map['key'].toString(), value: map['value'].toString(), + secret: map['secret'], resourceType: map['resourceType'].toString(), resourceId: map['resourceId'].toString(), ); @@ -52,6 +57,7 @@ class Variable implements Model { "\$updatedAt": $updatedAt, "key": key, "value": value, + "secret": secret, "resourceType": resourceType, "resourceId": resourceId, }; diff --git a/pubspec.yaml b/pubspec.yaml index ff0e463e..4a465625 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: dart_appwrite -version: 15.0.0 +version: 16.0.0 description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API homepage: https://appwrite.io repository: https://github.com/appwrite/sdk-for-dart diff --git a/test/services/databases_test.dart b/test/services/databases_test.dart index 176d50a6..4d8e74e1 100644 --- a/test/services/databases_test.dart +++ b/test/services/databases_test.dart @@ -914,6 +914,83 @@ void main() { }); + test('test method createDocuments()', () async { + final Map data = { + 'total': 5, + 'documents': [],}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await databases.createDocuments( + databaseId: '', + collectionId: '', + documents: [], + ); + expect(response, isA()); + + }); + + test('test method upsertDocuments()', () async { + final Map data = { + 'total': 5, + 'documents': [],}; + + + when(client.call( + HttpMethod.put, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await databases.upsertDocuments( + databaseId: '', + collectionId: '', + ); + expect(response, isA()); + + }); + + test('test method updateDocuments()', () async { + final Map data = { + 'total': 5, + 'documents': [],}; + + + when(client.call( + HttpMethod.patch, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await databases.updateDocuments( + databaseId: '', + collectionId: '', + ); + expect(response, isA()); + + }); + + test('test method deleteDocuments()', () async { + final Map data = { + 'total': 5, + 'documents': [],}; + + + when(client.call( + HttpMethod.delete, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await databases.deleteDocuments( + databaseId: '', + collectionId: '', + ); + expect(response, isA()); + + }); + test('test method getDocument()', () async { final Map data = { '\$id': '5e5ea5c16897e', @@ -1003,6 +1080,7 @@ void main() { 'status': 'available', 'error': 'string', 'attributes': [], + 'lengths': [], '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; @@ -1030,6 +1108,7 @@ void main() { 'status': 'available', 'error': 'string', 'attributes': [], + 'lengths': [], '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; diff --git a/test/services/functions_test.dart b/test/services/functions_test.dart index 77e721c9..f42bd078 100644 --- a/test/services/functions_test.dart +++ b/test/services/functions_test.dart @@ -82,7 +82,11 @@ void main() { 'live': true, 'logging': true, 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', 'scopes': [], 'vars': [], 'events': [], @@ -158,7 +162,11 @@ void main() { 'live': true, 'logging': true, 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', 'scopes': [], 'vars': [], 'events': [], @@ -198,7 +206,11 @@ void main() { 'live': true, 'logging': true, 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', 'scopes': [], 'vars': [], 'events': [], @@ -241,6 +253,51 @@ void main() { ); }); + test('test method updateFunctionDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'execute': [], + 'name': 'My Function', + 'enabled': true, + 'live': true, + 'logging': true, + 'runtime': 'python-3.8', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'scopes': [], + 'vars': [], + 'events': [], + 'schedule': '5 4 * * *', + 'timeout': 300, + 'entrypoint': 'index.js', + 'commands': 'npm install', + 'version': 'v2', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'functions/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb',}; + + + when(client.call( + HttpMethod.patch, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await functions.updateFunctionDeployment( + functionId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + test('test method listDeployments()', () async { final Map data = { 'total': 5, @@ -268,13 +325,16 @@ void main() { 'resourceId': '5e5ea6g16897e', 'resourceType': 'functions', 'entrypoint': 'index.js', - 'size': 128, + 'sourceSize': 128, 'buildSize': 128, + 'totalSize': 128, 'buildId': '5e5ea5c16897e', 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', 'status': 'ready', 'buildLogs': 'Compiling source files...', - 'buildTime': 128, + 'buildDuration': 128, 'providerRepositoryName': 'database', 'providerRepositoryOwner': 'utopia', 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', @@ -305,7 +365,7 @@ void main() { }); - test('test method getDeployment()', () async { + test('test method createDuplicateDeployment()', () async { final Map data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -314,13 +374,16 @@ void main() { 'resourceId': '5e5ea6g16897e', 'resourceType': 'functions', 'entrypoint': 'index.js', - 'size': 128, + 'sourceSize': 128, 'buildSize': 128, + 'totalSize': 128, 'buildId': '5e5ea5c16897e', 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', 'status': 'ready', 'buildLogs': 'Compiling source files...', - 'buildTime': 128, + 'buildDuration': 128, 'providerRepositoryName': 'database', 'providerRepositoryOwner': 'utopia', 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', @@ -334,11 +397,11 @@ void main() { when(client.call( - HttpMethod.get, + HttpMethod.post, )).thenAnswer((_) async => Response(data: data)); - final response = await functions.getDeployment( + final response = await functions.createDuplicateDeployment( functionId: '', deploymentId: '', ); @@ -346,99 +409,154 @@ void main() { }); - test('test method updateDeployment()', () async { + test('test method createTemplateDeployment()', () async { final Map data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'execute': [], - 'name': 'My Function', - 'enabled': true, - 'live': true, - 'logging': true, - 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', - 'scopes': [], - 'vars': [], - 'events': [], - 'schedule': '5 4 * * *', - 'timeout': 300, + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', 'entrypoint': 'index.js', - 'commands': 'npm install', - 'version': 'v2', - 'installationId': '6m40at4ejk5h2u9s1hboo', - 'providerRepositoryId': 'appwrite', - 'providerBranch': 'main', - 'providerRootDirectory': 'functions/helloWorld', - 'providerSilentMode': true, - 'specification': 's-1vcpu-512mb',}; + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; when(client.call( - HttpMethod.patch, + HttpMethod.post, )).thenAnswer((_) async => Response(data: data)); - final response = await functions.updateDeployment( + final response = await functions.createTemplateDeployment( functionId: '', - deploymentId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', ); - expect(response, isA()); + expect(response, isA()); }); - test('test method deleteDeployment()', () async { - final data = ''; + test('test method createVcsDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + when(client.call( - HttpMethod.delete, + HttpMethod.post, )).thenAnswer((_) async => Response(data: data)); - final response = await functions.deleteDeployment( + final response = await functions.createVcsDeployment( functionId: '', - deploymentId: '', + type: 'branch', + reference: '', ); + expect(response, isA()); + }); - test('test method createBuild()', () async { - final data = ''; + test('test method getDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + when(client.call( - HttpMethod.post, + HttpMethod.get, )).thenAnswer((_) async => Response(data: data)); - final response = await functions.createBuild( + final response = await functions.getDeployment( functionId: '', deploymentId: '', ); - }); + expect(response, isA()); - test('test method updateDeploymentBuild()', () async { - final Map data = { - '\$id': '5e5ea5c16897e', - 'deploymentId': '5e5ea5c16897e', - 'status': 'ready', - 'stdout': '', - 'stderr': '', - 'startTime': '2020-10-15T06:38:00.000+00:00', - 'endTime': '2020-10-15T06:38:00.000+00:00', - 'duration': 0, - 'size': 128,}; + }); + test('test method deleteDeployment()', () async { + final data = ''; when(client.call( - HttpMethod.patch, + HttpMethod.delete, )).thenAnswer((_) async => Response(data: data)); - final response = await functions.updateDeploymentBuild( + final response = await functions.deleteDeployment( functionId: '', deploymentId: '', ); - expect(response, isA()); - }); test('test method getDeploymentDownload()', () async {final Uint8List data = Uint8List.fromList([]); @@ -456,6 +574,50 @@ void main() { }); + test('test method updateDeploymentStatus()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.call( + HttpMethod.patch, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await functions.updateDeploymentStatus( + functionId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + test('test method listExecutions()', () async { final Map data = { 'total': 5, @@ -578,6 +740,7 @@ void main() { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'API_KEY', 'value': 'myPa\$\$word1', + 'secret': true, 'resourceType': 'function', 'resourceId': 'myAwesomeFunction',}; @@ -603,6 +766,7 @@ void main() { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'API_KEY', 'value': 'myPa\$\$word1', + 'secret': true, 'resourceType': 'function', 'resourceId': 'myAwesomeFunction',}; @@ -627,6 +791,7 @@ void main() { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'API_KEY', 'value': 'myPa\$\$word1', + 'secret': true, 'resourceType': 'function', 'resourceId': 'myAwesomeFunction',}; diff --git a/test/services/sites_test.dart b/test/services/sites_test.dart new file mode 100644 index 00000000..be65bbf9 --- /dev/null +++ b/test/services/sites_test.dart @@ -0,0 +1,802 @@ +import 'package:test/test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:dart_appwrite/models.dart' as models; +import 'package:dart_appwrite/src/enums.dart'; +import 'package:dart_appwrite/src/response.dart'; +import 'dart:typed_data'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +class MockClient extends Mock implements Client { + Map config = {'project': 'testproject'}; + String endPoint = 'https://localhost/v1'; + @override + Future call( + HttpMethod? method, { + String path = '', + Map headers = const {}, + Map params = const {}, + ResponseType? responseType, + }) async { + return super.noSuchMethod(Invocation.method(#call, [method]), + returnValue: Response()); + } + + @override + Future webAuth( + Uri? url, + { + String? callbackUrlScheme, + } + ) async { + return super.noSuchMethod(Invocation.method(#webAuth, [url]), returnValue: 'done'); + } + + @override + Future chunkedUpload({ + String? path, + Map? params, + String? paramName, + String? idParamName, + Map? headers, + Function(UploadProgress)? onProgress, + }) async { + return super.noSuchMethod(Invocation.method(#chunkedUpload, [path, params, paramName, idParamName, headers]), returnValue: Response(data: {})); + } +} + +void main() { + group('Sites test', () { + late MockClient client; + late Sites sites; + + setUp(() { + client = MockClient(); + sites = Sites(client); + }); + + test('test method list()', () async { + final Map data = { + 'total': 5, + 'sites': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.list( + ); + expect(response, isA()); + + }); + + test('test method create()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.create( + siteId: '', + name: '', + framework: 'analog', + buildRuntime: 'node-14.5', + ); + expect(response, isA()); + + }); + + test('test method listFrameworks()', () async { + final Map data = { + 'total': 5, + 'frameworks': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.listFrameworks( + ); + expect(response, isA()); + + }); + + test('test method listSpecifications()', () async { + final Map data = { + 'total': 5, + 'specifications': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.listSpecifications( + ); + expect(response, isA()); + + }); + + test('test method get()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.get( + siteId: '', + ); + expect(response, isA()); + + }); + + test('test method update()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + + when(client.call( + HttpMethod.put, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.update( + siteId: '', + name: '', + framework: 'analog', + ); + expect(response, isA()); + + }); + + test('test method delete()', () async { + final data = ''; + + when(client.call( + HttpMethod.delete, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.delete( + siteId: '', + ); + }); + + test('test method updateSiteDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + + when(client.call( + HttpMethod.patch, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.updateSiteDeployment( + siteId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + + test('test method listDeployments()', () async { + final Map data = { + 'total': 5, + 'deployments': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.listDeployments( + siteId: '', + ); + expect(response, isA()); + + }); + + test('test method createDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.chunkedUpload( + path: argThat(isNotNull), + params: argThat(isNotNull), + paramName: argThat(isNotNull), + idParamName: argThat(isNotNull), + headers: argThat(isNotNull), + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.createDeployment( + siteId: '', + code: InputFile.fromPath(path: './image.png'), + activate: true, + ); + expect(response, isA()); + + }); + + test('test method createDuplicateDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.createDuplicateDeployment( + siteId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + + test('test method createTemplateDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.createTemplateDeployment( + siteId: '', + repository: '', + owner: '', + rootDirectory: '', + version: '', + ); + expect(response, isA()); + + }); + + test('test method createVcsDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.createVcsDeployment( + siteId: '', + type: 'branch', + reference: '', + ); + expect(response, isA()); + + }); + + test('test method getDeployment()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.getDeployment( + siteId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + + test('test method deleteDeployment()', () async { + final data = ''; + + when(client.call( + HttpMethod.delete, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.deleteDeployment( + siteId: '', + deploymentId: '', + ); + }); + + test('test method getDeploymentDownload()', () async {final Uint8List data = Uint8List.fromList([]); + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.getDeploymentDownload( + siteId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + + test('test method updateDeploymentStatus()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + + when(client.call( + HttpMethod.patch, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.updateDeploymentStatus( + siteId: '', + deploymentId: '', + ); + expect(response, isA()); + + }); + + test('test method listLogs()', () async { + final Map data = { + 'total': 5, + 'executions': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.listLogs( + siteId: '', + ); + expect(response, isA()); + + }); + + test('test method getLog()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'functionId': '5e5ea6g16897e', + 'trigger': 'http', + 'status': 'processing', + 'requestMethod': 'GET', + 'requestPath': '/articles?id=5', + 'requestHeaders': [], + 'responseStatusCode': 200, + 'responseBody': '', + 'responseHeaders': [], + 'logs': '', + 'errors': '', + 'duration': 0.4,}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.getLog( + siteId: '', + logId: '', + ); + expect(response, isA()); + + }); + + test('test method deleteLog()', () async { + final data = ''; + + when(client.call( + HttpMethod.delete, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.deleteLog( + siteId: '', + logId: '', + ); + }); + + test('test method listVariables()', () async { + final Map data = { + 'total': 5, + 'variables': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.listVariables( + siteId: '', + ); + expect(response, isA()); + + }); + + test('test method createVariable()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'API_KEY', + 'value': 'myPa\$\$word1', + 'secret': true, + 'resourceType': 'function', + 'resourceId': 'myAwesomeFunction',}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.createVariable( + siteId: '', + key: '', + value: '', + ); + expect(response, isA()); + + }); + + test('test method getVariable()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'API_KEY', + 'value': 'myPa\$\$word1', + 'secret': true, + 'resourceType': 'function', + 'resourceId': 'myAwesomeFunction',}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.getVariable( + siteId: '', + variableId: '', + ); + expect(response, isA()); + + }); + + test('test method updateVariable()', () async { + final Map data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'API_KEY', + 'value': 'myPa\$\$word1', + 'secret': true, + 'resourceType': 'function', + 'resourceId': 'myAwesomeFunction',}; + + + when(client.call( + HttpMethod.put, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.updateVariable( + siteId: '', + variableId: '', + key: '', + ); + expect(response, isA()); + + }); + + test('test method deleteVariable()', () async { + final data = ''; + + when(client.call( + HttpMethod.delete, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await sites.deleteVariable( + siteId: '', + variableId: '', + ); + }); + + }); +} \ No newline at end of file diff --git a/test/services/tokens_test.dart b/test/services/tokens_test.dart new file mode 100644 index 00000000..66aec103 --- /dev/null +++ b/test/services/tokens_test.dart @@ -0,0 +1,160 @@ +import 'package:test/test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:dart_appwrite/models.dart' as models; +import 'package:dart_appwrite/src/enums.dart'; +import 'package:dart_appwrite/src/response.dart'; +import 'dart:typed_data'; +import 'package:dart_appwrite/dart_appwrite.dart'; + +class MockClient extends Mock implements Client { + Map config = {'project': 'testproject'}; + String endPoint = 'https://localhost/v1'; + @override + Future call( + HttpMethod? method, { + String path = '', + Map headers = const {}, + Map params = const {}, + ResponseType? responseType, + }) async { + return super.noSuchMethod(Invocation.method(#call, [method]), + returnValue: Response()); + } + + @override + Future webAuth( + Uri? url, + { + String? callbackUrlScheme, + } + ) async { + return super.noSuchMethod(Invocation.method(#webAuth, [url]), returnValue: 'done'); + } + + @override + Future chunkedUpload({ + String? path, + Map? params, + String? paramName, + String? idParamName, + Map? headers, + Function(UploadProgress)? onProgress, + }) async { + return super.noSuchMethod(Invocation.method(#chunkedUpload, [path, params, paramName, idParamName, headers]), returnValue: Response(data: {})); + } +} + +void main() { + group('Tokens test', () { + late MockClient client; + late Tokens tokens; + + setUp(() { + client = MockClient(); + tokens = Tokens(client); + }); + + test('test method list()', () async { + final Map data = { + 'total': 5, + 'tokens': [],}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await tokens.list( + bucketId: '', + fileId: '', + ); + expect(response, isA()); + + }); + + test('test method createFileToken()', () async { + final Map data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', + 'resourceType': 'files', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'secret': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + + when(client.call( + HttpMethod.post, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await tokens.createFileToken( + bucketId: '', + fileId: '', + ); + expect(response, isA()); + + }); + + test('test method get()', () async { + final Map data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', + 'resourceType': 'files', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'secret': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + + when(client.call( + HttpMethod.get, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await tokens.get( + tokenId: '', + ); + expect(response, isA()); + + }); + + test('test method update()', () async { + final Map data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', + 'resourceType': 'files', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'secret': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + + when(client.call( + HttpMethod.patch, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await tokens.update( + tokenId: '', + ); + expect(response, isA()); + + }); + + test('test method delete()', () async { + final data = ''; + + when(client.call( + HttpMethod.delete, + )).thenAnswer((_) async => Response(data: data)); + + + final response = await tokens.delete( + tokenId: '', + ); + }); + + }); +} \ No newline at end of file diff --git a/test/src/models/build_test.dart b/test/src/models/build_test.dart deleted file mode 100644 index ed8fbac9..00000000 --- a/test/src/models/build_test.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:dart_appwrite/models.dart'; -import 'package:test/test.dart'; - -void main() { - group('Build', () { - - test('model', () { - final model = Build( - $id: '5e5ea5c16897e', - deploymentId: '5e5ea5c16897e', - status: 'ready', - stdout: '', - stderr: '', - startTime: '2020-10-15T06:38:00.000+00:00', - endTime: '2020-10-15T06:38:00.000+00:00', - duration: 0, - size: 128, - ); - - final map = model.toMap(); - final result = Build.fromMap(map); - - expect(result.$id, '5e5ea5c16897e'); - expect(result.deploymentId, '5e5ea5c16897e'); - expect(result.status, 'ready'); - expect(result.stdout, ''); - expect(result.stderr, ''); - expect(result.startTime, '2020-10-15T06:38:00.000+00:00'); - expect(result.endTime, '2020-10-15T06:38:00.000+00:00'); - expect(result.duration, 0); - expect(result.size, 128); - }); - }); -} diff --git a/test/src/models/deployment_test.dart b/test/src/models/deployment_test.dart index 2f9b3582..46d7200c 100644 --- a/test/src/models/deployment_test.dart +++ b/test/src/models/deployment_test.dart @@ -13,13 +13,16 @@ void main() { resourceId: '5e5ea6g16897e', resourceType: 'functions', entrypoint: 'index.js', - size: 128, + sourceSize: 128, buildSize: 128, + totalSize: 128, buildId: '5e5ea5c16897e', activate: true, + screenshotLight: '5e5ea5c16897e', + screenshotDark: '5e5ea5c16897e', status: 'ready', buildLogs: 'Compiling source files...', - buildTime: 128, + buildDuration: 128, providerRepositoryName: 'database', providerRepositoryOwner: 'utopia', providerRepositoryUrl: 'https://github.com/vermakhushboo/g4-node-function', @@ -42,13 +45,16 @@ void main() { expect(result.resourceId, '5e5ea6g16897e'); expect(result.resourceType, 'functions'); expect(result.entrypoint, 'index.js'); - expect(result.size, 128); + expect(result.sourceSize, 128); expect(result.buildSize, 128); + expect(result.totalSize, 128); expect(result.buildId, '5e5ea5c16897e'); expect(result.activate, true); + expect(result.screenshotLight, '5e5ea5c16897e'); + expect(result.screenshotDark, '5e5ea5c16897e'); expect(result.status, 'ready'); expect(result.buildLogs, 'Compiling source files...'); - expect(result.buildTime, 128); + expect(result.buildDuration, 128); expect(result.providerRepositoryName, 'database'); expect(result.providerRepositoryOwner, 'utopia'); expect(result.providerRepositoryUrl, 'https://github.com/vermakhushboo/g4-node-function'); diff --git a/test/src/models/framework_adapter_test.dart b/test/src/models/framework_adapter_test.dart new file mode 100644 index 00000000..bf7e3ff3 --- /dev/null +++ b/test/src/models/framework_adapter_test.dart @@ -0,0 +1,26 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('FrameworkAdapter', () { + + test('model', () { + final model = FrameworkAdapter( + key: 'static', + installCommand: 'npm install', + buildCommand: 'npm run build', + outputDirectory: './dist', + fallbackFile: 'index.html', + ); + + final map = model.toMap(); + final result = FrameworkAdapter.fromMap(map); + + expect(result.key, 'static'); + expect(result.installCommand, 'npm install'); + expect(result.buildCommand, 'npm run build'); + expect(result.outputDirectory, './dist'); + expect(result.fallbackFile, 'index.html'); + }); + }); +} diff --git a/test/src/models/framework_list_test.dart b/test/src/models/framework_list_test.dart new file mode 100644 index 00000000..aeade175 --- /dev/null +++ b/test/src/models/framework_list_test.dart @@ -0,0 +1,20 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('FrameworkList', () { + + test('model', () { + final model = FrameworkList( + total: 5, + frameworks: [], + ); + + final map = model.toMap(); + final result = FrameworkList.fromMap(map); + + expect(result.total, 5); + expect(result.frameworks, []); + }); + }); +} diff --git a/test/src/models/framework_test.dart b/test/src/models/framework_test.dart new file mode 100644 index 00000000..48ea96d2 --- /dev/null +++ b/test/src/models/framework_test.dart @@ -0,0 +1,26 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('Framework', () { + + test('model', () { + final model = Framework( + key: 'sveltekit', + name: 'SvelteKit', + buildRuntime: 'node-22', + runtimes: [], + adapters: [], + ); + + final map = model.toMap(); + final result = Framework.fromMap(map); + + expect(result.key, 'sveltekit'); + expect(result.name, 'SvelteKit'); + expect(result.buildRuntime, 'node-22'); + expect(result.runtimes, []); + expect(result.adapters, []); + }); + }); +} diff --git a/test/src/models/function_test.dart b/test/src/models/function_test.dart index 7b4e983f..653aadce 100644 --- a/test/src/models/function_test.dart +++ b/test/src/models/function_test.dart @@ -15,7 +15,11 @@ void main() { live: true, logging: true, runtime: 'python-3.8', - deployment: '5e5ea5c16897e', + deploymentId: '5e5ea5c16897e', + deploymentCreatedAt: '2020-10-15T06:38:00.000+00:00', + latestDeploymentId: '5e5ea5c16897e', + latestDeploymentCreatedAt: '2020-10-15T06:38:00.000+00:00', + latestDeploymentStatus: 'ready', scopes: [], vars: [], events: [], @@ -44,7 +48,11 @@ void main() { expect(result.live, true); expect(result.logging, true); expect(result.runtime, 'python-3.8'); - expect(result.deployment, '5e5ea5c16897e'); + expect(result.deploymentId, '5e5ea5c16897e'); + expect(result.deploymentCreatedAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.latestDeploymentId, '5e5ea5c16897e'); + expect(result.latestDeploymentCreatedAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.latestDeploymentStatus, 'ready'); expect(result.scopes, []); expect(result.vars, []); expect(result.events, []); diff --git a/test/src/models/index_test.dart b/test/src/models/index_test.dart index 8c45dee4..fd8b9fc9 100644 --- a/test/src/models/index_test.dart +++ b/test/src/models/index_test.dart @@ -11,6 +11,7 @@ void main() { status: 'available', error: 'string', attributes: [], + lengths: [], $createdAt: '2020-10-15T06:38:00.000+00:00', $updatedAt: '2020-10-15T06:38:00.000+00:00', ); @@ -23,6 +24,7 @@ void main() { expect(result.status, 'available'); expect(result.error, 'string'); expect(result.attributes, []); + expect(result.lengths, []); expect(result.$createdAt, '2020-10-15T06:38:00.000+00:00'); expect(result.$updatedAt, '2020-10-15T06:38:00.000+00:00'); }); diff --git a/test/src/models/resource_token_list_test.dart b/test/src/models/resource_token_list_test.dart new file mode 100644 index 00000000..1c1cd293 --- /dev/null +++ b/test/src/models/resource_token_list_test.dart @@ -0,0 +1,20 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('ResourceTokenList', () { + + test('model', () { + final model = ResourceTokenList( + total: 5, + tokens: [], + ); + + final map = model.toMap(); + final result = ResourceTokenList.fromMap(map); + + expect(result.total, 5); + expect(result.tokens, []); + }); + }); +} diff --git a/test/src/models/resource_token_test.dart b/test/src/models/resource_token_test.dart new file mode 100644 index 00000000..1334f1e0 --- /dev/null +++ b/test/src/models/resource_token_test.dart @@ -0,0 +1,30 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('ResourceToken', () { + + test('model', () { + final model = ResourceToken( + $id: 'bb8ea5c16897e', + $createdAt: '2020-10-15T06:38:00.000+00:00', + resourceId: '5e5ea5c168bb8:5e5ea5c168bb8', + resourceType: 'files', + expire: '2020-10-15T06:38:00.000+00:00', + secret: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + accessedAt: '2020-10-15T06:38:00.000+00:00', + ); + + final map = model.toMap(); + final result = ResourceToken.fromMap(map); + + expect(result.$id, 'bb8ea5c16897e'); + expect(result.$createdAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.resourceId, '5e5ea5c168bb8:5e5ea5c168bb8'); + expect(result.resourceType, 'files'); + expect(result.expire, '2020-10-15T06:38:00.000+00:00'); + expect(result.secret, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'); + expect(result.accessedAt, '2020-10-15T06:38:00.000+00:00'); + }); + }); +} diff --git a/test/src/models/site_list_test.dart b/test/src/models/site_list_test.dart new file mode 100644 index 00000000..8aa8e225 --- /dev/null +++ b/test/src/models/site_list_test.dart @@ -0,0 +1,20 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('SiteList', () { + + test('model', () { + final model = SiteList( + total: 5, + sites: [], + ); + + final map = model.toMap(); + final result = SiteList.fromMap(map); + + expect(result.total, 5); + expect(result.sites, []); + }); + }); +} diff --git a/test/src/models/site_test.dart b/test/src/models/site_test.dart new file mode 100644 index 00000000..234eef88 --- /dev/null +++ b/test/src/models/site_test.dart @@ -0,0 +1,74 @@ +import 'package:dart_appwrite/models.dart'; +import 'package:test/test.dart'; + +void main() { + group('Site', () { + + test('model', () { + final model = Site( + $id: '5e5ea5c16897e', + $createdAt: '2020-10-15T06:38:00.000+00:00', + $updatedAt: '2020-10-15T06:38:00.000+00:00', + name: 'My Site', + enabled: true, + live: true, + logging: true, + framework: 'react', + deploymentId: '5e5ea5c16897e', + deploymentCreatedAt: '2020-10-15T06:38:00.000+00:00', + deploymentScreenshotLight: '5e5ea5c16897e', + deploymentScreenshotDark: '5e5ea5c16897e', + latestDeploymentId: '5e5ea5c16897e', + latestDeploymentCreatedAt: '2020-10-15T06:38:00.000+00:00', + latestDeploymentStatus: 'ready', + vars: [], + timeout: 300, + installCommand: 'npm install', + buildCommand: 'npm run build', + outputDirectory: 'build', + installationId: '6m40at4ejk5h2u9s1hboo', + providerRepositoryId: 'appwrite', + providerBranch: 'main', + providerRootDirectory: 'sites/helloWorld', + providerSilentMode: true, + specification: 's-1vcpu-512mb', + buildRuntime: 'node-22', + adapter: 'static', + fallbackFile: 'index.html', + ); + + final map = model.toMap(); + final result = Site.fromMap(map); + + expect(result.$id, '5e5ea5c16897e'); + expect(result.$createdAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.$updatedAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.name, 'My Site'); + expect(result.enabled, true); + expect(result.live, true); + expect(result.logging, true); + expect(result.framework, 'react'); + expect(result.deploymentId, '5e5ea5c16897e'); + expect(result.deploymentCreatedAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.deploymentScreenshotLight, '5e5ea5c16897e'); + expect(result.deploymentScreenshotDark, '5e5ea5c16897e'); + expect(result.latestDeploymentId, '5e5ea5c16897e'); + expect(result.latestDeploymentCreatedAt, '2020-10-15T06:38:00.000+00:00'); + expect(result.latestDeploymentStatus, 'ready'); + expect(result.vars, []); + expect(result.timeout, 300); + expect(result.installCommand, 'npm install'); + expect(result.buildCommand, 'npm run build'); + expect(result.outputDirectory, 'build'); + expect(result.installationId, '6m40at4ejk5h2u9s1hboo'); + expect(result.providerRepositoryId, 'appwrite'); + expect(result.providerBranch, 'main'); + expect(result.providerRootDirectory, 'sites/helloWorld'); + expect(result.providerSilentMode, true); + expect(result.specification, 's-1vcpu-512mb'); + expect(result.buildRuntime, 'node-22'); + expect(result.adapter, 'static'); + expect(result.fallbackFile, 'index.html'); + }); + }); +} diff --git a/test/src/models/variable_test.dart b/test/src/models/variable_test.dart index ccfcc793..0d86ef00 100644 --- a/test/src/models/variable_test.dart +++ b/test/src/models/variable_test.dart @@ -11,6 +11,7 @@ void main() { $updatedAt: '2020-10-15T06:38:00.000+00:00', key: 'API_KEY', value: 'myPa\$\$word1', + secret: true, resourceType: 'function', resourceId: 'myAwesomeFunction', ); @@ -23,6 +24,7 @@ void main() { expect(result.$updatedAt, '2020-10-15T06:38:00.000+00:00'); expect(result.key, 'API_KEY'); expect(result.value, 'myPa\$\$word1'); + expect(result.secret, true); expect(result.resourceType, 'function'); expect(result.resourceId, 'myAwesomeFunction'); });