From defb94917e7b173bd194a8ce34c1324b1c115c1a Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 23 Aug 2021 23:36:50 +0300 Subject: [PATCH 01/14] Updated dependencies --- composer.json | 2 +- composer.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index cd8b6ad190..8467da8097 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "appwrite/php-clamav": "1.1.*", "appwrite/php-runtimes": "0.4.*", - "utopia-php/framework": "0.17.*", + "utopia-php/framework": "0.18.*", "utopia-php/abuse": "0.6.*", "utopia-php/analytics": "0.2.*", "utopia-php/audit": "0.6.*", diff --git a/composer.lock b/composer.lock index 9807b8fe7f..792a6214d2 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": "47aa9e5f236362f9b724bfd9bb592dc4", + "content-hash": "aac413429914bd9299a7ae722f00cef8", "packages": [ { "name": "adhocore/jwt", @@ -1988,12 +1988,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "d32d2cfe96115e99b6dcf69318daf570934e1e55" + "reference": "cb73391371f70ddb54bc0000064b15c5f173cb7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/d32d2cfe96115e99b6dcf69318daf570934e1e55", - "reference": "d32d2cfe96115e99b6dcf69318daf570934e1e55", + "url": "https://api.github.com/repos/utopia-php/database/zipball/cb73391371f70ddb54bc0000064b15c5f173cb7a", + "reference": "cb73391371f70ddb54bc0000064b15c5f173cb7a", "shasum": "" }, "require": { @@ -2043,7 +2043,7 @@ "issues": "https://github.com/utopia-php/database/issues", "source": "https://github.com/utopia-php/database/tree/feat-adjusted-query-validator" }, - "time": "2021-08-23T06:11:57+00:00" + "time": "2021-08-23T14:18:47+00:00" }, { "name": "utopia-php/domains", @@ -2101,16 +2101,16 @@ }, { "name": "utopia-php/framework", - "version": "0.17.3", + "version": "0.18.0", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "0274f6b3e49db2af0d702edf278ec7504dc99878" + "reference": "f577522a5eb8009967b893fb7ad4ee70d3f7c0db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/0274f6b3e49db2af0d702edf278ec7504dc99878", - "reference": "0274f6b3e49db2af0d702edf278ec7504dc99878", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/f577522a5eb8009967b893fb7ad4ee70d3f7c0db", + "reference": "f577522a5eb8009967b893fb7ad4ee70d3f7c0db", "shasum": "" }, "require": { @@ -2144,9 +2144,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.17.3" + "source": "https://github.com/utopia-php/framework/tree/0.18.0" }, - "time": "2021-08-03T13:57:01+00:00" + "time": "2021-08-19T04:58:47+00:00" }, { "name": "utopia-php/image", From 7cbebf80283fd907ca2bc4d99aa2f71f3585ad3e Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:38:15 +0300 Subject: [PATCH 02/14] Update app/config/collections2.php Co-authored-by: kodumbeats --- app/config/collections2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index c94fd02060..7576f71736 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -179,7 +179,7 @@ $collections = [ [ '$id' => 'signed', 'type' => Database::VAR_BOOLEAN, - 'size' => 64, + 'size' => 0, 'signed' => true, 'required' => false, 'default' => null, From 72f8402eddeb08f598502f887a29d0e9e124be8b Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:38:26 +0300 Subject: [PATCH 03/14] Update app/config/collections2.php --- app/config/collections2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index 7576f71736..67c7cf9bc4 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -136,7 +136,7 @@ $collections = [ '$id' => 'status', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 256, + 'size' => 16, 'signed' => true, 'required' => false, 'default' => null, From 75a1c7017435307bd078c838fd100c0171ef31b7 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:38:39 +0300 Subject: [PATCH 04/14] Update app/config/collections2.php Co-authored-by: kodumbeats --- app/config/collections2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index 67c7cf9bc4..aecfd4a400 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -189,7 +189,7 @@ $collections = [ [ '$id' => 'array', 'type' => Database::VAR_BOOLEAN, - 'size' => 64, + 'size' => 0, 'signed' => true, 'required' => false, 'default' => null, From 8d262ffbbb4918b4f3bba1155bb781c1e80a693d Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:39:15 +0300 Subject: [PATCH 05/14] Update app/config/collections2.php Co-authored-by: kodumbeats --- app/config/collections2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index aecfd4a400..91f5f35cbe 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -313,7 +313,7 @@ $collections = [ '$id' => 'orders', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 255, + 'size' => 4, 'signed' => true, 'required' => false, 'default' => null, From 5de5a38ba0f9e6fd19ca82aa16dd9e462e066a29 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:39:24 +0300 Subject: [PATCH 06/14] Update app/workers/database.php Co-authored-by: kodumbeats --- app/workers/database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/workers/database.php b/app/workers/database.php index d9fdd1263e..2b8fb26dcd 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -89,7 +89,6 @@ class DatabaseV1 extends Worker if(!$dbForExternal->createAttribute($collectionId, $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) { throw new Exception('Failed to create Attribute'); } - $dbForInternal->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'available')); } catch (\Throwable $th) { Console::error($th->getMessage()); From ca5f31dcf64be150ea690bb5bc062da1f50723a5 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:39:31 +0300 Subject: [PATCH 07/14] Update src/Appwrite/Utopia/Response/Model/Attribute.php Co-authored-by: kodumbeats --- src/Appwrite/Utopia/Response/Model/Attribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/Attribute.php b/src/Appwrite/Utopia/Response/Model/Attribute.php index 0629c9dda9..145cfa057b 100644 --- a/src/Appwrite/Utopia/Response/Model/Attribute.php +++ b/src/Appwrite/Utopia/Response/Model/Attribute.php @@ -26,7 +26,7 @@ class Attribute extends Model 'type' => self::TYPE_STRING, 'description' => 'Attribute status. Possible values: `available`, `processing`, `deleting`, or `failed`', 'default' => '', - 'example' => 'string', + 'example' => 'available', ]) ->addRule('size', [ 'type' => self::TYPE_STRING, From 9aefe4e360129881268d6aa20101f513c3159620 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:39:42 +0300 Subject: [PATCH 08/14] Update app/workers/database.php Co-authored-by: kodumbeats --- app/workers/database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/workers/database.php b/app/workers/database.php index 2b8fb26dcd..c066215a26 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -107,7 +107,6 @@ class DatabaseV1 extends Worker { $dbForInternal = $this->getInternalDB($projectId); $dbForExternal = $this->getExternalDB($projectId); - $collectionId = $collection->getId(); $key = $attribute->getAttribute('key', ''); From 130d567ecf1b143f44ba2a8d1981e11e1141f306 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:39:54 +0300 Subject: [PATCH 09/14] Update app/config/collections2.php Co-authored-by: kodumbeats --- app/config/collections2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index 91f5f35cbe..191d71fe2b 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -240,8 +240,8 @@ $collections = [ 'indexes' => [ '$collection' => Database::METADATA, - '$id' => 'attributes', - 'name' => 'Attributes', + '$id' => 'indexes', + 'name' => 'Indexes', 'attributes' => [ [ '$id' => 'collectionId', From 0b30691879048794719415d837f8c134bf92ed6e Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:40:14 +0300 Subject: [PATCH 10/14] Update app/workers/database.php Co-authored-by: kodumbeats --- app/workers/database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/workers/database.php b/app/workers/database.php index c066215a26..a004d365d7 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -21,7 +21,6 @@ class DatabaseV1 extends Worker public function run(): void { Authorization::disable(); - $projectId = $this->args['projectId'] ?? ''; $type = $this->args['type'] ?? ''; $collection = $this->args['collection'] ?? []; From 8219fcbcb48cb9a96f36d8e2ca0ff3b00d873432 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:40:40 +0300 Subject: [PATCH 11/14] Update app/config/collections2.php Co-authored-by: kodumbeats --- app/config/collections2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index 191d71fe2b..57b48da077 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -280,7 +280,7 @@ $collections = [ '$id' => 'status', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 256, + 'size' => 16, 'signed' => true, 'required' => false, 'default' => null, From f9d5d310e376522cbcb79677c2a64152e011b2ac Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:40:50 +0300 Subject: [PATCH 12/14] Update app/config/collections2.php Co-authored-by: kodumbeats --- app/config/collections2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/collections2.php b/app/config/collections2.php index 57b48da077..8079bdd7c8 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -269,7 +269,7 @@ $collections = [ '$id' => 'type', 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 256, + 'size' => 16, 'signed' => true, 'required' => false, 'default' => null, From 8f2e5c3563ae823b32982b8c599a45c301bc4ffe Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:40:56 +0300 Subject: [PATCH 13/14] Update app/workers/database.php Co-authored-by: kodumbeats --- app/workers/database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/workers/database.php b/app/workers/database.php index a004d365d7..fd38246150 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -144,7 +144,6 @@ class DatabaseV1 extends Worker if(!$dbForExternal->createIndex($collectionId, $key, $type, $attributes, $lengths, $orders)) { throw new Exception('Failed to create Index'); } - $dbForInternal->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'available')); } catch (\Throwable $th) { Console::error($th->getMessage()); From 27747088d0596466ea109bb8a2db62f8e6068b38 Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Mon, 23 Aug 2021 23:41:38 +0300 Subject: [PATCH 14/14] Update src/Appwrite/Utopia/Response/Model/Index.php Co-authored-by: kodumbeats --- src/Appwrite/Utopia/Response/Model/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Utopia/Response/Model/Index.php b/src/Appwrite/Utopia/Response/Model/Index.php index ed291f064e..4314971e39 100644 --- a/src/Appwrite/Utopia/Response/Model/Index.php +++ b/src/Appwrite/Utopia/Response/Model/Index.php @@ -26,7 +26,7 @@ class Index extends Model 'type' => self::TYPE_STRING, 'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, or `failed`', 'default' => '', - 'example' => 'string', + 'example' => 'available', ]) ->addRule('attributes', [ 'type' => self::TYPE_STRING,