From f96128e14fb7efbe554b074c28545997c2b54e83 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 14 Dec 2022 17:42:25 +0200 Subject: [PATCH 01/20] Changing Id --- app/config/collections.php | 2 +- app/controllers/api/account.php | 2 +- app/controllers/api/databases.php | 2 +- app/controllers/api/functions.php | 2 +- app/controllers/api/projects.php | 2 +- app/controllers/api/storage.php | 2 +- app/controllers/api/teams.php | 2 +- app/controllers/api/users.php | 2 +- app/controllers/mock.php | 2 +- app/http.php | 2 +- app/init.php | 2 +- app/realtime.php | 2 +- app/workers/builds.php | 2 +- app/workers/certificates.php | 2 +- app/workers/functions.php | 2 +- composer.json | 2 +- composer.lock | 471 +++++++++++++++--- src/Appwrite/Messaging/Adapter/Realtime.php | 2 +- src/Appwrite/Migration/Migration.php | 2 +- src/Appwrite/Migration/Version/V15.php | 2 +- tests/e2e/General/AbuseTest.php | 2 +- tests/e2e/Scopes/ProjectConsole.php | 2 +- tests/e2e/Scopes/ProjectCustom.php | 2 +- tests/e2e/Scopes/Scope.php | 2 +- tests/e2e/Services/Account/AccountBase.php | 2 +- .../Account/AccountCustomClientTest.php | 2 +- .../Account/AccountCustomServerTest.php | 2 +- .../e2e/Services/Databases/DatabasesBase.php | 2 +- .../Databases/DatabasesConsoleClientTest.php | 2 +- .../Databases/DatabasesCustomClientTest.php | 2 +- .../Databases/DatabasesCustomServerTest.php | 2 +- .../DatabasesPermissionsGuestTest.php | 2 +- .../DatabasesPermissionsMemberTest.php | 2 +- .../DatabasesPermissionsTeamTest.php | 2 +- .../Functions/FunctionsConsoleClientTest.php | 2 +- .../Functions/FunctionsCustomClientTest.php | 2 +- .../Functions/FunctionsCustomServerTest.php | 2 +- .../Projects/ProjectsConsoleClientTest.php | 2 +- .../Realtime/RealtimeConsoleClientTest.php | 2 +- .../Realtime/RealtimeCustomClientTest.php | 2 +- tests/e2e/Services/Storage/StorageBase.php | 2 +- .../Storage/StorageConsoleClientTest.php | 2 +- .../Storage/StorageCustomClientTest.php | 2 +- .../Storage/StorageCustomServerTest.php | 2 +- tests/e2e/Services/Teams/TeamsBase.php | 2 +- tests/e2e/Services/Teams/TeamsBaseClient.php | 2 +- .../Services/Teams/TeamsConsoleClientTest.php | 2 +- tests/e2e/Services/Users/UsersBase.php | 2 +- tests/e2e/Services/Webhooks/WebhooksBase.php | 2 +- .../Webhooks/WebhooksCustomClientTest.php | 2 +- .../Webhooks/WebhooksCustomServerTest.php | 2 +- tests/unit/Auth/AuthTest.php | 2 +- .../unit/Messaging/MessagingChannelsTest.php | 2 +- tests/unit/Messaging/MessagingGuestTest.php | 2 +- tests/unit/Messaging/MessagingTest.php | 2 +- tests/unit/Network/Validators/OriginTest.php | 2 +- 56 files changed, 466 insertions(+), 115 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index bdc14d9105..9a1905a4b3 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3,7 +3,7 @@ use Appwrite\Auth\Auth; use Utopia\Config\Config; use Utopia\Database\Database; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; $providers = Config::getParam('providers', []); $auth = Config::getParam('auth', []); diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 45fb03062f..179e25b562 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -29,7 +29,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\DateTime; use Utopia\Database\Exception\Duplicate; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Query; use Utopia\Database\Role; diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 725c163c73..c1f2b582a4 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -7,7 +7,7 @@ use Utopia\Audit\Audit; use Utopia\Database\Permission; use Utopia\Database\Role; use Utopia\Database\Validator\DatetimeValidator; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Validator\Boolean; use Utopia\Validator\FloatValidator; use Utopia\Validator\Integer; diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index bfc1ccba42..45cc91f423 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -9,7 +9,7 @@ use Appwrite\Event\Func; use Appwrite\Event\Validator\Event as ValidatorEvent; use Appwrite\Extend\Exception; use Appwrite\Utopia\Database\Validator\CustomId; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; use Utopia\Database\Validator\UID; diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 1fc60c3725..44705fcc7f 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -17,7 +17,7 @@ use Utopia\Audit\Audit; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; use Utopia\Database\Permission; use Utopia\Database\Query; diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 3c8ffc5644..94efd4e5be 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -16,7 +16,7 @@ use Utopia\Database\Exception\Duplicate; use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate as DuplicateException; use Utopia\Database\Exception\Structure as StructureException; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Query; use Utopia\Database\Role; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 567560c6a8..7d5e8bc6e5 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -26,7 +26,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Query; use Utopia\Database\DateTime; diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index dce493b024..0d4d8a311d 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -16,7 +16,7 @@ use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Config\Config; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; use Utopia\Locale\Locale; diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 034f18165b..82586a96b6 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -14,7 +14,7 @@ use Utopia\Validator\Integer; use Utopia\Validator\Text; use Utopia\Storage\Validator\File; use Utopia\Validator\WhiteList; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; App::get('/v1/mock/tests/foo') ->desc('Get Foo') diff --git a/app/http.php b/app/http.php index db9929ace7..019392a65f 100644 --- a/app/http.php +++ b/app/http.php @@ -10,7 +10,7 @@ use Swoole\Http\Response as SwooleResponse; use Utopia\App; use Utopia\CLI\Console; use Utopia\Config\Config; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; use Utopia\Database\Validator\Authorization; diff --git a/app/init.php b/app/init.php index ef9246e362..4f9d9375a8 100644 --- a/app/init.php +++ b/app/init.php @@ -37,7 +37,7 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\Usage\Stats; use Appwrite\Utopia\View; use Utopia\App; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Logger\Logger; use Utopia\Config\Config; use Utopia\Locale\Locale; diff --git a/app/realtime.php b/app/realtime.php index ac4e2d669a..0f58ac9068 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -13,7 +13,7 @@ use Utopia\Abuse\Abuse; use Utopia\Abuse\Adapters\TimeLimit; use Utopia\App; use Utopia\CLI\Console; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; use Utopia\Logger\Log; use Utopia\Database\Database; diff --git a/app/workers/builds.php b/app/workers/builds.php index 5f33ed4010..3e74074ab0 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -11,7 +11,7 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\App; use Utopia\CLI\Console; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Storage\Storage; use Utopia\Database\Document; use Utopia\Config\Config; diff --git a/app/workers/certificates.php b/app/workers/certificates.php index e7885bc669..39fac33c58 100644 --- a/app/workers/certificates.php +++ b/app/workers/certificates.php @@ -9,7 +9,7 @@ use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Query; use Utopia\Domains\Domain; diff --git a/app/workers/functions.php b/app/workers/functions.php index efd6ebb41f..db2038e0da 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -14,7 +14,7 @@ use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Query; use Utopia\Database\Role; diff --git a/composer.json b/composer.json index 8e22745c76..129075299b 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.28.*", + "utopia-php/database": "dev-feat-technical-debt as 0.28.0", "utopia-php/preloader": "0.2.*", "utopia-php/domains": "1.1.*", "utopia-php/framework": "0.25.*", diff --git a/composer.lock b/composer.lock index e97546287f..283eed1c21 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": "a2a79fc2e9ebdd4d05afa6632c642686", + "content-hash": "2e56cb6c348ecdf295ddc3f45731dcdd", "packages": [ { "name": "adhocore/jwt", @@ -345,6 +345,79 @@ }, "time": "2022-11-09T01:18:39+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.5", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-17T14:14:24+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.1", @@ -804,17 +877,72 @@ "time": "2020-12-26T17:45:17+00:00" }, { - "name": "laravel/pint", - "version": "v1.2.0", + "name": "jean85/pretty-package-versions", + "version": "1.6.0", "source": { "type": "git", - "url": "https://github.com/laravel/pint.git", - "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86" + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "1e0104b46f045868f11942aea058cd7186d6c303" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/1d276e4c803397a26cc337df908f55c2a4e90d86", - "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", + "reference": "1e0104b46f045868f11942aea058cd7186d6c303", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8.0", + "php": "^7.0|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^8.5|^9.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" + }, + "time": "2021-02-04T16:20:16+00:00" + }, + { + "name": "laravel/pint", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "e60e2112ee779ce60f253695b273d1646a17d6f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/e60e2112ee779ce60f253695b273d1646a17d6f1", + "reference": "e60e2112ee779ce60f253695b273d1646a17d6f1", "shasum": "" }, "require": { @@ -826,10 +954,10 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.11.0", - "illuminate/view": "^9.27", - "laravel-zero/framework": "^9.1.3", - "mockery/mockery": "^1.5.0", - "nunomaduro/larastan": "^2.2", + "illuminate/view": "^9.32.0", + "laravel-zero/framework": "^9.2.0", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.2.0", "nunomaduro/termwind": "^1.14.0", "pestphp/pest": "^1.22.1" }, @@ -867,7 +995,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2022-09-13T15:07:15+00:00" + "time": "2022-11-29T16:25:20+00:00" }, { "name": "matomo/device-detector", @@ -938,6 +1066,74 @@ }, "time": "2022-04-11T09:58:17+00:00" }, + { + "name": "mongodb/mongodb", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/mongodb/mongo-php-library.git", + "reference": "953dbc19443aa9314c44b7217a16873347e6840d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", + "reference": "953dbc19443aa9314c44b7217a16873347e6840d", + "shasum": "" + }, + "require": { + "ext-hash": "*", + "ext-json": "*", + "ext-mongodb": "^1.8.1", + "jean85/pretty-package-versions": "^1.2", + "php": "^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.19" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.5, <3.5.5", + "symfony/phpunit-bridge": "5.x-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "MongoDB\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Andreas Braun", + "email": "andreas.braun@mongodb.com" + }, + { + "name": "Jeremy Mikola", + "email": "jmikola@gmail.com" + } + ], + "description": "MongoDB driver library", + "homepage": "https://jira.mongodb.org/browse/PHPLIB", + "keywords": [ + "database", + "driver", + "mongodb", + "persistence" + ], + "support": { + "issues": "https://github.com/mongodb/mongo-php-library/issues", + "source": "https://github.com/mongodb/mongo-php-library/tree/1.8.0" + }, + "time": "2020-11-25T12:26:02+00:00" + }, { "name": "mustangostang/spyc", "version": "0.6.3", @@ -1461,16 +1657,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -1479,7 +1675,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -1508,7 +1704,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -1524,7 +1720,90 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" }, { "name": "utopia-php/abuse", @@ -1837,22 +2116,23 @@ }, { "name": "utopia-php/database", - "version": "0.28.0", + "version": "dev-feat-technical-debt", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94" + "reference": "703f5daa6341e3c7bf97e3ccd5ebae75198c5caf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/ef6506af1c09c22f5dc1e7859159d323f7fafa94", - "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94", + "url": "https://api.github.com/repos/utopia-php/database/zipball/703f5daa6341e3c7bf97e3ccd5ebae75198c5caf", + "reference": "703f5daa6341e3c7bf97e3ccd5ebae75198c5caf", "shasum": "" }, "require": { "php": ">=8.0", "utopia-php/cache": "0.8.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.*.*", + "utopia-php/mongo": "0.0.2" }, "require-dev": { "ext-mongodb": "*", @@ -1885,9 +2165,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.28.0" + "source": "https://github.com/utopia-php/database/tree/feat-technical-debt" }, - "time": "2022-10-31T09:58:46+00:00" + "time": "2022-12-13T15:36:09+00:00" }, { "name": "utopia-php/domains", @@ -1945,24 +2225,25 @@ }, { "name": "utopia-php/framework", - "version": "0.25.0", + "version": "0.25.1", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "c524f681254255c8204fbf7919c53bf3b4982636" + "reference": "2391b397135586b2100d39e338827bef8d2f4ad0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/c524f681254255c8204fbf7919c53bf3b4982636", - "reference": "c524f681254255c8204fbf7919c53bf3b4982636", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/2391b397135586b2100d39e338827bef8d2f4ad0", + "reference": "2391b397135586b2100d39e338827bef8d2f4ad0", "shasum": "" }, "require": { "php": ">=8.0.0" }, "require-dev": { + "laravel/pint": "^1.2", "phpunit/phpunit": "^9.5.25", - "vimeo/psalm": "^4.27.0" + "vimeo/psalm": "4.27.0" }, "type": "library", "autoload": { @@ -1982,9 +2263,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.25.0" + "source": "https://github.com/utopia-php/framework/tree/0.25.1" }, - "time": "2022-11-02T09:49:57+00:00" + "time": "2022-11-23T18:22:23+00:00" }, { "name": "utopia-php/image", @@ -2209,6 +2490,66 @@ }, "time": "2022-09-29T11:22:48+00:00" }, + { + "name": "utopia-php/mongo", + "version": "0.0.2", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/mongo.git", + "reference": "62f9a9c0201af91b6d0dd4f0aa8a335ec9b56a1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/mongo/zipball/62f9a9c0201af91b6d0dd4f0aa8a335ec9b56a1e", + "reference": "62f9a9c0201af91b6d0dd4f0aa8a335ec9b56a1e", + "shasum": "" + }, + "require": { + "ext-mongodb": "*", + "mongodb/mongodb": "1.8.0", + "php": ">=8.0" + }, + "require-dev": { + "fakerphp/faker": "^1.14", + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.8.*", + "phpunit/phpunit": "^9.4", + "swoole/ide-helper": "4.8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Mongo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + }, + { + "name": "Wess", + "email": "wess@appwrite.io" + } + ], + "description": "A simple library to manage Mongo database", + "keywords": [ + "database", + "mongo", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/mongo/issues", + "source": "https://github.com/utopia-php/mongo/tree/0.0.2" + }, + "time": "2022-11-08T11:58:46+00:00" + }, { "name": "utopia-php/orchestration", "version": "0.6.0", @@ -2777,16 +3118,16 @@ }, { "name": "matthiasmullie/minify", - "version": "1.3.69", + "version": "1.3.70", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "a61c949cccd086808063611ef9698eabe42ef22f" + "reference": "2807d9f9bece6877577ad44acb5c801bb3ae536b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/a61c949cccd086808063611ef9698eabe42ef22f", - "reference": "a61c949cccd086808063611ef9698eabe42ef22f", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/2807d9f9bece6877577ad44acb5c801bb3ae536b", + "reference": "2807d9f9bece6877577ad44acb5c801bb3ae536b", "shasum": "" }, "require": { @@ -2795,9 +3136,10 @@ "php": ">=5.3.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.0", - "matthiasmullie/scrapbook": "dev-master", - "phpunit/phpunit": ">=4.8" + "friendsofphp/php-cs-fixer": ">=2.0", + "matthiasmullie/scrapbook": ">=1.3", + "phpunit/phpunit": ">=4.8", + "squizlabs/php_codesniffer": ">=3.0" }, "suggest": { "psr/cache-implementation": "Cache implementation to use with Minify::cache" @@ -2820,12 +3162,12 @@ { "name": "Matthias Mullie", "email": "minify@mullie.eu", - "homepage": "http://www.mullie.eu", + "homepage": "https://www.mullie.eu", "role": "Developer" } ], "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.", - "homepage": "http://www.minifier.org", + "homepage": "https://github.com/matthiasmullie/minify", "keywords": [ "JS", "css", @@ -2835,7 +3177,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.69" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.70" }, "funding": [ { @@ -2843,7 +3185,7 @@ "type": "github" } ], - "time": "2022-08-01T09:00:18+00:00" + "time": "2022-12-09T12:56:44+00:00" }, { "name": "matthiasmullie/path-converter", @@ -3291,21 +3633,21 @@ }, { "name": "phpspec/prophecy", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", + "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" @@ -3352,22 +3694,22 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-11-29T15:06:56+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.19", + "version": "9.2.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", "shasum": "" }, "require": { @@ -3423,7 +3765,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" }, "funding": [ { @@ -3431,7 +3773,7 @@ "type": "github" } ], - "time": "2022-11-18T07:47:47+00:00" + "time": "2022-12-14T13:26:54+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5180,9 +5522,18 @@ "time": "2022-09-28T08:42:51+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-feat-technical-debt", + "alias": "0.28.0", + "alias_normalized": "0.28.0.0" + } + ], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -5206,5 +5557,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index dddbc59e7f..8d6bfa9837 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -6,7 +6,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Appwrite\Messaging\Adapter; use Utopia\App; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; class Realtime extends Adapter diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index bef6e5e603..8c97b5ac61 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -10,7 +10,7 @@ use Utopia\CLI\Console; use Utopia\Config\Config; use Exception; use Utopia\App; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\Authorization; Runtime::enableCoroutine(SWOOLE_HOOK_ALL); diff --git a/src/Appwrite/Migration/Version/V15.php b/src/Appwrite/Migration/Version/V15.php index f549c7fbdf..7775f7ad5b 100644 --- a/src/Appwrite/Migration/Version/V15.php +++ b/src/Appwrite/Migration/Version/V15.php @@ -11,7 +11,7 @@ use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/General/AbuseTest.php b/tests/e2e/General/AbuseTest.php index 90a4b33800..0d5d36bfd9 100644 --- a/tests/e2e/General/AbuseTest.php +++ b/tests/e2e/General/AbuseTest.php @@ -8,7 +8,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideNone; use Utopia\App; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Scopes/ProjectConsole.php b/tests/e2e/Scopes/ProjectConsole.php index bc8ce4c0cf..dcc4aa7c33 100644 --- a/tests/e2e/Scopes/ProjectConsole.php +++ b/tests/e2e/Scopes/ProjectConsole.php @@ -2,7 +2,7 @@ namespace Tests\E2E\Scopes; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; trait ProjectConsole { diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index f2e4e84685..4d780d04c6 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -3,7 +3,7 @@ namespace Tests\E2E\Scopes; use Tests\E2E\Client; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; trait ProjectCustom { diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 2a9f205272..939de516b6 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -5,7 +5,7 @@ namespace Tests\E2E\Scopes; use Appwrite\Tests\Retryable; use Tests\E2E\Client; use PHPUnit\Framework\TestCase; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; abstract class Scope extends TestCase { diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index e8bf146316..880323e728 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Services\Account; use Appwrite\Tests\Retry; use Tests\E2E\Client; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; trait AccountBase diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 65567b22e5..4a480597c1 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -8,7 +8,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use function sleep; diff --git a/tests/e2e/Services/Account/AccountCustomServerTest.php b/tests/e2e/Services/Account/AccountCustomServerTest.php index 85d140c829..143277608d 100644 --- a/tests/e2e/Services/Account/AccountCustomServerTest.php +++ b/tests/e2e/Services/Account/AccountCustomServerTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class AccountCustomServerTest extends Scope { diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index a183325039..782965a18c 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Services\Databases; use Tests\E2E\Client; use Utopia\Database\Database; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php index 71fa7a590f..10f22179cc 100644 --- a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Client; use Tests\E2E\Scopes\SideConsole; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 9f86bb66c0..8133ef0b3e 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index bd4e8aa77b..794deae06c 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -7,7 +7,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Tests\E2E\Client; use Utopia\Database\Database; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php index 1c15a363a8..c15269c088 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; use Utopia\Database\Validator\Authorization; diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php b/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php index 59091956b0..8f16b41839 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php b/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php index 07275c7524..bdaaeccf52 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php index 68b9ac46ea..aa062321e8 100644 --- a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Client; use Tests\E2E\Scopes\SideConsole; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; class FunctionsConsoleClientTest extends Scope diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 56b72e4468..0d5ddfae9b 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -9,7 +9,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; use Utopia\CLI\Console; use Utopia\Database\Database; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; class FunctionsCustomClientTest extends Scope diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 29ceb1254f..a17f3ebe63 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -11,7 +11,7 @@ use Tests\E2E\Scopes\SideServer; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class FunctionsCustomServerTest extends Scope { diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 413b665897..45d8b5c181 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -10,7 +10,7 @@ use Tests\E2E\Services\Projects\ProjectsBase; use Tests\E2E\Client; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class ProjectsConsoleClientTest extends Scope { diff --git a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php index 500b3d48be..aa42efd92f 100644 --- a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php @@ -8,7 +8,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideConsole; use Tests\E2E\Services\Functions\FunctionsBase; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 7f09cb5703..0745f6e91c 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -8,7 +8,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\CLI\Console; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; use WebSocket\ConnectionException; diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index b4c28b0fa2..a24923edde 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -5,7 +5,7 @@ namespace Tests\E2E\Services\Storage; use CURLFile; use Tests\E2E\Client; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Storage/StorageConsoleClientTest.php b/tests/e2e/Services/Storage/StorageConsoleClientTest.php index 8b4aaa1fca..8fda8e0464 100644 --- a/tests/e2e/Services/Storage/StorageConsoleClientTest.php +++ b/tests/e2e/Services/Storage/StorageConsoleClientTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideConsole; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class StorageConsoleClientTest extends Scope { diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index fdb158ae5b..c9cfa72633 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -13,7 +13,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; use Utopia\Database\Validator\Authorization; diff --git a/tests/e2e/Services/Storage/StorageCustomServerTest.php b/tests/e2e/Services/Storage/StorageCustomServerTest.php index ac03f2b83c..2395e1d8fc 100644 --- a/tests/e2e/Services/Storage/StorageCustomServerTest.php +++ b/tests/e2e/Services/Storage/StorageCustomServerTest.php @@ -7,7 +7,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class StorageCustomServerTest extends Scope { diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index 854a041503..3bad31e35c 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -5,7 +5,7 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; use Utopia\Database\Database; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; trait TeamsBase { diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 788626b102..0eb578e325 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; trait TeamsBaseClient { diff --git a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php index 0f32425c92..e86c18a8e2 100644 --- a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php +++ b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectConsole; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class TeamsConsoleClientTest extends Scope { diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index ac3b116b32..75cce56537 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Services\Users; use Appwrite\Tests\Retry; use Tests\E2E\Client; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; trait UsersBase { diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index bb7edfdb46..63a5e6379c 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -6,7 +6,7 @@ use Appwrite\Tests\Retry; use CURLFile; use Tests\E2E\Client; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index 9e26322931..1a49b4b3f0 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -8,7 +8,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class WebhooksCustomClientTest extends Scope { diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index f2f4b27260..fb0e381cdd 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -9,7 +9,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Utopia\CLI\Console; use Utopia\Database\DateTime; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/unit/Auth/AuthTest.php b/tests/unit/Auth/AuthTest.php index a4ed5740cb..2b4d685a7c 100644 --- a/tests/unit/Auth/AuthTest.php +++ b/tests/unit/Auth/AuthTest.php @@ -5,7 +5,7 @@ namespace Tests\Unit\Auth; use Appwrite\Auth\Auth; use Utopia\Database\DateTime; use Utopia\Database\Document; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; use Utopia\Database\Validator\Authorization; use PHPUnit\Framework\TestCase; diff --git a/tests/unit/Messaging/MessagingChannelsTest.php b/tests/unit/Messaging/MessagingChannelsTest.php index 392f6d56fe..a5e5a0811f 100644 --- a/tests/unit/Messaging/MessagingChannelsTest.php +++ b/tests/unit/Messaging/MessagingChannelsTest.php @@ -6,7 +6,7 @@ use Appwrite\Auth\Auth; use Utopia\Database\Document; use Appwrite\Messaging\Adapter\Realtime; use PHPUnit\Framework\TestCase; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; class MessagingChannelsTest extends TestCase diff --git a/tests/unit/Messaging/MessagingGuestTest.php b/tests/unit/Messaging/MessagingGuestTest.php index d8ed58ad40..fa06e456dd 100644 --- a/tests/unit/Messaging/MessagingGuestTest.php +++ b/tests/unit/Messaging/MessagingGuestTest.php @@ -4,7 +4,7 @@ namespace Tests\Unit\Messaging; use Appwrite\Messaging\Adapter\Realtime; use PHPUnit\Framework\TestCase; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Role; class MessagingGuestTest extends TestCase diff --git a/tests/unit/Messaging/MessagingTest.php b/tests/unit/Messaging/MessagingTest.php index 0b7baf2631..e0ed7ac353 100644 --- a/tests/unit/Messaging/MessagingTest.php +++ b/tests/unit/Messaging/MessagingTest.php @@ -5,7 +5,7 @@ namespace Tests\Unit\Messaging; use Utopia\Database\Document; use Appwrite\Messaging\Adapter\Realtime; use PHPUnit\Framework\TestCase; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Permission; use Utopia\Database\Role; diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index 2392ae4cfa..30d18ecaa9 100644 --- a/tests/unit/Network/Validators/OriginTest.php +++ b/tests/unit/Network/Validators/OriginTest.php @@ -4,7 +4,7 @@ namespace Tests\Unit\Network\Validators; use Appwrite\Network\Validator\Origin; use PHPUnit\Framework\TestCase; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class OriginTest extends TestCase { From 8ade72693296e76e1a16065677472872620b5983 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 14 Dec 2022 18:04:06 +0200 Subject: [PATCH 02/20] Changing Role + Permissions namespace --- app/controllers/api/account.php | 4 ++-- app/controllers/api/databases.php | 4 ++-- app/controllers/api/functions.php | 4 ++-- app/controllers/api/projects.php | 4 ++-- app/controllers/api/storage.php | 4 ++-- app/controllers/api/teams.php | 4 ++-- app/controllers/api/users.php | 4 ++-- app/controllers/general.php | 2 +- app/http.php | 4 ++-- app/realtime.php | 2 +- app/workers/functions.php | 4 ++-- src/Appwrite/Auth/Auth.php | 2 +- src/Appwrite/Messaging/Adapter/Realtime.php | 2 +- src/Appwrite/Migration/Version/V15.php | 4 ++-- src/Appwrite/Specification/Format/OpenAPI3.php | 4 ++-- src/Appwrite/Specification/Format/Swagger2.php | 4 ++-- src/Appwrite/Utopia/Request/Filters/V15.php | 4 ++-- src/Appwrite/Utopia/Response/Filters/V15.php | 4 ++-- src/Appwrite/Utopia/Response/Model/Execution.php | 2 +- tests/e2e/General/AbuseTest.php | 4 ++-- tests/e2e/General/UsageTest.php | 4 ++-- tests/e2e/Services/Databases/DatabasesBase.php | 4 ++-- tests/e2e/Services/Databases/DatabasesConsoleClientTest.php | 4 ++-- tests/e2e/Services/Databases/DatabasesCustomClientTest.php | 4 ++-- tests/e2e/Services/Databases/DatabasesCustomServerTest.php | 4 ++-- .../e2e/Services/Databases/DatabasesPermissionsGuestTest.php | 4 ++-- .../e2e/Services/Databases/DatabasesPermissionsMemberTest.php | 4 ++-- tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php | 4 ++-- tests/e2e/Services/Functions/FunctionsConsoleClientTest.php | 2 +- tests/e2e/Services/Functions/FunctionsCustomClientTest.php | 2 +- tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php | 4 ++-- tests/e2e/Services/Realtime/RealtimeCustomClientTest.php | 4 ++-- tests/e2e/Services/Storage/StorageBase.php | 4 ++-- tests/e2e/Services/Storage/StorageCustomClientTest.php | 4 ++-- tests/e2e/Services/Webhooks/WebhooksBase.php | 4 ++-- tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php | 4 ++-- tests/unit/Auth/AuthTest.php | 2 +- tests/unit/Messaging/MessagingChannelsTest.php | 2 +- tests/unit/Messaging/MessagingGuestTest.php | 2 +- tests/unit/Messaging/MessagingTest.php | 4 ++-- tests/unit/Utopia/Response/Filters/V15Test.php | 4 ++-- 41 files changed, 72 insertions(+), 72 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 179e25b562..44efa65346 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -30,9 +30,9 @@ use Utopia\Database\Document; use Utopia\Database\DateTime; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\Permission; use Utopia\Database\Query; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Locale\Locale; diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index c1f2b582a4..85f1826e57 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -4,8 +4,8 @@ use Utopia\App; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; use Utopia\Audit\Audit; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\DatetimeValidator; use Utopia\Database\Helpers\ID; use Utopia\Validator\Boolean; diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 45cc91f423..db01cc7b95 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -10,8 +10,8 @@ use Appwrite\Event\Validator\Event as ValidatorEvent; use Appwrite\Extend\Exception; use Appwrite\Utopia\Database\Validator\CustomId; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\UID; use Appwrite\Usage\Stats; use Utopia\Storage\Device; diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 44705fcc7f..3bfc90d40c 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -19,9 +19,9 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\Permission; use Utopia\Database\Query; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\DatetimeValidator; use Utopia\Database\Validator\UID; diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 94efd4e5be..2372cb2719 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -17,9 +17,9 @@ use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate as DuplicateException; use Utopia\Database\Exception\Structure as StructureException; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\Permission; use Utopia\Database\Query; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 7d5e8bc6e5..e648ab406a 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -27,10 +27,10 @@ use Utopia\Database\Document; use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\Permission; use Utopia\Database\Query; use Utopia\Database\DateTime; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\UID; diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 0d4d8a311d..f35f224313 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -17,8 +17,8 @@ use Utopia\App; use Utopia\Audit\Audit; use Utopia\Config\Config; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Locale\Locale; use Appwrite\Extend\Exception; use Utopia\Database\Document; diff --git a/app/controllers/general.php b/app/controllers/general.php index 0c10dd46e9..71e7f5c5c4 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -3,7 +3,7 @@ require_once __DIR__ . '/../init.php'; use Utopia\App; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Locale\Locale; use Utopia\Logger\Logger; use Utopia\Logger\Log; diff --git a/app/http.php b/app/http.php index 019392a65f..829b63b68e 100644 --- a/app/http.php +++ b/app/http.php @@ -11,8 +11,8 @@ use Utopia\App; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Audit\Audit; use Utopia\Abuse\Adapters\TimeLimit; diff --git a/app/realtime.php b/app/realtime.php index 0f58ac9068..8de916fcc4 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -14,7 +14,7 @@ use Utopia\Abuse\Adapters\TimeLimit; use Utopia\App; use Utopia\CLI\Console; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Logger\Log; use Utopia\Database\Database; use Utopia\Database\DateTime; diff --git a/app/workers/functions.php b/app/workers/functions.php index db2038e0da..d7cb8c7ff3 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -15,9 +15,9 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\Permission; use Utopia\Database\Query; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; require_once __DIR__ . '/../init.php'; diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index b397e9ea77..b737b5273a 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -12,7 +12,7 @@ use Appwrite\Auth\Hash\Sha; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\DateTime; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Roles; diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index 8d6bfa9837..435972d0f5 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -7,7 +7,7 @@ use Utopia\Database\Document; use Appwrite\Messaging\Adapter; use Utopia\App; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class Realtime extends Adapter { diff --git a/src/Appwrite/Migration/Version/V15.php b/src/Appwrite/Migration/Version/V15.php index 7775f7ad5b..ac948d01d2 100644 --- a/src/Appwrite/Migration/Version/V15.php +++ b/src/Appwrite/Migration/Version/V15.php @@ -12,8 +12,8 @@ use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class V15 extends Migration { diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index fb7208c569..1ad5dfd895 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -5,8 +5,8 @@ namespace Appwrite\Specification\Format; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Validator; class OpenAPI3 extends Format diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 6eb27a11aa..7d056bea60 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -5,8 +5,8 @@ namespace Appwrite\Specification\Format; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Validator; class Swagger2 extends Format diff --git a/src/Appwrite/Utopia/Request/Filters/V15.php b/src/Appwrite/Utopia/Request/Filters/V15.php index 65b09e1f24..50e5ec0db7 100644 --- a/src/Appwrite/Utopia/Request/Filters/V15.php +++ b/src/Appwrite/Utopia/Request/Filters/V15.php @@ -4,9 +4,9 @@ namespace Appwrite\Utopia\Request\Filters; use Appwrite\Utopia\Request\Filter; use Utopia\Database\Database; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\Permission; use Utopia\Database\Query; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class V15 extends Filter { diff --git a/src/Appwrite/Utopia/Response/Filters/V15.php b/src/Appwrite/Utopia/Response/Filters/V15.php index a74f0f32ad..232feec201 100644 --- a/src/Appwrite/Utopia/Response/Filters/V15.php +++ b/src/Appwrite/Utopia/Response/Filters/V15.php @@ -5,8 +5,8 @@ namespace Appwrite\Utopia\Response\Filters; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Filter; use Utopia\Database\Database; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class V15 extends Filter { diff --git a/src/Appwrite/Utopia/Response/Model/Execution.php b/src/Appwrite/Utopia/Response/Model/Execution.php index 13011a24b7..8672a91598 100644 --- a/src/Appwrite/Utopia/Response/Model/Execution.php +++ b/src/Appwrite/Utopia/Response/Model/Execution.php @@ -4,7 +4,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class Execution extends Model { diff --git a/tests/e2e/General/AbuseTest.php b/tests/e2e/General/AbuseTest.php index 0d5d36bfd9..f5a2829974 100644 --- a/tests/e2e/General/AbuseTest.php +++ b/tests/e2e/General/AbuseTest.php @@ -9,8 +9,8 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideNone; use Utopia\App; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class AbuseTest extends Scope { diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index cbe90c91fb..7ef5606650 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -10,8 +10,8 @@ use Tests\E2E\Scopes\SideServer; use CURLFile; use Tests\E2E\Services\Functions\FunctionsBase; use Utopia\Database\DateTime; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class UsageTest extends Scope { diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 782965a18c..083577ef94 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -6,8 +6,8 @@ use Tests\E2E\Client; use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; trait DatabasesBase { diff --git a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php index 10f22179cc..ad97a2bb3e 100644 --- a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Client; use Tests\E2E\Scopes\SideConsole; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabasesConsoleClientTest extends Scope { diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index 8133ef0b3e..748070161d 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabasesCustomClientTest extends Scope { diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index 794deae06c..3fe28bbd29 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -8,8 +8,8 @@ use Tests\E2E\Scopes\SideServer; use Tests\E2E\Client; use Utopia\Database\Database; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabasesCustomServerTest extends Scope { diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php index c15269c088..b1d197f010 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsGuestTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; class DatabasesPermissionsGuestTest extends Scope diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php b/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php index 8f16b41839..860fb7fb12 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsMemberTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabasesPermissionsMemberTest extends Scope { diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php b/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php index bdaaeccf52..8377b9c803 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsTeamTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabasesPermissionsTeamTest extends Scope { diff --git a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php index aa062321e8..cd01b257a1 100644 --- a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php @@ -7,7 +7,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Client; use Tests\E2E\Scopes\SideConsole; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class FunctionsConsoleClientTest extends Scope { diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 0d5ddfae9b..57d237b9af 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -10,7 +10,7 @@ use Tests\E2E\Scopes\SideClient; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class FunctionsCustomClientTest extends Scope { diff --git a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php index aa42efd92f..cd2fb6f13b 100644 --- a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php @@ -9,8 +9,8 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideConsole; use Tests\E2E\Services\Functions\FunctionsBase; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class RealtimeConsoleClientTest extends Scope { diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 0745f6e91c..34ddea8721 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -9,8 +9,8 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\CLI\Console; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use WebSocket\ConnectionException; class RealtimeCustomClientTest extends Scope diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index a24923edde..359989e114 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -6,8 +6,8 @@ use CURLFile; use Tests\E2E\Client; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; trait StorageBase { diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index c9cfa72633..4a697d584a 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -14,8 +14,8 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; class StorageCustomClientTest extends Scope diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index 63a5e6379c..d3d700a222 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -7,8 +7,8 @@ use CURLFile; use Tests\E2E\Client; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; trait WebhooksBase { diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index fb0e381cdd..51f5ef2532 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -10,8 +10,8 @@ use Tests\E2E\Scopes\SideServer; use Utopia\CLI\Console; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class WebhooksCustomServerTest extends Scope { diff --git a/tests/unit/Auth/AuthTest.php b/tests/unit/Auth/AuthTest.php index 2b4d685a7c..e64ef37dfe 100644 --- a/tests/unit/Auth/AuthTest.php +++ b/tests/unit/Auth/AuthTest.php @@ -6,7 +6,7 @@ use Appwrite\Auth\Auth; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; use PHPUnit\Framework\TestCase; use Utopia\Database\Database; diff --git a/tests/unit/Messaging/MessagingChannelsTest.php b/tests/unit/Messaging/MessagingChannelsTest.php index a5e5a0811f..6fe7dda71f 100644 --- a/tests/unit/Messaging/MessagingChannelsTest.php +++ b/tests/unit/Messaging/MessagingChannelsTest.php @@ -7,7 +7,7 @@ use Utopia\Database\Document; use Appwrite\Messaging\Adapter\Realtime; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class MessagingChannelsTest extends TestCase { diff --git a/tests/unit/Messaging/MessagingGuestTest.php b/tests/unit/Messaging/MessagingGuestTest.php index fa06e456dd..1aaa1febca 100644 --- a/tests/unit/Messaging/MessagingGuestTest.php +++ b/tests/unit/Messaging/MessagingGuestTest.php @@ -5,7 +5,7 @@ namespace Tests\Unit\Messaging; use Appwrite\Messaging\Adapter\Realtime; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Role; class MessagingGuestTest extends TestCase { diff --git a/tests/unit/Messaging/MessagingTest.php b/tests/unit/Messaging/MessagingTest.php index e0ed7ac353..c2e3971945 100644 --- a/tests/unit/Messaging/MessagingTest.php +++ b/tests/unit/Messaging/MessagingTest.php @@ -6,8 +6,8 @@ use Utopia\Database\Document; use Appwrite\Messaging\Adapter\Realtime; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class MessagingTest extends TestCase { diff --git a/tests/unit/Utopia/Response/Filters/V15Test.php b/tests/unit/Utopia/Response/Filters/V15Test.php index ce7870483c..ab3a0b06ed 100644 --- a/tests/unit/Utopia/Response/Filters/V15Test.php +++ b/tests/unit/Utopia/Response/Filters/V15Test.php @@ -4,8 +4,8 @@ namespace Tests\Unit\Utopia\Response\Filters; use Appwrite\Utopia\Response\Filters\V15; use Appwrite\Utopia\Response; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; use PHPUnit\Framework\TestCase; use stdClass; From d7a833faef9be4b84c6ef78cdbf10dedda36728a Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 14 Dec 2022 18:07:45 +0200 Subject: [PATCH 03/20] Changing Role + Permissions namespace --- tests/e2e/Services/Databases/DatabasesBase.php | 1 - tests/e2e/Services/Databases/DatabasesCustomServerTest.php | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 083577ef94..c81afcdd4e 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -3,7 +3,6 @@ namespace Tests\E2E\Services\Databases; use Tests\E2E\Client; -use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; use Utopia\Database\Helpers\Permission; diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index 3fe28bbd29..19a56941eb 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -6,7 +6,6 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Tests\E2E\Client; -use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; From bdc3e9f9353da39fe808be7e81446a06f4ebda4d Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 15 Dec 2022 10:51:27 +0200 Subject: [PATCH 04/20] $dateValidator --- phpunit.xml | 2 +- tests/e2e/General/UsageTest.php | 7 +++-- tests/e2e/Scopes/Scope.php | 11 +++++--- tests/e2e/Services/Account/AccountBase.php | 26 +++++++++---------- .../Account/AccountCustomClientTest.php | 12 ++++----- .../e2e/Services/Databases/DatabasesBase.php | 5 ++-- .../Functions/FunctionsCustomServerTest.php | 20 +++++++------- tests/e2e/Services/Storage/StorageBase.php | 10 +++---- .../Storage/StorageCustomClientTest.php | 20 +++++++------- .../Storage/StorageCustomServerTest.php | 4 +-- tests/e2e/Services/Teams/TeamsBase.php | 14 +++++----- tests/e2e/Services/Teams/TeamsBaseClient.php | 10 +++---- tests/e2e/Services/Teams/TeamsBaseServer.php | 8 +++--- tests/e2e/Services/Webhooks/WebhooksBase.php | 16 ++++++------ .../Webhooks/WebhooksCustomClientTest.php | 18 ++++++------- .../Webhooks/WebhooksCustomServerTest.php | 6 ++--- 16 files changed, 95 insertions(+), 94 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 4012c8c276..4074fe0f1c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" + stopOnFailure="true" > diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 7ef5606650..6483257ae2 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -9,7 +9,6 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use CURLFile; use Tests\E2E\Services\Functions\FunctionsBase; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -642,7 +641,7 @@ class UsageTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); - $this->assertEquals(true, DateTime::isValid($deployment['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($deployment['body']['$createdAt'])); $this->assertEquals('index.php', $deployment['body']['entrypoint']); // Wait for deployment to build. @@ -652,8 +651,8 @@ class UsageTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); - $this->assertEquals(true, DateTime::isValid($response['body']['$updatedAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$updatedAt'])); $this->assertEquals($deploymentId, $response['body']['deployment']); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', $headers, [ diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 939de516b6..bb27adb8e0 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -6,6 +6,8 @@ use Appwrite\Tests\Retryable; use Tests\E2E\Client; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; +use Utopia\Validator; abstract class Scope extends TestCase { @@ -16,10 +18,9 @@ abstract class Scope extends TestCase */ protected $client = null; - /** - * @var string - */ - protected $endpoint = 'http://localhost/v1'; + protected string $endpoint = 'http://localhost/v1'; + + public static Validator $dateValidator; protected function setUp(): void { @@ -28,6 +29,8 @@ abstract class Scope extends TestCase $this->client ->setEndpoint($this->endpoint) ; + + self::$dateValidator = new DatetimeValidator(); } protected function tearDown(): void diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 880323e728..0bd4e58e0d 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -34,7 +34,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 201); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); @@ -198,7 +198,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 200); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); @@ -343,7 +343,7 @@ trait AccountBase $this->assertIsNumeric($response['body']['total']); $this->assertContains($response['body']['logs'][1]['event'], ["session.create"]); $this->assertEquals($response['body']['logs'][1]['ip'], filter_var($response['body']['logs'][1]['ip'], FILTER_VALIDATE_IP)); - $this->assertEquals(true, DateTime::isValid($response['body']['logs'][1]['time'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['logs'][1]['time'])); $this->assertEquals('Windows', $response['body']['logs'][1]['osName']); $this->assertEquals('WIN', $response['body']['logs'][1]['osCode']); @@ -365,7 +365,7 @@ trait AccountBase $this->assertContains($response['body']['logs'][2]['event'], ["user.create"]); $this->assertEquals($response['body']['logs'][2]['ip'], filter_var($response['body']['logs'][2]['ip'], FILTER_VALIDATE_IP)); - $this->assertEquals(true, DateTime::isValid($response['body']['logs'][2]['time'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['logs'][2]['time'])); $this->assertEquals('Windows', $response['body']['logs'][2]['osName']); $this->assertEquals('WIN', $response['body']['logs'][2]['osCode']); @@ -476,7 +476,7 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $newName); @@ -543,7 +543,7 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -633,7 +633,7 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $newEmail); /** @@ -675,7 +675,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 201); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $data['email']); $this->assertEquals($response['body']['name'], $data['name']); @@ -817,7 +817,7 @@ trait AccountBase $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, DateTime::isValid($response['body']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); $lastEmail = $this->getLastEmail(); @@ -1119,7 +1119,7 @@ trait AccountBase $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, DateTime::isValid($response['body']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); $lastEmail = $this->getLastEmail(); @@ -1273,7 +1273,7 @@ trait AccountBase $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, DateTime::isValid($response['body']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); $userId = $response['body']['userId']; @@ -1379,7 +1379,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 200); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertTrue($response['body']['emailVerification']); @@ -1439,7 +1439,7 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 4a480597c1..d5a65edc7d 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -448,7 +448,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -699,7 +699,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, DateTime::isValid($response['body']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); $userId = $response['body']['userId']; @@ -799,7 +799,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals($response['headers']['status-code'], 200); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['phone'], $number); $this->assertTrue($response['body']['phoneVerification']); @@ -850,7 +850,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -892,7 +892,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['phone'], $newPhone); /** @@ -941,7 +941,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, DateTime::isValid($response['body']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); \sleep(2); diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index c81afcdd4e..3209ff46b0 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4,7 +4,6 @@ namespace Tests\E2E\Services\Databases; use Tests\E2E\Client; use Utopia\Database\Helpers\ID; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -1531,8 +1530,8 @@ trait DatabasesBase $this->assertEquals($databaseId, $document['body']['$databaseId']); $this->assertEquals($document['body']['title'], 'Thor: Ragnaroc'); $this->assertEquals($document['body']['releaseYear'], 2017); - $this->assertEquals(true, DateTime::isValid($document['body']['$createdAt'])); - $this->assertEquals(true, DateTime::isValid($document['body']['birthDay'])); + $this->assertEquals(true, self::$dateValidator->isValid($document['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($document['body']['birthDay'])); $this->assertContains(Permission::read(Role::user($this->getUser()['$id'])), $document['body']['$permissions']); $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $document['body']['$permissions']); $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $document['body']['$permissions']); diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index a17f3ebe63..5adf6eaef2 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -45,8 +45,8 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($response1['body']['$id']); $this->assertEquals('Test', $response1['body']['name']); $this->assertEquals('php-8.0', $response1['body']['runtime']); - $this->assertEquals(true, DateTime::isValid($response1['body']['$createdAt'])); - $this->assertEquals(true, DateTime::isValid($response1['body']['$updatedAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$updatedAt'])); $this->assertEquals('', $response1['body']['deployment']); $this->assertEquals([ 'users.*.create', @@ -328,8 +328,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $response1['headers']['status-code']); $this->assertNotEmpty($response1['body']['$id']); $this->assertEquals('Test1', $response1['body']['name']); - $this->assertEquals(true, DateTime::isValid($response1['body']['$createdAt'])); - $this->assertEquals(true, DateTime::isValid($response1['body']['$updatedAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$updatedAt'])); $this->assertEquals('', $response1['body']['deployment']); $this->assertEquals([ 'users.*.update.name', @@ -369,7 +369,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); - $this->assertEquals(true, DateTime::isValid($deployment['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($deployment['body']['$createdAt'])); $this->assertEquals('index.php', $deployment['body']['entrypoint']); // Wait for deployment to build. @@ -418,7 +418,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $largeTag['headers']['status-code']); $this->assertNotEmpty($largeTag['body']['$id']); - $this->assertEquals(true, DateTime::isValid($largeTag['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($largeTag['body']['$createdAt'])); $this->assertEquals('index.php', $largeTag['body']['entrypoint']); $this->assertGreaterThan(10000, $largeTag['body']['size']); @@ -440,8 +440,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); - $this->assertEquals(true, DateTime::isValid($response['body']['$updatedAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$updatedAt'])); $this->assertEquals($data['deploymentId'], $response['body']['deployment']); /** @@ -606,7 +606,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $execution['headers']['status-code']); $this->assertNotEmpty($execution['body']['$id']); $this->assertNotEmpty($execution['body']['functionId']); - $this->assertEquals(true, DateTime::isValid($execution['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($execution['body']['$createdAt'])); $this->assertEquals($data['functionId'], $execution['body']['functionId']); $this->assertEquals('waiting', $execution['body']['status']); $this->assertEquals(0, $execution['body']['statusCode']); @@ -623,7 +623,7 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($execution['body']['$id']); $this->assertNotEmpty($execution['body']['functionId']); - $this->assertEquals(true, DateTime::isValid($execution['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($execution['body']['$createdAt'])); $this->assertEquals($data['functionId'], $execution['body']['functionId']); $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(200, $execution['body']['statusCode']); diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 359989e114..e30cf512b8 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -52,7 +52,7 @@ trait StorageBase ]); $this->assertEquals(201, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('logo.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -120,7 +120,7 @@ trait StorageBase $this->assertEquals(201, $largeFile['headers']['status-code']); $this->assertNotEmpty($largeFile['body']['$id']); - $this->assertEquals(true, DateTime::isValid($largeFile['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($largeFile['body']['$createdAt'])); $this->assertEquals('large-file.mp4', $largeFile['body']['name']); $this->assertEquals('video/mp4', $largeFile['body']['mimeType']); $this->assertEquals($totalSize, $largeFile['body']['sizeOriginal']); @@ -283,7 +283,7 @@ trait StorageBase ]); $this->assertEquals(201, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('logo.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -373,7 +373,7 @@ trait StorageBase $this->assertEquals(200, $file1['headers']['status-code']); $this->assertNotEmpty($file1['body']['$id']); - $this->assertEquals(true, DateTime::isValid($file1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('logo.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -712,7 +712,7 @@ trait StorageBase $this->assertEquals(200, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('logo.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index 4a697d584a..8b22ab3181 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -63,7 +63,7 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -159,7 +159,7 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -245,7 +245,7 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -370,7 +370,7 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -548,7 +548,7 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -710,7 +710,7 @@ class StorageCustomClientTest extends Scope $fileId = $file1['body']['$id']; $this->assertEquals($file1['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('permissions.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -799,7 +799,7 @@ class StorageCustomClientTest extends Scope $fileId = $file1['body']['$id']; $this->assertEquals($file1['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('permissions.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -888,7 +888,7 @@ class StorageCustomClientTest extends Scope $fileId = $file1['body']['$id']; $this->assertEquals($file1['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('permissions.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -1027,7 +1027,7 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -1262,7 +1262,7 @@ class StorageCustomClientTest extends Scope $this->assertContains(Permission::read(Role::user($this->getUser()['$id'])), $file['body']['$permissions']); $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $file['body']['$permissions']); $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $file['body']['$permissions']); - $this->assertEquals(true, DateTime::isValid($file['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); diff --git a/tests/e2e/Services/Storage/StorageCustomServerTest.php b/tests/e2e/Services/Storage/StorageCustomServerTest.php index 2395e1d8fc..d4b2f7db49 100644 --- a/tests/e2e/Services/Storage/StorageCustomServerTest.php +++ b/tests/e2e/Services/Storage/StorageCustomServerTest.php @@ -30,7 +30,7 @@ class StorageCustomServerTest extends Scope ]); $this->assertEquals(201, $bucket['headers']['status-code']); $this->assertNotEmpty($bucket['body']['$id']); - $this->assertEquals(true, DateTime::isValid($bucket['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($bucket['body']['$createdAt'])); $this->assertIsArray($bucket['body']['$permissions']); $this->assertIsArray($bucket['body']['allowedFileExtensions']); $this->assertEquals('Test Bucket', $bucket['body']['name']); @@ -228,7 +228,7 @@ class StorageCustomServerTest extends Scope ]); $this->assertEquals(200, $bucket['headers']['status-code']); $this->assertNotEmpty($bucket['body']['$id']); - $this->assertEquals(true, DateTime::isValid($bucket['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($bucket['body']['$createdAt'])); $this->assertIsArray($bucket['body']['$permissions']); $this->assertIsArray($bucket['body']['allowedFileExtensions']); $this->assertEquals('Test Bucket Updated', $bucket['body']['name']); diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index 3bad31e35c..bd65971b82 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -28,7 +28,7 @@ trait TeamsBase $this->assertEquals('Arsenal', $response1['body']['name']); $this->assertGreaterThan(-1, $response1['body']['total']); $this->assertIsInt($response1['body']['total']); - $this->assertEquals(true, DateTime::isValid($response1['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$createdAt'])); $teamUid = $response1['body']['$id']; $teamName = $response1['body']['name']; @@ -48,7 +48,7 @@ trait TeamsBase $this->assertEquals('Manchester United', $response2['body']['name']); $this->assertGreaterThan(-1, $response2['body']['total']); $this->assertIsInt($response2['body']['total']); - $this->assertEquals(true, DateTime::isValid($response2['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response2['body']['$createdAt'])); $response3 = $this->client->call(Client::METHOD_POST, '/teams', array_merge([ 'content-type' => 'application/json', @@ -63,7 +63,7 @@ trait TeamsBase $this->assertEquals('Newcastle', $response3['body']['name']); $this->assertGreaterThan(-1, $response3['body']['total']); $this->assertIsInt($response3['body']['total']); - $this->assertEquals(true, DateTime::isValid($response3['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response3['body']['$createdAt'])); /** * Test for FAILURE */ @@ -98,7 +98,7 @@ trait TeamsBase $this->assertEquals('Arsenal', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); /** * Test for FAILURE @@ -275,7 +275,7 @@ trait TeamsBase $this->assertEquals('Demo', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); $response = $this->client->call(Client::METHOD_PUT, '/teams/' . $response['body']['$id'], array_merge([ 'content-type' => 'application/json', @@ -290,7 +290,7 @@ trait TeamsBase $this->assertEquals('Demo New', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); /** * Test for FAILURE @@ -326,7 +326,7 @@ trait TeamsBase $this->assertEquals('Demo', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 0eb578e325..aaa11d2f9b 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -150,7 +150,7 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(false, DateTime::isValid($response['body']['joined'])); // is null in DB + $this->assertEquals(false, self::$dateValidator->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(false, $response['body']['confirm']); /** @@ -203,7 +203,7 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(false, DateTime::isValid($response['body']['joined'])); // is null in DB + $this->assertEquals(false, self::$dateValidator->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(false, $response['body']['confirm']); $lastEmail = $this->getLastEmail(); @@ -337,7 +337,7 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['userId']); $this->assertNotEmpty($response['body']['teamId']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(true, DateTime::isValid($response['body']['joined'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['joined'])); $this->assertEquals(true, $response['body']['confirm']); $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $data['session'] = $session; @@ -369,7 +369,7 @@ trait TeamsBaseClient $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); @@ -403,7 +403,7 @@ trait TeamsBaseClient $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, DateTime::isValid($response['body']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); diff --git a/tests/e2e/Services/Teams/TeamsBaseServer.php b/tests/e2e/Services/Teams/TeamsBaseServer.php index df508e5e37..db5ca697f9 100644 --- a/tests/e2e/Services/Teams/TeamsBaseServer.php +++ b/tests/e2e/Services/Teams/TeamsBaseServer.php @@ -57,7 +57,7 @@ trait TeamsBaseServer $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(true, DateTime::isValid($response['body']['joined'])); // is null in DB + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(true, $response['body']['confirm']); /** @@ -108,7 +108,7 @@ trait TeamsBaseServer $this->assertEquals($email, $response['body']['userEmail']); $this->assertNotEmpty($response['body']['teamId']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(true, DateTime::isValid($response['body']['joined'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['joined'])); $this->assertEquals(true, $response['body']['confirm']); $userUid = $response['body']['userId']; @@ -252,7 +252,7 @@ trait TeamsBaseServer $this->assertEquals('Arsenal', $response['body']['name']); $this->assertEquals(1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); /** Delete User */ $user = $this->client->call(Client::METHOD_DELETE, '/users/' . $userUid, array_merge([ @@ -277,6 +277,6 @@ trait TeamsBaseServer $this->assertEquals('Arsenal', $response['body']['name']); $this->assertEquals(0, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, DateTime::isValid($response['body']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); } } diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index d3d700a222..33fd9107f4 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -529,7 +529,7 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); - $this->assertEquals(true, DateTime::isValid($webhook['data']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); $this->assertNotEmpty($webhook['data']['signature']); $this->assertEquals($webhook['data']['mimeType'], 'image/png'); $this->assertEquals($webhook['data']['sizeOriginal'], 47218); @@ -587,7 +587,7 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); - $this->assertEquals(true, DateTime::isValid($webhook['data']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); $this->assertNotEmpty($webhook['data']['signature']); $this->assertEquals($webhook['data']['mimeType'], 'image/png'); $this->assertEquals($webhook['data']['sizeOriginal'], 47218); @@ -637,7 +637,7 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); - $this->assertEquals(true, DateTime::isValid($webhook['data']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); $this->assertNotEmpty($webhook['data']['signature']); $this->assertEquals($webhook['data']['mimeType'], 'image/png'); $this->assertEquals($webhook['data']['sizeOriginal'], 47218); @@ -719,7 +719,7 @@ trait WebhooksBase $this->assertEquals('Arsenal', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); $this->assertIsInt($webhook['data']['total']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); /** * Test for FAILURE @@ -764,7 +764,7 @@ trait WebhooksBase $this->assertEquals('Demo New', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); $this->assertIsInt($webhook['data']['total']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); /** * Test for FAILURE @@ -813,7 +813,7 @@ trait WebhooksBase $this->assertEquals('Chelsea', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); $this->assertIsInt($webhook['data']['total']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['$createdAt'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); /** * Test for FAILURE @@ -874,7 +874,7 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['invited'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['invited'])); $this->assertEquals(('server' === $this->getSide()), $webhook['data']['confirm']); /** @@ -946,7 +946,7 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['invited'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['invited'])); $this->assertEquals(('server' === $this->getSide()), $webhook['data']['confirm']); } } diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index 1a49b4b3f0..262023f5c1 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -60,7 +60,7 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id']), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, DateTime::isValid($webhook['data']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], true); $this->assertEquals($webhook['data']['email'], $email); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -136,7 +136,7 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, DateTime::isValid($webhook['data']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], false); $this->assertEquals($webhook['data']['email'], $email); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -196,7 +196,7 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id']), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); $this->assertEquals($webhook['data']['ip'], '127.0.0.1'); $this->assertNotEmpty($webhook['data']['osCode']); $this->assertIsString($webhook['data']['osCode']); @@ -371,7 +371,7 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); $this->assertEquals($webhook['data']['ip'], '127.0.0.1'); $this->assertNotEmpty($webhook['data']['osCode']); $this->assertIsString($webhook['data']['osCode']); @@ -683,7 +683,7 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -743,7 +743,7 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -799,7 +799,7 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -857,7 +857,7 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['expire'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -920,7 +920,7 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['joined'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['joined'])); $this->assertEquals(true, $webhook['data']['confirm']); /** diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index 51f5ef2532..869bc156d2 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -245,7 +245,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, DateTime::isValid($webhook['data']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], true); $this->assertEquals($webhook['data']['email'], $email); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -336,7 +336,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $data['name']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], false); $this->assertEquals($webhook['data']['email'], $data['email']); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -378,7 +378,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $data['name']); - $this->assertEquals(true, DateTime::isValid($webhook['data']['registration'])); + $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], false); $this->assertEquals($webhook['data']['email'], $data['email']); $this->assertEquals($webhook['data']['emailVerification'], false); From 91db596b420507a0890fd0b0170e10080180f5cd Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 19 Dec 2022 13:21:09 +0200 Subject: [PATCH 05/20] remove static $dateValidator --- composer.lock | 21 +++++----- tests/e2e/General/UsageTest.php | 8 ++-- tests/e2e/Scopes/Scope.php | 2 - tests/e2e/Services/Account/AccountBase.php | 38 ++++++++++++------- .../Account/AccountCustomClientTest.php | 19 +++++++--- .../e2e/Services/Databases/DatabasesBase.php | 6 ++- .../Functions/FunctionsCustomServerTest.php | 27 ++++++++----- tests/e2e/Services/Storage/StorageBase.php | 15 +++++--- .../Storage/StorageCustomClientTest.php | 31 ++++++++++----- .../Storage/StorageCustomServerTest.php | 7 +++- tests/e2e/Services/Teams/TeamsBase.php | 19 ++++++---- tests/e2e/Services/Teams/TeamsBaseClient.php | 14 ++++--- tests/e2e/Services/Teams/TeamsBaseServer.php | 12 ++++-- tests/e2e/Services/Webhooks/WebhooksBase.php | 25 ++++++++---- .../Webhooks/WebhooksCustomClientTest.php | 28 +++++++++----- .../Webhooks/WebhooksCustomServerTest.php | 10 +++-- 16 files changed, 183 insertions(+), 99 deletions(-) diff --git a/composer.lock b/composer.lock index 283eed1c21..ce6b1fb837 100644 --- a/composer.lock +++ b/composer.lock @@ -874,6 +874,7 @@ "issues": "https://github.com/influxdata/influxdb-php/issues", "source": "https://github.com/influxdata/influxdb-php/tree/1.15.2" }, + "abandoned": true, "time": "2020-12-26T17:45:17+00:00" }, { @@ -2120,12 +2121,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "703f5daa6341e3c7bf97e3ccd5ebae75198c5caf" + "reference": "08ee675eace0a4ab7ae779fec842a436e9cad3db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/703f5daa6341e3c7bf97e3ccd5ebae75198c5caf", - "reference": "703f5daa6341e3c7bf97e3ccd5ebae75198c5caf", + "url": "https://api.github.com/repos/utopia-php/database/zipball/08ee675eace0a4ab7ae779fec842a436e9cad3db", + "reference": "08ee675eace0a4ab7ae779fec842a436e9cad3db", "shasum": "" }, "require": { @@ -2167,7 +2168,7 @@ "issues": "https://github.com/utopia-php/database/issues", "source": "https://github.com/utopia-php/database/tree/feat-technical-debt" }, - "time": "2022-12-13T15:36:09+00:00" + "time": "2022-12-19T07:31:10+00:00" }, { "name": "utopia-php/domains", @@ -3700,16 +3701,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.21", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { @@ -3765,7 +3766,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -3773,7 +3774,7 @@ "type": "github" } ], - "time": "2022-12-14T13:26:54+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 6483257ae2..afa8433cbb 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -11,6 +11,7 @@ use CURLFile; use Tests\E2E\Services\Functions\FunctionsBase; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\DatetimeValidator; class UsageTest extends Scope { @@ -600,6 +601,7 @@ class UsageTest extends Scope /** @depends testDatabaseStats */ public function testPrepareFunctionsStats(array $data): array { + $dateValidator = new DatetimeValidator(); $headers = $data['headers']; $functionId = ''; $executionTime = 0; @@ -641,7 +643,7 @@ class UsageTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($deployment['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($deployment['body']['$createdAt'])); $this->assertEquals('index.php', $deployment['body']['entrypoint']); // Wait for deployment to build. @@ -651,8 +653,8 @@ class UsageTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$updatedAt'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$updatedAt'])); $this->assertEquals($deploymentId, $response['body']['deployment']); $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', $headers, [ diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index bb27adb8e0..c5079962a0 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -29,8 +29,6 @@ abstract class Scope extends TestCase $this->client ->setEndpoint($this->endpoint) ; - - self::$dateValidator = new DatetimeValidator(); } protected function tearDown(): void diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 0bd4e58e0d..5b5c1ccc12 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -6,6 +6,7 @@ use Appwrite\Tests\Retry; use Tests\E2E\Client; use Utopia\Database\Helpers\ID; use Utopia\Database\DateTime; +use Utopia\Database\Validator\DatetimeValidator; trait AccountBase { @@ -34,7 +35,8 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 201); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); @@ -198,7 +200,8 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 200); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); @@ -343,7 +346,8 @@ trait AccountBase $this->assertIsNumeric($response['body']['total']); $this->assertContains($response['body']['logs'][1]['event'], ["session.create"]); $this->assertEquals($response['body']['logs'][1]['ip'], filter_var($response['body']['logs'][1]['ip'], FILTER_VALIDATE_IP)); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['logs'][1]['time'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['logs'][1]['time'])); $this->assertEquals('Windows', $response['body']['logs'][1]['osName']); $this->assertEquals('WIN', $response['body']['logs'][1]['osCode']); @@ -365,7 +369,7 @@ trait AccountBase $this->assertContains($response['body']['logs'][2]['event'], ["user.create"]); $this->assertEquals($response['body']['logs'][2]['ip'], filter_var($response['body']['logs'][2]['ip'], FILTER_VALIDATE_IP)); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['logs'][2]['time'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['logs'][2]['time'])); $this->assertEquals('Windows', $response['body']['logs'][2]['osName']); $this->assertEquals('WIN', $response['body']['logs'][2]['osCode']); @@ -476,7 +480,8 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $newName); @@ -543,7 +548,8 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -633,7 +639,8 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $newEmail); /** @@ -675,7 +682,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 201); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $data['email']); $this->assertEquals($response['body']['name'], $data['name']); @@ -817,7 +824,8 @@ trait AccountBase $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['expire'])); $lastEmail = $this->getLastEmail(); @@ -1119,7 +1127,8 @@ trait AccountBase $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['expire'])); $lastEmail = $this->getLastEmail(); @@ -1273,7 +1282,8 @@ trait AccountBase $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['expire'])); $userId = $response['body']['userId']; @@ -1379,7 +1389,8 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 200); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertTrue($response['body']['emailVerification']); @@ -1439,7 +1450,8 @@ trait AccountBase $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index d5a65edc7d..b89e0a0746 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -10,6 +10,7 @@ use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; use function sleep; class AccountCustomClientTest extends Scope @@ -448,7 +449,8 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -699,7 +701,8 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['expire'])); $userId = $response['body']['userId']; @@ -799,7 +802,8 @@ class AccountCustomClientTest extends Scope $this->assertEquals($response['headers']['status-code'], 200); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['phone'], $number); $this->assertTrue($response['body']['phoneVerification']); @@ -850,7 +854,8 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -892,7 +897,8 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['phone'], $newPhone); /** @@ -941,7 +947,8 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['expire'])); \sleep(2); diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 3209ff46b0..13a95c9f09 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\DatetimeValidator; trait DatabasesBase { @@ -1530,8 +1531,9 @@ trait DatabasesBase $this->assertEquals($databaseId, $document['body']['$databaseId']); $this->assertEquals($document['body']['title'], 'Thor: Ragnaroc'); $this->assertEquals($document['body']['releaseYear'], 2017); - $this->assertEquals(true, self::$dateValidator->isValid($document['body']['$createdAt'])); - $this->assertEquals(true, self::$dateValidator->isValid($document['body']['birthDay'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($document['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($document['body']['birthDay'])); $this->assertContains(Permission::read(Role::user($this->getUser()['$id'])), $document['body']['$permissions']); $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $document['body']['$permissions']); $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $document['body']['$permissions']); diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 5adf6eaef2..0d2c6298da 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -12,6 +12,7 @@ use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; class FunctionsCustomServerTest extends Scope { @@ -45,8 +46,9 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($response1['body']['$id']); $this->assertEquals('Test', $response1['body']['name']); $this->assertEquals('php-8.0', $response1['body']['runtime']); - $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$createdAt'])); - $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$updatedAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response1['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response1['body']['$updatedAt'])); $this->assertEquals('', $response1['body']['deployment']); $this->assertEquals([ 'users.*.create', @@ -328,8 +330,9 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $response1['headers']['status-code']); $this->assertNotEmpty($response1['body']['$id']); $this->assertEquals('Test1', $response1['body']['name']); - $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$createdAt'])); - $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$updatedAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response1['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response1['body']['$updatedAt'])); $this->assertEquals('', $response1['body']['deployment']); $this->assertEquals([ 'users.*.update.name', @@ -369,7 +372,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($deployment['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($deployment['body']['$createdAt'])); $this->assertEquals('index.php', $deployment['body']['entrypoint']); // Wait for deployment to build. @@ -418,7 +422,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $largeTag['headers']['status-code']); $this->assertNotEmpty($largeTag['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($largeTag['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($largeTag['body']['$createdAt'])); $this->assertEquals('index.php', $largeTag['body']['entrypoint']); $this->assertGreaterThan(10000, $largeTag['body']['size']); @@ -440,8 +445,9 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$updatedAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$updatedAt'])); $this->assertEquals($data['deploymentId'], $response['body']['deployment']); /** @@ -606,7 +612,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $execution['headers']['status-code']); $this->assertNotEmpty($execution['body']['$id']); $this->assertNotEmpty($execution['body']['functionId']); - $this->assertEquals(true, self::$dateValidator->isValid($execution['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($execution['body']['$createdAt'])); $this->assertEquals($data['functionId'], $execution['body']['functionId']); $this->assertEquals('waiting', $execution['body']['status']); $this->assertEquals(0, $execution['body']['statusCode']); @@ -623,7 +630,7 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($execution['body']['$id']); $this->assertNotEmpty($execution['body']['functionId']); - $this->assertEquals(true, self::$dateValidator->isValid($execution['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($execution['body']['$createdAt'])); $this->assertEquals($data['functionId'], $execution['body']['functionId']); $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(200, $execution['body']['statusCode']); diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index e30cf512b8..9502f841f7 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -8,6 +8,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\DatetimeValidator; trait StorageBase { @@ -52,7 +53,8 @@ trait StorageBase ]); $this->assertEquals(201, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('logo.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -120,7 +122,7 @@ trait StorageBase $this->assertEquals(201, $largeFile['headers']['status-code']); $this->assertNotEmpty($largeFile['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($largeFile['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($largeFile['body']['$createdAt'])); $this->assertEquals('large-file.mp4', $largeFile['body']['name']); $this->assertEquals('video/mp4', $largeFile['body']['mimeType']); $this->assertEquals($totalSize, $largeFile['body']['sizeOriginal']); @@ -283,7 +285,8 @@ trait StorageBase ]); $this->assertEquals(201, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('logo.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -373,7 +376,8 @@ trait StorageBase $this->assertEquals(200, $file1['headers']['status-code']); $this->assertNotEmpty($file1['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('logo.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -712,7 +716,8 @@ trait StorageBase $this->assertEquals(200, $file['headers']['status-code']); $this->assertNotEmpty($file['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('logo.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index 8b22ab3181..d960c92f7c 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -17,6 +17,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\DatetimeValidator; class StorageCustomClientTest extends Scope { @@ -63,7 +64,8 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -159,7 +161,8 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -245,7 +248,8 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -370,7 +374,8 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -548,7 +553,8 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -710,7 +716,8 @@ class StorageCustomClientTest extends Scope $fileId = $file1['body']['$id']; $this->assertEquals($file1['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('permissions.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -799,7 +806,8 @@ class StorageCustomClientTest extends Scope $fileId = $file1['body']['$id']; $this->assertEquals($file1['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('permissions.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -888,7 +896,8 @@ class StorageCustomClientTest extends Scope $fileId = $file1['body']['$id']; $this->assertEquals($file1['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file1['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file1['body']['$createdAt'])); $this->assertEquals('permissions.png', $file1['body']['name']); $this->assertEquals('image/png', $file1['body']['mimeType']); $this->assertEquals(47218, $file1['body']['sizeOriginal']); @@ -1027,7 +1036,8 @@ class StorageCustomClientTest extends Scope $fileId = $file['body']['$id']; $this->assertEquals($file['headers']['status-code'], 201); $this->assertNotEmpty($fileId); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); @@ -1262,7 +1272,8 @@ class StorageCustomClientTest extends Scope $this->assertContains(Permission::read(Role::user($this->getUser()['$id'])), $file['body']['$permissions']); $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $file['body']['$permissions']); $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $file['body']['$permissions']); - $this->assertEquals(true, self::$dateValidator->isValid($file['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($file['body']['$createdAt'])); $this->assertEquals('permissions.png', $file['body']['name']); $this->assertEquals('image/png', $file['body']['mimeType']); $this->assertEquals(47218, $file['body']['sizeOriginal']); diff --git a/tests/e2e/Services/Storage/StorageCustomServerTest.php b/tests/e2e/Services/Storage/StorageCustomServerTest.php index d4b2f7db49..8bba5b6e7f 100644 --- a/tests/e2e/Services/Storage/StorageCustomServerTest.php +++ b/tests/e2e/Services/Storage/StorageCustomServerTest.php @@ -8,6 +8,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; class StorageCustomServerTest extends Scope { @@ -30,7 +31,8 @@ class StorageCustomServerTest extends Scope ]); $this->assertEquals(201, $bucket['headers']['status-code']); $this->assertNotEmpty($bucket['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($bucket['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($bucket['body']['$createdAt'])); $this->assertIsArray($bucket['body']['$permissions']); $this->assertIsArray($bucket['body']['allowedFileExtensions']); $this->assertEquals('Test Bucket', $bucket['body']['name']); @@ -228,7 +230,8 @@ class StorageCustomServerTest extends Scope ]); $this->assertEquals(200, $bucket['headers']['status-code']); $this->assertNotEmpty($bucket['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($bucket['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($bucket['body']['$createdAt'])); $this->assertIsArray($bucket['body']['$permissions']); $this->assertIsArray($bucket['body']['allowedFileExtensions']); $this->assertEquals('Test Bucket Updated', $bucket['body']['name']); diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index bd65971b82..a66939b46a 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; trait TeamsBase { @@ -28,7 +29,8 @@ trait TeamsBase $this->assertEquals('Arsenal', $response1['body']['name']); $this->assertGreaterThan(-1, $response1['body']['total']); $this->assertIsInt($response1['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response1['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response1['body']['$createdAt'])); $teamUid = $response1['body']['$id']; $teamName = $response1['body']['name']; @@ -48,7 +50,7 @@ trait TeamsBase $this->assertEquals('Manchester United', $response2['body']['name']); $this->assertGreaterThan(-1, $response2['body']['total']); $this->assertIsInt($response2['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response2['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response2['body']['$createdAt'])); $response3 = $this->client->call(Client::METHOD_POST, '/teams', array_merge([ 'content-type' => 'application/json', @@ -63,7 +65,7 @@ trait TeamsBase $this->assertEquals('Newcastle', $response3['body']['name']); $this->assertGreaterThan(-1, $response3['body']['total']); $this->assertIsInt($response3['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response3['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response3['body']['$createdAt'])); /** * Test for FAILURE */ @@ -98,7 +100,8 @@ trait TeamsBase $this->assertEquals('Arsenal', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); /** * Test for FAILURE @@ -275,7 +278,8 @@ trait TeamsBase $this->assertEquals('Demo', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); $response = $this->client->call(Client::METHOD_PUT, '/teams/' . $response['body']['$id'], array_merge([ 'content-type' => 'application/json', @@ -290,7 +294,7 @@ trait TeamsBase $this->assertEquals('Demo New', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); /** * Test for FAILURE @@ -326,7 +330,8 @@ trait TeamsBase $this->assertEquals('Demo', $response['body']['name']); $this->assertGreaterThan(-1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index aaa11d2f9b..c3754693b3 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -5,6 +5,7 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; trait TeamsBaseClient { @@ -150,7 +151,8 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(false, self::$dateValidator->isValid($response['body']['joined'])); // is null in DB + $dateValidator = new DatetimeValidator(); + $this->assertEquals(false, $dateValidator->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(false, $response['body']['confirm']); /** @@ -203,7 +205,8 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(false, self::$dateValidator->isValid($response['body']['joined'])); // is null in DB + $dateValidator = new DatetimeValidator(); + $this->assertEquals(false, $dateValidator->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(false, $response['body']['confirm']); $lastEmail = $this->getLastEmail(); @@ -337,7 +340,8 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['userId']); $this->assertNotEmpty($response['body']['teamId']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['joined'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['joined'])); $this->assertEquals(true, $response['body']['confirm']); $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $data['session'] = $session; @@ -369,7 +373,7 @@ trait TeamsBaseClient $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); @@ -403,7 +407,7 @@ trait TeamsBaseClient $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['registration'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); diff --git a/tests/e2e/Services/Teams/TeamsBaseServer.php b/tests/e2e/Services/Teams/TeamsBaseServer.php index db5ca697f9..629aa8f4ad 100644 --- a/tests/e2e/Services/Teams/TeamsBaseServer.php +++ b/tests/e2e/Services/Teams/TeamsBaseServer.php @@ -5,6 +5,7 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; use Utopia\Database\Database; use Utopia\Database\DateTime; +use Utopia\Database\Validator\DatetimeValidator; trait TeamsBaseServer { @@ -57,7 +58,8 @@ trait TeamsBaseServer $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['joined'])); // is null in DB + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(true, $response['body']['confirm']); /** @@ -108,7 +110,8 @@ trait TeamsBaseServer $this->assertEquals($email, $response['body']['userEmail']); $this->assertNotEmpty($response['body']['teamId']); $this->assertCount(2, $response['body']['roles']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['joined'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['joined'])); $this->assertEquals(true, $response['body']['confirm']); $userUid = $response['body']['userId']; @@ -252,7 +255,8 @@ trait TeamsBaseServer $this->assertEquals('Arsenal', $response['body']['name']); $this->assertEquals(1, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); /** Delete User */ $user = $this->client->call(Client::METHOD_DELETE, '/users/' . $userUid, array_merge([ @@ -277,6 +281,6 @@ trait TeamsBaseServer $this->assertEquals('Arsenal', $response['body']['name']); $this->assertEquals(0, $response['body']['total']); $this->assertIsInt($response['body']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($response['body']['$createdAt'])); + $this->assertEquals(true, $dateValidator->isValid($response['body']['$createdAt'])); } } diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index 33fd9107f4..e0563d612c 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -9,6 +9,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\DatetimeValidator; trait WebhooksBase { @@ -529,7 +530,8 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['$createdAt'])); $this->assertNotEmpty($webhook['data']['signature']); $this->assertEquals($webhook['data']['mimeType'], 'image/png'); $this->assertEquals($webhook['data']['sizeOriginal'], 47218); @@ -587,7 +589,8 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['$createdAt'])); $this->assertNotEmpty($webhook['data']['signature']); $this->assertEquals($webhook['data']['mimeType'], 'image/png'); $this->assertEquals($webhook['data']['sizeOriginal'], 47218); @@ -637,7 +640,8 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['$id']); $this->assertIsArray($webhook['data']['$permissions']); $this->assertEquals($webhook['data']['name'], 'logo.png'); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['$createdAt'])); $this->assertNotEmpty($webhook['data']['signature']); $this->assertEquals($webhook['data']['mimeType'], 'image/png'); $this->assertEquals($webhook['data']['sizeOriginal'], 47218); @@ -719,7 +723,8 @@ trait WebhooksBase $this->assertEquals('Arsenal', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); $this->assertIsInt($webhook['data']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['$createdAt'])); /** * Test for FAILURE @@ -764,7 +769,8 @@ trait WebhooksBase $this->assertEquals('Demo New', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); $this->assertIsInt($webhook['data']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['$createdAt'])); /** * Test for FAILURE @@ -813,7 +819,8 @@ trait WebhooksBase $this->assertEquals('Chelsea', $webhook['data']['name']); $this->assertGreaterThan(-1, $webhook['data']['total']); $this->assertIsInt($webhook['data']['total']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['$createdAt'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['$createdAt'])); /** * Test for FAILURE @@ -874,7 +881,8 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['invited'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['invited'])); $this->assertEquals(('server' === $this->getSide()), $webhook['data']['confirm']); /** @@ -946,7 +954,8 @@ trait WebhooksBase $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['invited'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['invited'])); $this->assertEquals(('server' === $this->getSide()), $webhook['data']['confirm']); } } diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index 262023f5c1..921952257e 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -9,6 +9,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\DatetimeValidator; class WebhooksCustomClientTest extends Scope { @@ -60,7 +61,8 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id']), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], true); $this->assertEquals($webhook['data']['email'], $email); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -136,7 +138,8 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], false); $this->assertEquals($webhook['data']['email'], $email); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -196,7 +199,8 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id']), true); $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['expire'])); $this->assertEquals($webhook['data']['ip'], '127.0.0.1'); $this->assertNotEmpty($webhook['data']['osCode']); $this->assertIsString($webhook['data']['osCode']); @@ -371,7 +375,8 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['expire'])); $this->assertEquals($webhook['data']['ip'], '127.0.0.1'); $this->assertNotEmpty($webhook['data']['osCode']); $this->assertIsString($webhook['data']['osCode']); @@ -683,7 +688,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -743,7 +749,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -799,7 +806,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -857,7 +865,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['$id']); $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['secret']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['expire'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['expire'])); $data['secret'] = $webhook['data']['secret']; @@ -920,7 +929,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['joined'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['joined'])); $this->assertEquals(true, $webhook['data']['confirm']); /** diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index 869bc156d2..ca5185395d 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -12,6 +12,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; +use Utopia\Database\Validator\DatetimeValidator; class WebhooksCustomServerTest extends Scope { @@ -245,7 +246,8 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $name); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], true); $this->assertEquals($webhook['data']['email'], $email); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -336,7 +338,8 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $data['name']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], false); $this->assertEquals($webhook['data']['email'], $data['email']); $this->assertEquals($webhook['data']['emailVerification'], false); @@ -378,7 +381,8 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); $this->assertNotEmpty($webhook['data']['$id']); $this->assertEquals($webhook['data']['name'], $data['name']); - $this->assertEquals(true, self::$dateValidator->isValid($webhook['data']['registration'])); + $dateValidator = new DatetimeValidator(); + $this->assertEquals(true, $dateValidator->isValid($webhook['data']['registration'])); $this->assertEquals($webhook['data']['status'], false); $this->assertEquals($webhook['data']['email'], $data['email']); $this->assertEquals($webhook['data']['emailVerification'], false); From 91e17e4e94a2bdebd11f23b65b2e8296660a1a5d Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 19 Dec 2022 13:21:32 +0200 Subject: [PATCH 06/20] remove static $dateValidator --- tests/e2e/Scopes/Scope.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index c5079962a0..f590f31fce 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -20,8 +20,6 @@ abstract class Scope extends TestCase protected string $endpoint = 'http://localhost/v1'; - public static Validator $dateValidator; - protected function setUp(): void { $this->client = new Client(); From dfd122efaa83c960750acb05d395fe7d8091138d Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 19 Dec 2022 13:25:01 +0200 Subject: [PATCH 07/20] Change Client data hint --- tests/e2e/Scopes/Scope.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index f590f31fce..67361660a0 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -13,11 +13,7 @@ abstract class Scope extends TestCase { use Retryable; - /** - * @var Client - */ - protected $client = null; - + protected ?Client $client = null; protected string $endpoint = 'http://localhost/v1'; protected function setUp(): void From 616bead19f90c8fc092042b66ddb950ff9b05be2 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 19 Dec 2022 13:58:16 +0200 Subject: [PATCH 08/20] stopOnFailure --- phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 4074fe0f1c..4012c8c276 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" + stopOnFailure="false" > From b301a64dc4261a1fef3b53d9bad72f2d8f07d7c7 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 21 Dec 2022 10:02:22 +0200 Subject: [PATCH 09/20] clean up some use classes not in use --- app/controllers/api/projects.php | 1 - tests/e2e/Scopes/Scope.php | 2 -- tests/e2e/Services/Account/AccountCustomClientTest.php | 2 +- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 3 --- tests/e2e/Services/Storage/StorageBase.php | 1 - tests/e2e/Services/Storage/StorageCustomClientTest.php | 7 ------- tests/e2e/Services/Storage/StorageCustomServerTest.php | 1 - tests/e2e/Services/Teams/TeamsBase.php | 2 -- tests/e2e/Services/Teams/TeamsBaseClient.php | 1 - tests/e2e/Services/Teams/TeamsBaseServer.php | 2 -- tests/e2e/Services/Webhooks/WebhooksBase.php | 1 - tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php | 1 - tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php | 1 - 13 files changed, 1 insertion(+), 24 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 3bfc90d40c..21845d6629 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -32,7 +32,6 @@ use Appwrite\Utopia\Database\Validator\Queries\Projects; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; use Utopia\Validator\Hostname; -use Utopia\Validator\Integer; use Utopia\Validator\Range; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 67361660a0..cf483b6275 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -6,8 +6,6 @@ use Appwrite\Tests\Retryable; use Tests\E2E\Client; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; -use Utopia\Database\Validator\DatetimeValidator; -use Utopia\Validator; abstract class Scope extends TestCase { diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index b89e0a0746..24a7e74890 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -9,8 +9,8 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; - use Utopia\Database\Validator\DatetimeValidator; + use function sleep; class AccountCustomClientTest extends Scope diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 0d2c6298da..3fb8ee9171 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -8,9 +8,6 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\CLI\Console; -use Utopia\Database\Database; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\DatetimeValidator; diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 9502f841f7..72d3a99537 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -4,7 +4,6 @@ namespace Tests\E2E\Services\Storage; use CURLFile; use Tests\E2E\Client; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index d960c92f7c..46ef1d6986 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -2,21 +2,14 @@ namespace Tests\E2E\Services\Storage; -use Appwrite\Auth\Auth; use CURLFile; -use Exception; -use PharIo\Manifest\Author; -use SebastianBergmann\RecursionContext\InvalidArgumentException; -use PHPUnit\Framework\ExpectationFailedException; use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; -use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\DatetimeValidator; class StorageCustomClientTest extends Scope diff --git a/tests/e2e/Services/Storage/StorageCustomServerTest.php b/tests/e2e/Services/Storage/StorageCustomServerTest.php index 8bba5b6e7f..86c9c54302 100644 --- a/tests/e2e/Services/Storage/StorageCustomServerTest.php +++ b/tests/e2e/Services/Storage/StorageCustomServerTest.php @@ -6,7 +6,6 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\DatetimeValidator; diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index a66939b46a..daaf65494d 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -3,8 +3,6 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; -use Utopia\Database\Database; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\DatetimeValidator; diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index c3754693b3..4e6cf85a10 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -3,7 +3,6 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\DatetimeValidator; diff --git a/tests/e2e/Services/Teams/TeamsBaseServer.php b/tests/e2e/Services/Teams/TeamsBaseServer.php index 629aa8f4ad..0714192bdf 100644 --- a/tests/e2e/Services/Teams/TeamsBaseServer.php +++ b/tests/e2e/Services/Teams/TeamsBaseServer.php @@ -3,8 +3,6 @@ namespace Tests\E2E\Services\Teams; use Tests\E2E\Client; -use Utopia\Database\Database; -use Utopia\Database\DateTime; use Utopia\Database\Validator\DatetimeValidator; trait TeamsBaseServer diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index e0563d612c..1afa9cdb52 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -5,7 +5,6 @@ namespace Tests\E2E\Services\Webhooks; use Appwrite\Tests\Retry; use CURLFile; use Tests\E2E\Client; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index 921952257e..aaf7901e19 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -7,7 +7,6 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Validator\DatetimeValidator; diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index ca5185395d..0ccb138d44 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -8,7 +8,6 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Utopia\CLI\Console; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; From f707221ee4d8c6983f0bc5ae260aa59b7eeab34f Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 21 Dec 2022 11:01:47 +0200 Subject: [PATCH 10/20] stopOnFailure revert --- phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 4012c8c276..4074fe0f1c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" + stopOnFailure="true" > From 94c9d68e4fe71544f1e6b237d379208f1c159fb3 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 21 Dec 2022 11:03:06 +0200 Subject: [PATCH 11/20] stopOnFailure revert --- phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 4074fe0f1c..4012c8c276 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" + stopOnFailure="false" > From aa5a45ba79003c70a3f4601576918050d987a02e Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 16 Jan 2023 10:12:14 +0200 Subject: [PATCH 12/20] audit + abuse upgrade --- app/console | 2 +- composer.json | 6 ++-- composer.lock | 99 ++++++++++++++++++++++++--------------------------- 3 files changed, 50 insertions(+), 57 deletions(-) diff --git a/app/console b/app/console index af3d741ae8..5e2a40c1e3 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit af3d741ae8f02c2e16b8b4ea4664a3f8970290fd +Subproject commit 5e2a40c1e397bd341a432698c9d76a3f96315841 diff --git a/composer.json b/composer.json index 129075299b..439d0dc967 100644 --- a/composer.json +++ b/composer.json @@ -43,13 +43,13 @@ "ext-sockets": "*", "appwrite/php-clamav": "1.1.*", "appwrite/php-runtimes": "0.11.*", - "utopia-php/abuse": "0.16.*", + "utopia-php/abuse": "0.17.*", "utopia-php/analytics": "0.2.*", - "utopia-php/audit": "0.17.*", + "utopia-php/audit": "0.19.*", "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "dev-feat-technical-debt as 0.28.0", + "utopia-php/database": "0.29.0", "utopia-php/preloader": "0.2.*", "utopia-php/domains": "1.1.*", "utopia-php/framework": "0.25.*", diff --git a/composer.lock b/composer.lock index ce6b1fb837..2e997469b5 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": "2e56cb6c348ecdf295ddc3f45731dcdd", + "content-hash": "d96a1980b2fb23e083b89d50140b95a3", "packages": [ { "name": "adhocore/jwt", @@ -1808,25 +1808,26 @@ }, { "name": "utopia-php/abuse", - "version": "0.16.0", + "version": "0.17.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "6370d9150425460416583feba0990504ac789e98" + "reference": "3dee975b501767d49a9cf71dbdc4707bf979a91b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/6370d9150425460416583feba0990504ac789e98", - "reference": "6370d9150425460416583feba0990504ac789e98", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/3dee975b501767d49a9cf71dbdc4707bf979a91b", + "reference": "3dee975b501767d49a9cf71dbdc4707bf979a91b", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.28.*" + "utopia-php/database": "0.29.*" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.4", "vimeo/psalm": "4.0.1" }, @@ -1856,9 +1857,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.16.0" + "source": "https://github.com/utopia-php/abuse/tree/0.17.0" }, - "time": "2022-10-31T14:46:41+00:00" + "time": "2023-01-16T08:00:59+00:00" }, { "name": "utopia-php/analytics", @@ -1917,24 +1918,25 @@ }, { "name": "utopia-php/audit", - "version": "0.17.0", + "version": "0.19.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "455471bd4de8d74026809e843f8c9740eb32922c" + "reference": "fc552228ce7690854066d9ecea104a4d076117ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/455471bd4de8d74026809e843f8c9740eb32922c", - "reference": "455471bd4de8d74026809e843f8c9740eb32922c", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/fc552228ce7690854066d9ecea104a4d076117ae", + "reference": "fc552228ce7690854066d9ecea104a4d076117ae", "shasum": "" }, "require": { "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.28.*" + "utopia-php/database": "0.29.*" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" }, @@ -1958,9 +1960,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.17.0" + "source": "https://github.com/utopia-php/audit/tree/0.19.0" }, - "time": "2022-10-31T14:44:52+00:00" + "time": "2023-01-16T08:00:46+00:00" }, { "name": "utopia-php/cache", @@ -2117,16 +2119,16 @@ }, { "name": "utopia-php/database", - "version": "dev-feat-technical-debt", + "version": "0.29.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "08ee675eace0a4ab7ae779fec842a436e9cad3db" + "reference": "d4449bca6a6ca620588df6575beff35c7e8dcadd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/08ee675eace0a4ab7ae779fec842a436e9cad3db", - "reference": "08ee675eace0a4ab7ae779fec842a436e9cad3db", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d4449bca6a6ca620588df6575beff35c7e8dcadd", + "reference": "d4449bca6a6ca620588df6575beff35c7e8dcadd", "shasum": "" }, "require": { @@ -2166,9 +2168,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/feat-technical-debt" + "source": "https://github.com/utopia-php/database/tree/0.29.0" }, - "time": "2022-12-19T07:31:10+00:00" + "time": "2023-01-15T23:51:06+00:00" }, { "name": "utopia-php/domains", @@ -3049,30 +3051,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -3099,7 +3101,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -3115,7 +3117,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "matthiasmullie/minify", @@ -3701,16 +3703,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.22", + "version": "9.2.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" + "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", - "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", "shasum": "" }, "require": { @@ -3766,7 +3768,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" }, "funding": [ { @@ -3774,7 +3776,7 @@ "type": "github" } ], - "time": "2022-12-18T16:40:55+00:00" + "time": "2022-12-28T12:41:10+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5448,16 +5450,16 @@ }, { "name": "twig/twig", - "version": "v3.4.3", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58" + "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/c38fd6b0b7f370c198db91ffd02e23b517426b58", - "reference": "c38fd6b0b7f370c198db91ffd02e23b517426b58", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3ffcf4b7d890770466da3b2666f82ac054e7ec72", + "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72", "shasum": "" }, "require": { @@ -5472,7 +5474,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } }, "autoload": { @@ -5508,7 +5510,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.3" + "source": "https://github.com/twigphp/Twig/tree/v3.5.0" }, "funding": [ { @@ -5520,21 +5522,12 @@ "type": "tidelift" } ], - "time": "2022-09-28T08:42:51+00:00" - } - ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-feat-technical-debt", - "alias": "0.28.0", - "alias_normalized": "0.28.0.0" + "time": "2022-12-27T12:28:18+00:00" } ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { From f5cc2e43f4660e108fb5b028cc97e85747aca5de Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 16 Jan 2023 10:32:15 +0200 Subject: [PATCH 13/20] conflics --- app/init.php | 2 - composer.lock | 420 +++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 381 insertions(+), 41 deletions(-) diff --git a/app/init.php b/app/init.php index 9c0a9fa2d6..13d0e88d7d 100644 --- a/app/init.php +++ b/app/init.php @@ -52,13 +52,11 @@ use Utopia\Config\Config; use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\ID; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\DatetimeValidator; use Utopia\Database\Validator\Structure; use Utopia\Locale\Locale; -use Utopia\Logger\Logger; use Utopia\Messaging\Adapters\SMS\Mock; use Utopia\Messaging\Adapters\SMS\Msg91; use Utopia\Messaging\Adapters\SMS\Telesign; diff --git a/composer.lock b/composer.lock index d09230b398..b89d0dbb16 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": "dbc502462e4afa550b1a1bc3898020b3", + "content-hash": "f5b808dcd123e264f312c4c98789eeaf", "packages": [ { "name": "adhocore/jwt", @@ -345,6 +345,79 @@ }, "time": "2022-11-09T01:18:39+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.5", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-17T14:14:24+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.1", @@ -804,6 +877,61 @@ "abandoned": true, "time": "2020-12-26T17:45:17+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "1e0104b46f045868f11942aea058cd7186d6c303" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/1e0104b46f045868f11942aea058cd7186d6c303", + "reference": "1e0104b46f045868f11942aea058cd7186d6c303", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8.0", + "php": "^7.0|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0|^8.5|^9.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/1.6.0" + }, + "time": "2021-02-04T16:20:16+00:00" + }, { "name": "laravel/pint", "version": "v1.2.1", @@ -939,6 +1067,74 @@ }, "time": "2022-04-11T09:58:17+00:00" }, + { + "name": "mongodb/mongodb", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/mongodb/mongo-php-library.git", + "reference": "953dbc19443aa9314c44b7217a16873347e6840d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/953dbc19443aa9314c44b7217a16873347e6840d", + "reference": "953dbc19443aa9314c44b7217a16873347e6840d", + "shasum": "" + }, + "require": { + "ext-hash": "*", + "ext-json": "*", + "ext-mongodb": "^1.8.1", + "jean85/pretty-package-versions": "^1.2", + "php": "^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.19" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.5, <3.5.5", + "symfony/phpunit-bridge": "5.x-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "MongoDB\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Andreas Braun", + "email": "andreas.braun@mongodb.com" + }, + { + "name": "Jeremy Mikola", + "email": "jmikola@gmail.com" + } + ], + "description": "MongoDB driver library", + "homepage": "https://jira.mongodb.org/browse/PHPLIB", + "keywords": [ + "database", + "driver", + "mongodb", + "persistence" + ], + "support": { + "issues": "https://github.com/mongodb/mongo-php-library/issues", + "source": "https://github.com/mongodb/mongo-php-library/tree/1.8.0" + }, + "time": "2020-11-25T12:26:02+00:00" + }, { "name": "mustangostang/spyc", "version": "0.6.3", @@ -1528,26 +1724,110 @@ "time": "2022-11-25T10:21:52+00:00" }, { - "name": "utopia-php/abuse", - "version": "0.16.0", + "name": "symfony/polyfill-php80", + "version": "v1.27.0", "source": { "type": "git", - "url": "https://github.com/utopia-php/abuse.git", - "reference": "6370d9150425460416583feba0990504ac789e98" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/6370d9150425460416583feba0990504ac789e98", - "reference": "6370d9150425460416583feba0990504ac789e98", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "utopia-php/abuse", + "version": "0.17.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/abuse.git", + "reference": "3dee975b501767d49a9cf71dbdc4707bf979a91b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/3dee975b501767d49a9cf71dbdc4707bf979a91b", + "reference": "3dee975b501767d49a9cf71dbdc4707bf979a91b", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.28.*" + "utopia-php/database": "0.29.*" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.4", "vimeo/psalm": "4.0.1" }, @@ -1577,9 +1857,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.16.0" + "source": "https://github.com/utopia-php/abuse/tree/0.17.0" }, - "time": "2022-10-31T14:46:41+00:00" + "time": "2023-01-16T08:00:59+00:00" }, { "name": "utopia-php/analytics", @@ -1638,24 +1918,25 @@ }, { "name": "utopia-php/audit", - "version": "0.17.0", + "version": "0.19.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "455471bd4de8d74026809e843f8c9740eb32922c" + "reference": "fc552228ce7690854066d9ecea104a4d076117ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/455471bd4de8d74026809e843f8c9740eb32922c", - "reference": "455471bd4de8d74026809e843f8c9740eb32922c", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/fc552228ce7690854066d9ecea104a4d076117ae", + "reference": "fc552228ce7690854066d9ecea104a4d076117ae", "shasum": "" }, "require": { "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.28.*" + "utopia-php/database": "0.29.*" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" }, @@ -1679,9 +1960,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.17.0" + "source": "https://github.com/utopia-php/audit/tree/0.19.0" }, - "time": "2022-10-31T14:44:52+00:00" + "time": "2023-01-16T08:00:46+00:00" }, { "name": "utopia-php/cache", @@ -1838,22 +2119,23 @@ }, { "name": "utopia-php/database", - "version": "0.28.0", + "version": "0.29.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94" + "reference": "d4449bca6a6ca620588df6575beff35c7e8dcadd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/ef6506af1c09c22f5dc1e7859159d323f7fafa94", - "reference": "ef6506af1c09c22f5dc1e7859159d323f7fafa94", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d4449bca6a6ca620588df6575beff35c7e8dcadd", + "reference": "d4449bca6a6ca620588df6575beff35c7e8dcadd", "shasum": "" }, "require": { "php": ">=8.0", "utopia-php/cache": "0.8.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.*.*", + "utopia-php/mongo": "0.0.2" }, "require-dev": { "ext-mongodb": "*", @@ -1886,9 +2168,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.28.0" + "source": "https://github.com/utopia-php/database/tree/0.29.0" }, - "time": "2022-10-31T09:58:46+00:00" + "time": "2023-01-15T23:51:06+00:00" }, { "name": "utopia-php/domains", @@ -2211,6 +2493,66 @@ }, "time": "2022-09-29T11:22:48+00:00" }, + { + "name": "utopia-php/mongo", + "version": "0.0.2", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/mongo.git", + "reference": "62f9a9c0201af91b6d0dd4f0aa8a335ec9b56a1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/mongo/zipball/62f9a9c0201af91b6d0dd4f0aa8a335ec9b56a1e", + "reference": "62f9a9c0201af91b6d0dd4f0aa8a335ec9b56a1e", + "shasum": "" + }, + "require": { + "ext-mongodb": "*", + "mongodb/mongodb": "1.8.0", + "php": ">=8.0" + }, + "require-dev": { + "fakerphp/faker": "^1.14", + "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.8.*", + "phpunit/phpunit": "^9.4", + "swoole/ide-helper": "4.8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Mongo\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + }, + { + "name": "Wess", + "email": "wess@appwrite.io" + } + ], + "description": "A simple library to manage Mongo database", + "keywords": [ + "database", + "mongo", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/mongo/issues", + "source": "https://github.com/utopia-php/mongo/tree/0.0.2" + }, + "time": "2022-11-08T11:58:46+00:00" + }, { "name": "utopia-php/orchestration", "version": "0.6.0", @@ -2652,16 +2994,16 @@ }, { "name": "webonyx/graphql-php", - "version": "v14.11.8", + "version": "v14.11.9", "source": { "type": "git", "url": "https://github.com/webonyx/graphql-php.git", - "reference": "04a48693acd785330eefd3b0e4fa67df8dfee7c3" + "reference": "ff91c9f3cf241db702e30b2c42bcc0920e70ac70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/04a48693acd785330eefd3b0e4fa67df8dfee7c3", - "reference": "04a48693acd785330eefd3b0e4fa67df8dfee7c3", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/ff91c9f3cf241db702e30b2c42bcc0920e70ac70", + "reference": "ff91c9f3cf241db702e30b2c42bcc0920e70ac70", "shasum": "" }, "require": { @@ -2706,7 +3048,7 @@ ], "support": { "issues": "https://github.com/webonyx/graphql-php/issues", - "source": "https://github.com/webonyx/graphql-php/tree/v14.11.8" + "source": "https://github.com/webonyx/graphql-php/tree/v14.11.9" }, "funding": [ { @@ -2714,7 +3056,7 @@ "type": "open_collective" } ], - "time": "2022-09-21T15:35:03+00:00" + "time": "2023-01-06T12:12:50+00:00" } ], "packages-dev": [ @@ -2771,30 +3113,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -2821,7 +3163,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -2837,7 +3179,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "matthiasmullie/minify", @@ -5271,5 +5613,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 48e2bf1c3e7bcf05ec655ecc3c4364692eac6a12 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 16 Jan 2023 11:25:40 +0200 Subject: [PATCH 14/20] Helpers GraphQL --- tests/e2e/Services/GraphQL/AbuseTest.php | 6 +++--- tests/e2e/Services/GraphQL/AccountTest.php | 2 +- tests/e2e/Services/GraphQL/AuthTest.php | 6 +++--- tests/e2e/Services/GraphQL/BatchTest.php | 2 +- tests/e2e/Services/GraphQL/ContentTypeTest.php | 6 +++--- tests/e2e/Services/GraphQL/DatabaseClientTest.php | 6 +++--- tests/e2e/Services/GraphQL/DatabaseServerTest.php | 6 +++--- tests/e2e/Services/GraphQL/FunctionsClientTest.php | 4 ++-- tests/e2e/Services/GraphQL/FunctionsServerTest.php | 4 ++-- tests/e2e/Services/GraphQL/ScopeTest.php | 2 +- tests/e2e/Services/GraphQL/StorageClientTest.php | 6 +++--- tests/e2e/Services/GraphQL/StorageServerTest.php | 6 +++--- tests/e2e/Services/GraphQL/TeamsClientTest.php | 2 +- tests/e2e/Services/GraphQL/TeamsServerTest.php | 2 +- tests/e2e/Services/GraphQL/UsersTest.php | 2 +- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/e2e/Services/GraphQL/AbuseTest.php b/tests/e2e/Services/GraphQL/AbuseTest.php index 7009ded82e..48ee64d141 100644 --- a/tests/e2e/Services/GraphQL/AbuseTest.php +++ b/tests/e2e/Services/GraphQL/AbuseTest.php @@ -7,9 +7,9 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Utopia\App; -use Utopia\Database\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class AbuseTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/AccountTest.php b/tests/e2e/Services/GraphQL/AccountTest.php index 0d2ccf62cc..7fd70b5015 100644 --- a/tests/e2e/Services/GraphQL/AccountTest.php +++ b/tests/e2e/Services/GraphQL/AccountTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class AccountTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/AuthTest.php b/tests/e2e/Services/GraphQL/AuthTest.php index 8eb0937d80..c331fb8437 100644 --- a/tests/e2e/Services/GraphQL/AuthTest.php +++ b/tests/e2e/Services/GraphQL/AuthTest.php @@ -6,9 +6,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; -use Utopia\Database\Role; -use Utopia\Database\Permission; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Role; +use Utopia\Database\Helpers\Permission; class AuthTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/BatchTest.php b/tests/e2e/Services/GraphQL/BatchTest.php index dcb19e171a..7082d23677 100644 --- a/tests/e2e/Services/GraphQL/BatchTest.php +++ b/tests/e2e/Services/GraphQL/BatchTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class BatchTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/ContentTypeTest.php b/tests/e2e/Services/GraphQL/ContentTypeTest.php index 4a086feb2e..da885a2a83 100644 --- a/tests/e2e/Services/GraphQL/ContentTypeTest.php +++ b/tests/e2e/Services/GraphQL/ContentTypeTest.php @@ -7,9 +7,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class ContentTypeTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/DatabaseClientTest.php b/tests/e2e/Services/GraphQL/DatabaseClientTest.php index 9353e681b2..3853a3fc17 100644 --- a/tests/e2e/Services/GraphQL/DatabaseClientTest.php +++ b/tests/e2e/Services/GraphQL/DatabaseClientTest.php @@ -6,9 +6,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabaseClientTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/DatabaseServerTest.php b/tests/e2e/Services/GraphQL/DatabaseServerTest.php index fd5545e6cd..bc5bca60ca 100644 --- a/tests/e2e/Services/GraphQL/DatabaseServerTest.php +++ b/tests/e2e/Services/GraphQL/DatabaseServerTest.php @@ -7,9 +7,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class DatabaseServerTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/FunctionsClientTest.php b/tests/e2e/Services/GraphQL/FunctionsClientTest.php index 7bfcd66d4d..d5b50250d4 100644 --- a/tests/e2e/Services/GraphQL/FunctionsClientTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsClientTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Role; class FunctionsClientTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/FunctionsServerTest.php b/tests/e2e/Services/GraphQL/FunctionsServerTest.php index a51072bb92..75aa0d5d04 100644 --- a/tests/e2e/Services/GraphQL/FunctionsServerTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsServerTest.php @@ -7,8 +7,8 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Role; class FunctionsServerTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/ScopeTest.php b/tests/e2e/Services/GraphQL/ScopeTest.php index 03be6e3f70..a8b5b7cea4 100644 --- a/tests/e2e/Services/GraphQL/ScopeTest.php +++ b/tests/e2e/Services/GraphQL/ScopeTest.php @@ -7,7 +7,7 @@ use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class ScopeTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/StorageClientTest.php b/tests/e2e/Services/GraphQL/StorageClientTest.php index 55fc10b064..9896598c2d 100644 --- a/tests/e2e/Services/GraphQL/StorageClientTest.php +++ b/tests/e2e/Services/GraphQL/StorageClientTest.php @@ -7,9 +7,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class StorageClientTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/StorageServerTest.php b/tests/e2e/Services/GraphQL/StorageServerTest.php index fc6c23f12d..afaef08321 100644 --- a/tests/e2e/Services/GraphQL/StorageServerTest.php +++ b/tests/e2e/Services/GraphQL/StorageServerTest.php @@ -7,9 +7,9 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; -use Utopia\Database\Permission; -use Utopia\Database\Role; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; class StorageServerTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/TeamsClientTest.php b/tests/e2e/Services/GraphQL/TeamsClientTest.php index 6fb2ba87e6..87dbfcca00 100644 --- a/tests/e2e/Services/GraphQL/TeamsClientTest.php +++ b/tests/e2e/Services/GraphQL/TeamsClientTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class TeamsClientTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/TeamsServerTest.php b/tests/e2e/Services/GraphQL/TeamsServerTest.php index 118086834a..41577e6f42 100644 --- a/tests/e2e/Services/GraphQL/TeamsServerTest.php +++ b/tests/e2e/Services/GraphQL/TeamsServerTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; class TeamsServerTest extends Scope { diff --git a/tests/e2e/Services/GraphQL/UsersTest.php b/tests/e2e/Services/GraphQL/UsersTest.php index 99229b46d7..9bd503df0f 100644 --- a/tests/e2e/Services/GraphQL/UsersTest.php +++ b/tests/e2e/Services/GraphQL/UsersTest.php @@ -6,7 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\Database\ID; +use Utopia\Database\Helpers\ID; use Utopia\Database\Query; class UsersTest extends Scope From 625aa8ada63aa33d0933d17ed9dd733a21249b1b Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 16 Jan 2023 17:11:13 +0200 Subject: [PATCH 15/20] Some changes --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index b57e438056..885b41bd9a 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,6 @@ "utopia-php/logger": "0.3.*", "utopia-php/messaging": "0.1.*", "utopia-php/orchestration": "0.6.*", - "utopia-php/preloader": "0.2.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.13.*", "utopia-php/swoole": "0.5.*", From 265eea059912469cecdb6f9209451e790fcab1a0 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 14 Feb 2023 09:55:06 +0200 Subject: [PATCH 16/20] composer.lock --- composer.lock | 152 ++++++++++++++++++++++---------------------------- 1 file changed, 67 insertions(+), 85 deletions(-) diff --git a/composer.lock b/composer.lock index 54983ae536..73694e6b1e 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": "f5b808dcd123e264f312c4c98789eeaf", + "content-hash": "d57d56abd42a4f39c750d044dec6d212", "packages": [ { "name": "adhocore/jwt", @@ -2375,22 +2375,23 @@ }, { "name": "utopia-php/logger", - "version": "0.3.0", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/utopia-php/logger.git", - "reference": "079656cb5169ca9600861eda0b6819199e3d4a57" + "reference": "de623f1ec1c672c795d113dd25c5bf212f7ef4fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/logger/zipball/079656cb5169ca9600861eda0b6819199e3d4a57", - "reference": "079656cb5169ca9600861eda0b6819199e3d4a57", + "url": "https://api.github.com/repos/utopia-php/logger/zipball/de623f1ec1c672c795d113dd25c5bf212f7ef4fc", + "reference": "de623f1ec1c672c795d113dd25c5bf212f7ef4fc", "shasum": "" }, "require": { "php": ">=8.0" }, "require-dev": { + "phpstan/phpstan": "1.9.x-dev", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" }, @@ -2404,20 +2405,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - }, - { - "name": "Matej Bačo", - "email": "matej@appwrite.io" - }, - { - "name": "Christy Jacob", - "email": "christy@appwrite.io" - } - ], "description": "Utopia Logger library is simple and lite library for logging information, such as errors or warnings. This library is aiming to be as simple and easy to learn and use.", "keywords": [ "appsignal", @@ -2435,22 +2422,22 @@ ], "support": { "issues": "https://github.com/utopia-php/logger/issues", - "source": "https://github.com/utopia-php/logger/tree/0.3.0" + "source": "https://github.com/utopia-php/logger/tree/0.3.1" }, - "time": "2022-03-18T10:56:57+00:00" + "time": "2023-02-10T15:52:50+00:00" }, { "name": "utopia-php/messaging", - "version": "0.1.0", + "version": "0.1.1", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "501272fad666f06bec8f130076862e7981a73f8c" + "reference": "a75d66ddd59b834ab500a4878a2c084e6572604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/501272fad666f06bec8f130076862e7981a73f8c", - "reference": "501272fad666f06bec8f130076862e7981a73f8c", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/a75d66ddd59b834ab500a4878a2c084e6572604a", + "reference": "a75d66ddd59b834ab500a4878a2c084e6572604a", "shasum": "" }, "require": { @@ -2458,9 +2445,9 @@ "php": ">=8.0.0" }, "require-dev": { + "laravel/pint": "^1.2", "phpmailer/phpmailer": "6.6.*", - "phpunit/phpunit": "9.5.*", - "squizlabs/php_codesniffer": "^3.6" + "phpunit/phpunit": "9.5.*" }, "type": "library", "autoload": { @@ -2472,12 +2459,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Jake Barnby", - "email": "jake@appwrite.io" - } - ], "description": "A simple, light and advanced PHP messaging library", "keywords": [ "library", @@ -2489,9 +2470,9 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/0.1.0" + "source": "https://github.com/utopia-php/messaging/tree/0.1.1" }, - "time": "2022-09-29T11:22:48+00:00" + "time": "2023-02-07T05:42:46+00:00" }, { "name": "utopia-php/mongo", @@ -3062,16 +3043,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.29.2", + "version": "0.29.4", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "d5352e09ffe9442eb1bf7a5ddbaf2618df8ade6a" + "reference": "35ec927d1de1854bebe8894e16b1646c3fdd5567" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/d5352e09ffe9442eb1bf7a5ddbaf2618df8ade6a", - "reference": "d5352e09ffe9442eb1bf7a5ddbaf2618df8ade6a", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/35ec927d1de1854bebe8894e16b1646c3fdd5567", + "reference": "35ec927d1de1854bebe8894e16b1646c3fdd5567", "shasum": "" }, "require": { @@ -3107,9 +3088,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.29.2" + "source": "https://github.com/appwrite/sdk-generator/tree/0.29.4" }, - "time": "2022-12-28T06:52:51+00:00" + "time": "2023-02-03T05:44:59+00:00" }, { "name": "doctrine/instantiator", @@ -3366,16 +3347,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.15.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -3416,9 +3397,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "phar-io/manifest", @@ -3698,20 +3679,20 @@ }, { "name": "phpspec/prophecy", - "version": "v1.16.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359" + "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be8cac52a0827776ff9ccda8c381ac5b71aeb359", - "reference": "be8cac52a0827776ff9ccda8c381ac5b71aeb359", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/15873c65b207b07765dbc3c95d20fdf4a320cbe2", + "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", + "doctrine/instantiator": "^1.2 || ^2.0", "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", @@ -3719,6 +3700,7 @@ }, "require-dev": { "phpspec/phpspec": "^6.0 || ^7.0", + "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", @@ -3759,22 +3741,22 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.16.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.17.0" }, - "time": "2022-11-29T15:06:56+00:00" + "time": "2023-02-02T15:41:36+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.23", + "version": "9.2.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c" + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", - "reference": "9f1f0f9a2fbb680b26d1cf9b61b6eac43a6e4e9c", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", "shasum": "" }, "require": { @@ -3830,7 +3812,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.23" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" }, "funding": [ { @@ -3838,7 +3820,7 @@ "type": "github" } ], - "time": "2022-12-28T12:41:10+00:00" + "time": "2023-01-26T08:26:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4550,16 +4532,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -4601,7 +4583,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -4609,7 +4591,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -4923,16 +4905,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -4971,10 +4953,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -4982,7 +4964,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -5041,16 +5023,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -5085,7 +5067,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -5093,7 +5075,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -5512,16 +5494,16 @@ }, { "name": "twig/twig", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72" + "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3ffcf4b7d890770466da3b2666f82ac054e7ec72", - "reference": "3ffcf4b7d890770466da3b2666f82ac054e7ec72", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a6e0510cc793912b451fd40ab983a1d28f611c15", + "reference": "a6e0510cc793912b451fd40ab983a1d28f611c15", "shasum": "" }, "require": { @@ -5572,7 +5554,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.5.0" + "source": "https://github.com/twigphp/Twig/tree/v3.5.1" }, "funding": [ { @@ -5584,7 +5566,7 @@ "type": "tidelift" } ], - "time": "2022-12-27T12:28:18+00:00" + "time": "2023-02-08T07:49:20+00:00" } ], "aliases": [], From 94b311f14ffdd3c4da1cd4ee3ccb2a25f785d22b Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 14 Feb 2023 11:55:20 +0200 Subject: [PATCH 17/20] composer.json upgrades --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c4ea03d4a2..d4d7dc83bb 100644 --- a/composer.json +++ b/composer.json @@ -45,11 +45,11 @@ "appwrite/php-runtimes": "0.11.*", "utopia-php/abuse": "0.17.*", "utopia-php/analytics": "0.2.*", - "utopia-php/audit": "0.19.*", + "utopia-php/audit": "0.20.*", "utopia-php/cache": "0.8.*", "utopia-php/cli": "0.13.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.29.0", + "utopia-php/database": "0.30.*", "utopia-php/preloader": "0.2.*", "utopia-php/domains": "1.1.*", "utopia-php/framework": "0.26.*", From 161d3b485ecf55cb36dc29ddc3d6fd27b332b015 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 14 Feb 2023 11:58:52 +0200 Subject: [PATCH 18/20] composer.json upgrades --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d4d7dc83bb..1711407ece 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "ext-sockets": "*", "appwrite/php-clamav": "1.1.*", "appwrite/php-runtimes": "0.11.*", - "utopia-php/abuse": "0.17.*", + "utopia-php/abuse": "0.18.*", "utopia-php/analytics": "0.2.*", "utopia-php/audit": "0.20.*", "utopia-php/cache": "0.8.*", From 9b017140c7d0ea38b6ae7e32204a817a234112e2 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 14 Feb 2023 11:59:56 +0200 Subject: [PATCH 19/20] composer.lock --- composer.lock | 53 +++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/composer.lock b/composer.lock index 73694e6b1e..3d108c1d6b 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": "d57d56abd42a4f39c750d044dec6d212", + "content-hash": "ac80cafdd8c2c6deaec3dfe628084655", "packages": [ { "name": "adhocore/jwt", @@ -1808,26 +1808,27 @@ }, { "name": "utopia-php/abuse", - "version": "0.17.0", + "version": "0.18.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "3dee975b501767d49a9cf71dbdc4707bf979a91b" + "reference": "8496401234f73a49f8c4259d3e89ab4a7c1f9ecf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/3dee975b501767d49a9cf71dbdc4707bf979a91b", - "reference": "3dee975b501767d49a9cf71dbdc4707bf979a91b", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/8496401234f73a49f8c4259d3e89ab4a7c1f9ecf", + "reference": "8496401234f73a49f8c4259d3e89ab4a7c1f9ecf", "shasum": "" }, "require": { "ext-curl": "*", "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.29.*" + "utopia-php/database": "0.30.*" }, "require-dev": { "laravel/pint": "1.2.*", + "phpstan/phpstan": "1.9.x-dev", "phpunit/phpunit": "^9.4", "vimeo/psalm": "4.0.1" }, @@ -1841,12 +1842,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - } - ], "description": "A simple abuse library to manage application usage limits", "keywords": [ "Abuse", @@ -1857,9 +1852,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.17.0" + "source": "https://github.com/utopia-php/abuse/tree/0.18.0" }, - "time": "2023-01-16T08:00:59+00:00" + "time": "2023-02-14T09:56:04+00:00" }, { "name": "utopia-php/analytics", @@ -1918,25 +1913,26 @@ }, { "name": "utopia-php/audit", - "version": "0.19.0", + "version": "0.20.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "fc552228ce7690854066d9ecea104a4d076117ae" + "reference": "3fce3f4ad3ea9dfcb39b79668abd76331412a5ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/fc552228ce7690854066d9ecea104a4d076117ae", - "reference": "fc552228ce7690854066d9ecea104a4d076117ae", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/3fce3f4ad3ea9dfcb39b79668abd76331412a5ed", + "reference": "3fce3f4ad3ea9dfcb39b79668abd76331412a5ed", "shasum": "" }, "require": { "ext-pdo": "*", "php": ">=8.0", - "utopia-php/database": "0.29.*" + "utopia-php/database": "0.30.*" }, "require-dev": { "laravel/pint": "1.2.*", + "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" }, @@ -1960,9 +1956,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.19.0" + "source": "https://github.com/utopia-php/audit/tree/0.20.0" }, - "time": "2023-01-16T08:00:46+00:00" + "time": "2023-02-14T09:46:54+00:00" }, { "name": "utopia-php/cache", @@ -2119,16 +2115,16 @@ }, { "name": "utopia-php/database", - "version": "0.29.0", + "version": "0.30.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "d4449bca6a6ca620588df6575beff35c7e8dcadd" + "reference": "1cea72c1217357bf0747ae4f28ebef57e9dc0e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/d4449bca6a6ca620588df6575beff35c7e8dcadd", - "reference": "d4449bca6a6ca620588df6575beff35c7e8dcadd", + "url": "https://api.github.com/repos/utopia-php/database/zipball/1cea72c1217357bf0747ae4f28ebef57e9dc0e65", + "reference": "1cea72c1217357bf0747ae4f28ebef57e9dc0e65", "shasum": "" }, "require": { @@ -2139,13 +2135,12 @@ }, "require-dev": { "ext-mongodb": "*", - "ext-pdo": "*", "ext-redis": "*", "fakerphp/faker": "^1.14", "mongodb/mongodb": "1.8.0", "phpunit/phpunit": "^9.4", "swoole/ide-helper": "4.8.0", - "utopia-php/cli": "^0.11.0", + "utopia-php/cli": "^0.14.0", "vimeo/psalm": "4.0.1" }, "type": "library", @@ -2168,9 +2163,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.29.0" + "source": "https://github.com/utopia-php/database/tree/0.30.1" }, - "time": "2023-01-15T23:51:06+00:00" + "time": "2023-02-14T06:25:03+00:00" }, { "name": "utopia-php/domains", From b3e29c60861e957b4cb30e6252363a1c8b78f880 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 15 Feb 2023 17:39:15 +1300 Subject: [PATCH 20/20] Fix audit --- app/workers/audits.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/workers/audits.php b/app/workers/audits.php index b86649543b..b25430ec41 100644 --- a/app/workers/audits.php +++ b/app/workers/audits.php @@ -40,6 +40,7 @@ class AuditsV1 extends Worker $dbForProject = $this->getProjectDB($project->getId()); $audit = new Audit($dbForProject); $audit->log( + userInternalId: $user->getInternalId(), userId: $user->getId(), // Pass first, most verbose event pattern event: $event,