diff --git a/app/config/scopes.php b/app/config/scopes.php index 228945e107..40fce95c5a 100644 --- a/app/config/scopes.php +++ b/app/config/scopes.php @@ -77,7 +77,7 @@ return [ // List of publicly visible scopes 'description' => 'Access to read your project\'s health status', ], 'migrations.read' => [ - 'description' => 'Access to read your project\'s migration logs', + 'description' => 'Access to read your project\'s migrations', ], 'migrations.write' => [ 'description' => 'Access to create, update, and delete your project\'s migrations.', diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index f2190581e4..723e25d459 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -887,7 +887,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') ->setContentType('application/gzip') ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache ->addHeader('X-Peak', \memory_get_peak_usage()) - ->addHeader('Content-Disposition', 'attachment; filename="deployment.tar.gz"') + ->addHeader('Content-Disposition', 'attachment; filename="'.$deploymentId.'.tar.gz"') ; $size = $deviceFunctions->getFileSize($path); diff --git a/app/workers/migrations.php b/app/workers/migrations.php index 77d082d3dd..3adf5da588 100644 --- a/app/workers/migrations.php +++ b/app/workers/migrations.php @@ -80,33 +80,33 @@ class MigrationsV1 extends Worker switch ($source) { case Firebase::getName(): return new Firebase( - json_decode($source['serviceAccount'], true), + json_decode($credentials['serviceAccount'], true), ); break; case Supabase::getName(): return new Supabase( - $source['endpoint'], - $source['apiKey'], - $source['databaseHost'], + $credentials['endpoint'], + $credentials['apiKey'], + $credentials['databaseHost'], "postgres", - $source['username'], - $source['password'], - $source['port'], + $credentials['username'], + $credentials['password'], + $credentials['port'], ); break; case NHost::getName(): return new NHost( - $source['subdomain'], - $source['region'], - $source['adminSecret'], - $source['database'], - $source['username'], - $source['password'], - $source['port'], + $credentials['subdomain'], + $credentials['region'], + $credentials['adminSecret'], + $credentials['database'], + $credentials['username'], + $credentials['password'], + $credentials['port'], ); break; case Appwrite::getName(): - return new Appwrite($source['projectId'], str_starts_with($source['endpoint'], 'http://localhost/v1') ? 'http://appwrite/v1' : $source['endpoint'], $source['apiKey']); + return new Appwrite($credentials['projectId'], str_starts_with($credentials['endpoint'], 'http://localhost/v1') ? 'http://appwrite/v1' : $credentials['endpoint'], $credentials['apiKey']); break; default: throw new \Exception('Invalid source type'); diff --git a/composer.lock b/composer.lock index bddd299aec..1ca8bf0ad0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a44fe2d1e439a697ba716c11ca48c232", + "content-hash": "c57d2e44484b37a709868463f2278c1b", "packages": [ { "name": "adhocore/jwt", @@ -1298,55 +1298,6 @@ ], "time": "2022-02-28T15:31:21+00:00" }, - { - "name": "psr/cache", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/2.0.0" - }, - "time": "2021-02-03T23:23:37+00:00" - }, { "name": "psr/http-client", "version": "1.0.2", @@ -2942,12 +2893,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/transfer.git", - "reference": "c7bae26f5672203e1228e237b29abaa05d105055" + "reference": "020f52a974d0b83f20f01917238fde2775be0352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/transfer/zipball/c7bae26f5672203e1228e237b29abaa05d105055", - "reference": "c7bae26f5672203e1228e237b29abaa05d105055", + "url": "https://api.github.com/repos/utopia-php/transfer/zipball/020f52a974d0b83f20f01917238fde2775be0352", + "reference": "020f52a974d0b83f20f01917238fde2775be0352", "shasum": "" }, "require": { @@ -2971,6 +2922,14 @@ "Utopia\\Tests\\": "tests/Transfer" } }, + "scripts": { + "lint": [ + "./vendor/bin/pint --test" + ], + "format": [ + "./vendor/bin/pint" + ] + }, "license": [ "MIT" ], @@ -2996,7 +2955,7 @@ "source": "https://github.com/utopia-php/transfer/tree/feat-improve-features", "issues": "https://github.com/utopia-php/transfer/issues" }, - "time": "2023-07-20T10:33:10+00:00" + "time": "2023-07-24T14:36:49+00:00" }, { "name": "utopia-php/websocket", @@ -3937,16 +3896,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.1", + "version": "1.23.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" + "reference": "a2b24135c35852b348894320d47b3902a94bc494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", + "reference": "a2b24135c35852b348894320d47b3902a94bc494", "shasum": "" }, "require": { @@ -3978,9 +3937,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" }, - "time": "2023-06-29T20:46:06+00:00" + "time": "2023-07-23T22:17:56+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/docker-compose.yml b/docker-compose.yml index 20e0843fab..9d09832773 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -587,9 +587,8 @@ services: - ./app:/usr/src/code/app - ./src:/usr/src/code/src - ./tests:/usr/src/code/tests - - ./vendor:/usr/src/code/vendor depends_on: - - redis + - mariadb environment: - _APP_ENV - _APP_OPENSSL_KEY_V1 diff --git a/src/Appwrite/Event/Migration.php b/src/Appwrite/Event/Migration.php index 095f13a069..4d53f16796 100644 --- a/src/Appwrite/Event/Migration.php +++ b/src/Appwrite/Event/Migration.php @@ -95,24 +95,4 @@ class Migration extends Event 'migration' => $this->migration ]); } - - /** - * {@inheritdoc} - */ - public function setUser(Document $user): self - { - parent::setUser($user); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function setProject(Document $project): self - { - parent::setProject($project); - - return $this; - } } diff --git a/src/Appwrite/Utopia/Response/Model/ImportValidationError.php b/src/Appwrite/Utopia/Response/Model/ImportValidationError.php deleted file mode 100644 index a255d39739..0000000000 --- a/src/Appwrite/Utopia/Response/Model/ImportValidationError.php +++ /dev/null @@ -1,28 +0,0 @@ -