From c63505078dc7966dc223536a2cca7f2422b21a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 13 May 2023 12:08:02 +0200 Subject: [PATCH] Fix bugs with new versions of utopia --- app/config/errors.php | 2 +- app/controllers/api/functions.php | 15 +++++++-------- composer.json | 2 +- composer.lock | 24 ++++++++---------------- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index 1b34bce131..f75bdee48f 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -337,7 +337,7 @@ return [ ], Exception::FUNCTION_ENTRYPOINT_MISSING => [ 'name' => Exception::FUNCTION_RUNTIME_UNSUPPORTED, - 'description' => 'Entrypoint missing. Specify it on deployment or in function settings.', + 'description' => 'Entrypoint missing. Specify it in function settings.', 'code' => 404, ], diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index d7fac8a304..27a3af939d 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -70,9 +70,9 @@ App::post('/v1/functions') ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.', true) ->param('enabled', true, new Boolean(), 'Is function enabled?', true) ->param('logging', true, new Boolean(), 'Do executions get logged?', true) - ->param('entrypoint', '', new Text('1028', 0), 'Entrypoint File.', true) - ->param('buildCommand', '', new Text('1028', 0), 'Build Command.', true) - ->param('installCommand', '', new Text('1028', 0), 'Install Command.', true) + ->param('entrypoint', '', new Text('1028'), 'Entrypoint File.', true) + ->param('buildCommand', '', new Text('1028'), 'Build Command.', true) + ->param('installCommand', '', new Text('1028'), 'Install Command.', true) ->inject('response') ->inject('dbForProject') ->inject('project') @@ -519,9 +519,9 @@ App::put('/v1/functions/:functionId') ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Maximum execution time in seconds.', true) ->param('enabled', true, new Boolean(), 'Is function enabled?', true) ->param('logging', true, new Boolean(), 'Do executions get logged?', true) - ->param('entrypoint', '', new Text('1028', 0), 'Entrypoint File.', true) - ->param('buildCommand', '', new Text('1028', 0), 'Build Command.', true) - ->param('installCommand', '', new Text('1028', 0), 'Install Command.', true) + ->param('entrypoint', '', new Text('1028'), 'Entrypoint File.', true) + ->param('buildCommand', '', new Text('1028'), 'Build Command.', true) + ->param('installCommand', '', new Text('1028'), 'Install Command.', true) ->inject('response') ->inject('dbForProject') ->inject('project') @@ -703,8 +703,7 @@ App::post('/v1/functions/:functionId/deployments') ->inject('project') ->inject('deviceFunctions') ->inject('deviceLocal') - ->inject('dbForConsole') - ->action(function (string $functionId, string $entrypoint, mixed $code, bool $activate, string $buildCommand, string $installCommand, Request $request, Response $response, Database $dbForProject, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal, Database $dbForConsole) { + ->action(function (string $functionId, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { diff --git a/composer.json b/composer.json index 8abb6359ce..be6eed6e3d 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,7 @@ "utopia-php/pools": "0.4.*", "utopia-php/preloader": "0.2.*", "utopia-php/domains": "1.1.*", - "utopia-php/framework": "dev-fix-wildcard-edge-cases as 0.26.99", + "utopia-php/framework": "0.26.*", "utopia-php/image": "0.5.*", "utopia-php/dsn": "0.1.*", "utopia-php/locale": "0.4.*", diff --git a/composer.lock b/composer.lock index da43730d8f..551347b579 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": "86bc4c68a6cdf7c44b5e5ae0a99dfcb8", + "content-hash": "e517892c33b9d686f2a94d5b6a4b5ee6", "packages": [ { "name": "adhocore/jwt", @@ -1977,24 +1977,23 @@ }, { "name": "utopia-php/framework", - "version": "dev-fix-wildcard-edge-cases", + "version": "0.26.0", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "465873344b3c77392444fc70e8bcdf36f089d4b4" + "reference": "e8da5576370366d3bf9c574ec855f8c96fe4f34e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/465873344b3c77392444fc70e8bcdf36f089d4b4", - "reference": "465873344b3c77392444fc70e8bcdf36f089d4b4", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/e8da5576370366d3bf9c574ec855f8c96fe4f34e", + "reference": "e8da5576370366d3bf9c574ec855f8c96fe4f34e", "shasum": "" }, "require": { - "php": ">=8.0" + "php": ">=8.0.0" }, "require-dev": { "laravel/pint": "^1.2", - "phpstan/phpstan": "1.9.x-dev", "phpunit/phpunit": "^9.5.25", "vimeo/psalm": "4.27.0" }, @@ -2016,9 +2015,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/fix-wildcard-edge-cases" + "source": "https://github.com/utopia-php/framework/tree/0.26.0" }, - "time": "2023-05-11T20:03:11+00:00" + "time": "2023-01-13T08:14:43+00:00" }, { "name": "utopia-php/image", @@ -5442,17 +5441,10 @@ "version": "dev-feat-add-path-keyword", "alias": "0.28.99", "alias_normalized": "0.28.99.0" - }, - { - "package": "utopia-php/framework", - "version": "dev-fix-wildcard-edge-cases", - "alias": "0.26.99", - "alias_normalized": "0.26.99.0" } ], "minimum-stability": "stable", "stability-flags": { - "utopia-php/framework": 20, "appwrite/sdk-generator": 20 }, "prefer-stable": false,