From c729a84d51b600352a6985b923ed457dd97e863a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 15:55:11 +0530 Subject: [PATCH 1/8] chore: update dart to 16.1.0 and flutter to 17.0.2 --- app/config/platforms.php | 8 +++---- composer.lock | 24 +++++++++---------- .../examples/databases/upsert-document.md | 16 +++++++++++++ .../examples/databases/upsert-documents.md | 2 +- docs/sdks/dart/CHANGELOG.md | 8 +++++++ docs/sdks/flutter/CHANGELOG.md | 13 +++++++++- 6 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md diff --git a/app/config/platforms.php b/app/config/platforms.php index 2be2b4e2e5..2b4382a4cd 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -59,7 +59,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '17.0.1', + 'version' => '17.0.2', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -72,7 +72,7 @@ return [ 'gitUrl' => 'git@github.com:appwrite/sdk-for-flutter.git', 'gitRepoName' => 'sdk-for-flutter', 'gitUserName' => 'appwrite', - 'gitBranch' => 'dev', + 'gitBranch' => 'dev-chirag', ], [ 'key' => 'apple', @@ -376,7 +376,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '16.0.0', + 'version' => '16.0.1', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -389,7 +389,7 @@ return [ 'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git', 'gitRepoName' => 'sdk-for-dart', 'gitUserName' => 'appwrite', - 'gitBranch' => 'dev', + 'gitBranch' => 'dev-chirag', ], [ 'key' => 'kotlin', diff --git a/composer.lock b/composer.lock index 730eb171ab..79953a912c 100644 --- a/composer.lock +++ b/composer.lock @@ -3493,16 +3493,16 @@ }, { "name": "utopia-php/database", - "version": "0.71.9", + "version": "0.71.10", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "eb2f759020bba617e99dd67973a9bd949b47f54e" + "reference": "83278d663f9c63c25a11d9e71c7922da7ec48636" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/eb2f759020bba617e99dd67973a9bd949b47f54e", - "reference": "eb2f759020bba617e99dd67973a9bd949b47f54e", + "url": "https://api.github.com/repos/utopia-php/database/zipball/83278d663f9c63c25a11d9e71c7922da7ec48636", + "reference": "83278d663f9c63c25a11d9e71c7922da7ec48636", "shasum": "" }, "require": { @@ -3543,9 +3543,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.71.9" + "source": "https://github.com/utopia-php/database/tree/0.71.10" }, - "time": "2025-07-02T16:37:41+00:00" + "time": "2025-07-18T00:05:55+00:00" }, { "name": "utopia-php/detector", @@ -4810,16 +4810,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.15", + "version": "0.41.16", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "02a7e0df5a555c7bdfb50cb68db60460afb409e1" + "reference": "0b01a3917c2f08f7671efe17bd631bb491d8efac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/02a7e0df5a555c7bdfb50cb68db60460afb409e1", - "reference": "02a7e0df5a555c7bdfb50cb68db60460afb409e1", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/0b01a3917c2f08f7671efe17bd631bb491d8efac", + "reference": "0b01a3917c2f08f7671efe17bd631bb491d8efac", "shasum": "" }, "require": { @@ -4855,9 +4855,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.41.15" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.16" }, - "time": "2025-07-16T13:00:21+00:00" + "time": "2025-07-18T07:26:58+00:00" }, { "name": "doctrine/annotations", diff --git a/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md new file mode 100644 index 0000000000..93e306ebce --- /dev/null +++ b/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.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 + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '', + collectionId: '', + documentId: '', + data: {}, + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md index 46611b3b1e..cd35014f63 100644 --- a/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md @@ -10,5 +10,5 @@ Databases databases = Databases(client); DocumentList result = await databases.upsertDocuments( databaseId: '', collectionId: '', - documents: [], // (optional) + documents: [], ); diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md index 57a53e5f75..5b77784063 100644 --- a/docs/sdks/dart/CHANGELOG.md +++ b/docs/sdks/dart/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 16.1.0 + +* Add `gif` support to `ImageFormat` enum +* Add support for `dart38` and `flutter332` runtimes +* Add `upsertDocument()` method to Databases service +* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map` +* Fix `upsertDocuments()` method to have `documents` attribute as required parameter + ## 16.0.0 * Add `` to doc examples due to the new multi region endpoints diff --git a/docs/sdks/flutter/CHANGELOG.md b/docs/sdks/flutter/CHANGELOG.md index f707c645e6..e94f5d0abf 100644 --- a/docs/sdks/flutter/CHANGELOG.md +++ b/docs/sdks/flutter/CHANGELOG.md @@ -1,9 +1,20 @@ # Change Log -## 16.1.1 +## 17.0.2 + +* Add `gif` support to `ImageFormat` enum +* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map` + +## 17.0.1 + +* Fix `devKeys` support by conditionally including credentials during requests + +## 17.0.0 * Update `flutter_web_auth_2` dependency to version 4.1.0 * Update `auth.html` example in README.md to align with `flutter_web_auth_2` documentation +* Breaking changes: + * Minimum iOS version supported is now 17.4 due to the updated requirements of `flutter_web_auth_2` version 4.1.0 ## 16.1.0 From 0cc443b47ccb3b5d0d940340acb77a3fae731d6b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 15:56:12 +0530 Subject: [PATCH 2/8] fix: branch name --- app/config/platforms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 2b4382a4cd..cf4a5eaba4 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -72,7 +72,7 @@ return [ 'gitUrl' => 'git@github.com:appwrite/sdk-for-flutter.git', 'gitRepoName' => 'sdk-for-flutter', 'gitUserName' => 'appwrite', - 'gitBranch' => 'dev-chirag', + 'gitBranch' => 'dev', ], [ 'key' => 'apple', @@ -389,7 +389,7 @@ return [ 'gitUrl' => 'git@github.com:appwrite/sdk-for-dart.git', 'gitRepoName' => 'sdk-for-dart', 'gitUserName' => 'appwrite', - 'gitBranch' => 'dev-chirag', + 'gitBranch' => 'dev', ], [ 'key' => 'kotlin', From 712425c383e05da26b6275552e80ff69d838d195 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 15:59:09 +0530 Subject: [PATCH 3/8] fix: version --- app/config/platforms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index cf4a5eaba4..1368caea52 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -376,7 +376,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '16.0.1', + 'version' => '16.1.0', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, From 99ea9c5d80dbd5f4f8f86afadf919d2b831cc2ff Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 17:10:20 +0530 Subject: [PATCH 4/8] chore: update cli to 8.2.2 --- app/config/platforms.php | 3 ++- composer.lock | 12 ++++++------ docs/sdks/cli/CHANGELOG.md | 12 ++++++++++++ src/Appwrite/Platform/Tasks/SDKs.php | 5 +++-- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/config/platforms.php b/app/config/platforms.php index 1368caea52..15eb8b3893 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -217,7 +217,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '8.2.1', + 'version' => '8.2.2', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -231,6 +231,7 @@ return [ 'gitRepoName' => 'sdk-for-cli', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'repoBranch' => 'master', 'exclude' => [ 'services' => [ ['name' => 'assistant'], diff --git a/composer.lock b/composer.lock index 79953a912c..ea3b3459a6 100644 --- a/composer.lock +++ b/composer.lock @@ -4810,16 +4810,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.16", + "version": "0.41.17", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "0b01a3917c2f08f7671efe17bd631bb491d8efac" + "reference": "ef5e9d952032deecffee7f825a941c40ed4c84b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/0b01a3917c2f08f7671efe17bd631bb491d8efac", - "reference": "0b01a3917c2f08f7671efe17bd631bb491d8efac", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/ef5e9d952032deecffee7f825a941c40ed4c84b8", + "reference": "ef5e9d952032deecffee7f825a941c40ed4c84b8", "shasum": "" }, "require": { @@ -4855,9 +4855,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.41.16" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.17" }, - "time": "2025-07-18T07:26:58+00:00" + "time": "2025-07-18T08:18:48+00:00" }, { "name": "doctrine/annotations", diff --git a/docs/sdks/cli/CHANGELOG.md b/docs/sdks/cli/CHANGELOG.md index 4512cce0de..e32614cad0 100644 --- a/docs/sdks/cli/CHANGELOG.md +++ b/docs/sdks/cli/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 8.2.2 + +* Fix object comparison logic when pushing settings +* Type generation fixes: + * Dart: Fixed import casing to snake_case, removed `extends Document` and hardcoded attributes, removed unnecessary imports + * Java: Fixed indentation to 4 spaces, updated imports to `java.util.Objects`, fixed enum casing in strict mode as per [Oracle official docs](https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html) + * Javascript: Updated optional values formatting from `|null` to `| null` + * Kotlin: Fixed indentation to 4 spaces per [Kotlinlang official docs](https://kotlinlang.org/docs/coding-conventions.html#indentation) + * PHP: Fixed indentation to 4 spaces per [PHP Fig official docs](https://www.php-fig.org/psr/psr-2/) + * Swift: Fixed indentation to 4 spaces, improved `decodeIfPresent` usage for optionals, added missing `public` to `init` method + * Typescript: Fixed indentation to 4 spaces per [Typescript coding guidelines](https://github.com/microsoft/TypeScript/wiki/Coding-guidelines) + ## 8.2.1 * Added `--with-variables` option to the Sites command for adding/updating environment variables diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index ea73af541c..755dfac627 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -272,6 +272,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $gitUrl = 'git@github.com:aw-tests/' . $language['gitRepoName'] . '.git'; } + $branch = $language['repoBranch'] ?? 'main'; if ($git && !empty($gitUrl)) { \exec('rm -rf ' . $target . ' && \ mkdir -p ' . $target . ' && \ @@ -279,8 +280,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND git init && \ git remote add origin ' . $gitUrl . ' && \ git fetch origin && \ - git checkout main || git checkout -b main && \ - git pull origin main && \ + git checkout ' . $branch . ' || git checkout -b ' . $branch . ' && \ + git pull origin ' . $branch . ' && \ git checkout ' . $gitBranch . ' || git checkout -b ' . $gitBranch . ' && \ git fetch origin ' . $gitBranch . ' || git push -u origin ' . $gitBranch . ' && \ git pull origin ' . $gitBranch . ' && \ From ea0654cf5eb5f38c587839f2104c92e7811fb1d2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 17:16:01 +0530 Subject: [PATCH 5/8] improve naming --- src/Appwrite/Platform/Tasks/SDKs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 755dfac627..98a1ae6a10 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -272,7 +272,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $gitUrl = 'git@github.com:aw-tests/' . $language['gitRepoName'] . '.git'; } - $branch = $language['repoBranch'] ?? 'main'; + $repoBranch = $language['repoBranch'] ?? 'main'; if ($git && !empty($gitUrl)) { \exec('rm -rf ' . $target . ' && \ mkdir -p ' . $target . ' && \ @@ -280,8 +280,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND git init && \ git remote add origin ' . $gitUrl . ' && \ git fetch origin && \ - git checkout ' . $branch . ' || git checkout -b ' . $branch . ' && \ - git pull origin ' . $branch . ' && \ + git checkout ' . $repoBranch . ' || git checkout -b ' . $repoBranch . ' && \ + git pull origin ' . $repoBranch . ' && \ git checkout ' . $gitBranch . ' || git checkout -b ' . $gitBranch . ' && \ git fetch origin ' . $gitBranch . ' || git push -u origin ' . $gitBranch . ' && \ git pull origin ' . $gitBranch . ' && \ From d613237fb447fefc6a2520da6cce593681210cff Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 22:08:43 +0530 Subject: [PATCH 6/8] chore: improve invalid scheme error in origin check --- src/Appwrite/Network/Validator/Origin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index fc58651723..bdf56f0f9b 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -75,6 +75,10 @@ class Origin extends Validator return 'Invalid Origin.'; } + if (!isset($platform)) { + return 'Invalid Scheme. The scheme used ( ' . $this->scheme . ' ) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`'; + } + return 'Invalid Origin. Register your new client ' . $host . ' as a new ' . $platform . ' platform on your project console dashboard'; } From c55f039f13baef7c504e87d380f6a7430b26c6fb Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 18 Jul 2025 22:23:33 +0530 Subject: [PATCH 7/8] chore: add unit test --- src/Appwrite/Network/Validator/Origin.php | 8 +++++--- tests/unit/Network/Validators/OriginTest.php | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index bdf56f0f9b..fff12fa045 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -12,6 +12,7 @@ class Origin extends Validator protected array $schemes = []; protected ?string $scheme = null; protected ?string $host = null; + protected string $origin = ''; /** * Constructor @@ -32,6 +33,7 @@ class Origin extends Validator */ public function isValid($origin): bool { + $this->origin = $origin; $this->scheme = null; $this->host = null; @@ -68,15 +70,15 @@ class Origin extends Validator */ public function getDescription(): string { - $platform = $this->scheme ? Platform::getNameByScheme($this->scheme) : null; + $platform = $this->scheme ? Platform::getNameByScheme($this->scheme) : ''; $host = $this->host ? '(' . $this->host . ')' : ''; if (empty($this->host) && empty($this->scheme)) { return 'Invalid Origin.'; } - if (!isset($platform)) { - return 'Invalid Scheme. The scheme used ( ' . $this->scheme . ' ) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`'; + if (empty($platform)) { + return 'Invalid Scheme. The scheme used ( ' . $this->scheme . ' ) in the Origin ( ' . $this->origin . ' ) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`'; } return 'Invalid Origin. Register your new client ' . $host . ' as a new ' diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index 516108bc32..1a150bada9 100644 --- a/tests/unit/Network/Validators/OriginTest.php +++ b/tests/unit/Network/Validators/OriginTest.php @@ -106,5 +106,8 @@ class OriginTest extends TestCase $this->assertEquals(false, $validator->isValid('ms-browser-extension://com.company.appname')); $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Edge Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('random-scheme://localhost')); + $this->assertEquals('Invalid Scheme. The scheme used ( random-scheme ) in the Origin ( random-scheme://localhost ) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`', $validator->getDescription()); } } From 7fecfc73ca5adf493778bc4657b954bb2f619c48 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sat, 19 Jul 2025 10:39:39 +0530 Subject: [PATCH 8/8] fix: formatting --- src/Appwrite/Network/Validator/Origin.php | 2 +- tests/unit/Network/Validators/OriginTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index fff12fa045..7843a17f1c 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -78,7 +78,7 @@ class Origin extends Validator } if (empty($platform)) { - return 'Invalid Scheme. The scheme used ( ' . $this->scheme . ' ) in the Origin ( ' . $this->origin . ' ) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`'; + return 'Invalid Scheme. The scheme used (' . $this->scheme . ') in the Origin (' . $this->origin . ') is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`'; } return 'Invalid Origin. Register your new client ' . $host . ' as a new ' diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index 1a150bada9..d312f8c5a5 100644 --- a/tests/unit/Network/Validators/OriginTest.php +++ b/tests/unit/Network/Validators/OriginTest.php @@ -108,6 +108,6 @@ class OriginTest extends TestCase $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Edge Extension) platform on your project console dashboard', $validator->getDescription()); $this->assertEquals(false, $validator->isValid('random-scheme://localhost')); - $this->assertEquals('Invalid Scheme. The scheme used ( random-scheme ) in the Origin ( random-scheme://localhost ) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`', $validator->getDescription()); + $this->assertEquals('Invalid Scheme. The scheme used (random-scheme) in the Origin (random-scheme://localhost) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-`', $validator->getDescription()); } }