diff --git a/app/config/platforms.php b/app/config/platforms.php index 2be2b4e2e5..15eb8b3893 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, @@ -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'], @@ -376,7 +377,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '16.0.0', + 'version' => '16.1.0', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, diff --git a/composer.lock b/composer.lock index 052644ba5b..73baf27824 100644 --- a/composer.lock +++ b/composer.lock @@ -4810,16 +4810,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.15", + "version": "0.41.17", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "02a7e0df5a555c7bdfb50cb68db60460afb409e1" + "reference": "ef5e9d952032deecffee7f825a941c40ed4c84b8" }, "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/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.15" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.17" }, - "time": "2025-07-16T13:00:21+00:00" + "time": "2025-07-18T08:18:48+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/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/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 diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index fc58651723..7843a17f1c 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,13 +70,17 @@ 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 (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 ' . $platform . ' platform on your project console dashboard'; } diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 19eda3e81f..9ec968a9c0 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -293,6 +293,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $gitUrl = 'git@github.com:aw-tests/' . $language['gitRepoName'] . '.git'; } + $repoBranch = $language['repoBranch'] ?? 'main'; if ($git && !empty($gitUrl)) { \exec('rm -rf ' . $target . ' && \ mkdir -p ' . $target . ' && \ @@ -300,8 +301,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 ' . $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 . ' && \ diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index 516108bc32..d312f8c5a5 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()); } }