diff --git a/app/init/config.php b/app/init/config.php index 5ae3c82dbc..80001f13b4 100644 --- a/app/init/config.php +++ b/app/init/config.php @@ -33,3 +33,4 @@ Config::load('storage-logos', __DIR__ . '/../config/storage/logos.php'); Config::load('storage-mimes', __DIR__ . '/../config/storage/mimes.php'); Config::load('storage-inputs', __DIR__ . '/../config/storage/inputs.php'); Config::load('storage-outputs', __DIR__ . '/../config/storage/outputs.php'); +Config::load('function-templates', __DIR__ . '/../config/function-templates.php'); diff --git a/app/init2.php b/app/init2.php index 80a9deff1e..ec240f8a2d 100644 --- a/app/init2.php +++ b/app/init2.php @@ -236,7 +236,7 @@ $global->set('geodb', function () { /** * @disregard P1009 Undefined type */ - return new Reader(__DIR__ . '/assets/dbip/dbip-country-lite-2024-02.mmdb'); + return new Reader(__DIR__ . '/assets/dbip/dbip-country-lite-2024-08.mmdb'); }); $global->set('hooks', function () { @@ -631,14 +631,15 @@ $user } $jwtUserId = $payload['userId'] ?? ''; - $jwtSessionId = $payload['sessionId'] ?? ''; - - if ($jwtUserId && $jwtSessionId) { + if (!empty($jwtUserId)) { $user = $dbForProject->getDocument('users', $jwtUserId); } - if (empty($user->find('$id', $jwtSessionId, 'sessions'))) { // Match JWT to active token - $user = new Document([]); + $jwtSessionId = $payload['sessionId'] ?? ''; + if(!empty($jwtSessionId)) { + if (empty($user->find('$id', $jwtSessionId, 'sessions'))) { // Match JWT to active token + $user = new Document([]); + } } } diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index 7a0d5b60ac..6aba8fd8e4 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Services; +use Appwrite\Platform\Tasks\DevGenerateTranslations; use Appwrite\Platform\Tasks\Doctor; use Appwrite\Platform\Tasks\Install; use Appwrite\Platform\Tasks\Maintenance; @@ -25,6 +26,7 @@ class Tasks extends Service { $this->type = Service::TYPE_TASK; $this + ->addAction(DevGenerateTranslations::getName(), new DevGenerateTranslations()) ->addAction(Doctor::getName(), new Doctor()) ->addAction(Install::getName(), new Install()) ->addAction(Maintenance::getName(), new Maintenance()) diff --git a/src/Appwrite/Utopia/Response/Models.php b/src/Appwrite/Utopia/Response/Models.php index cdab9d48a7..778a077e4b 100644 --- a/src/Appwrite/Utopia/Response/Models.php +++ b/src/Appwrite/Utopia/Response/Models.php @@ -127,6 +127,7 @@ class Models self::setModel(new BaseList('Teams List', Response::MODEL_TEAM_LIST, 'teams', Response::MODEL_TEAM)); self::setModel(new BaseList('Memberships List', Response::MODEL_MEMBERSHIP_LIST, 'memberships', Response::MODEL_MEMBERSHIP)); self::setModel(new BaseList('Functions List', Response::MODEL_FUNCTION_LIST, 'functions', Response::MODEL_FUNCTION)); + self::setModel(new BaseList('Function Templates List', Response::MODEL_TEMPLATE_FUNCTION_LIST, 'templates', Response::MODEL_TEMPLATE_FUNCTION)); self::setModel(new BaseList('Installations List', Response::MODEL_INSTALLATION_LIST, 'installations', Response::MODEL_INSTALLATION)); self::setModel(new BaseList('Provider Repositories List', Response::MODEL_PROVIDER_REPOSITORY_LIST, 'providerRepositories', Response::MODEL_PROVIDER_REPOSITORY)); self::setModel(new BaseList('Branches List', Response::MODEL_BRANCH_LIST, 'branches', Response::MODEL_BRANCH));