Update registry

This commit is contained in:
Jake Barnby 2025-09-03 03:41:53 +12:00
parent c9cf38d630
commit 3f0ad7f6c7
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
5 changed files with 56 additions and 39 deletions

View file

@ -3,9 +3,9 @@
namespace Appwrite\Platform\Modules\Databases\Services;
use Appwrite\Platform\Modules\Databases\Http\Init\Timeout;
use Appwrite\Platform\Modules\Databases\Services\Registry\Collections as CollectionsRegistry;
use Appwrite\Platform\Modules\Databases\Services\Registry\Databases as DatabasesRegistry;
use Appwrite\Platform\Modules\Databases\Services\Registry\Tables as TablesRegistry;
use Appwrite\Platform\Modules\Databases\Services\Registry\Legacy as LegacyRegistry;
use Appwrite\Platform\Modules\Databases\Services\Registry\TablesDB as TablesDBRegistry;
use Appwrite\Platform\Modules\Databases\Services\Registry\Transactions as TransactionsRegistry;
use Utopia\Platform\Service;
class Http extends Service
@ -17,9 +17,9 @@ class Http extends Service
$this->addAction(Timeout::getName(), new Timeout());
foreach ([
DatabasesRegistry::class,
CollectionsRegistry::class,
TablesRegistry::class,
LegacyRegistry::class,
TablesDBRegistry::class,
TransactionsRegistry::class,
] as $registrar) {
new $registrar($this);
}

View file

@ -1,31 +0,0 @@
<?php
namespace Appwrite\Platform\Modules\Databases\Services\Registry;
use Appwrite\Platform\Modules\Databases\Http\Databases\Create as CreateDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Delete as DeleteDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Get as GetDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Logs\XList as ListDatabaseLogs;
use Appwrite\Platform\Modules\Databases\Http\Databases\Update as UpdateDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\Get as GetDatabaseUsage;
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\XList as ListDatabaseUsage;
use Appwrite\Platform\Modules\Databases\Http\Databases\XList as ListDatabases;
use Utopia\Platform\Service;
/**
* Registers all HTTP actions related to database in the module.
*/
class Databases extends Base
{
public function register(Service $service): void
{
$service->addAction(CreateDatabase::getName(), new CreateDatabase());
$service->addAction(GetDatabase::getName(), new GetDatabase());
$service->addAction(UpdateDatabase::getName(), new UpdateDatabase());
$service->addAction(DeleteDatabase::getName(), new DeleteDatabase());
$service->addAction(ListDatabases::getName(), new ListDatabases());
$service->addAction(ListDatabaseLogs::getName(), new ListDatabaseLogs());
$service->addAction(GetDatabaseUsage::getName(), new GetDatabaseUsage());
$service->addAction(ListDatabaseUsage::getName(), new ListDatabaseUsage());
}
}

View file

@ -48,6 +48,14 @@ use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Logs\XList as
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Update as UpdateCollection;
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Usage\Get as GetCollectionUsage;
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\XList as ListCollections;
use Appwrite\Platform\Modules\Databases\Http\Databases\Create as CreateDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Delete as DeleteDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Get as GetDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Logs\XList as ListDatabaseLogs;
use Appwrite\Platform\Modules\Databases\Http\Databases\Update as UpdateDatabase;
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\Get as GetDatabaseUsage;
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\XList as ListDatabaseUsage;
use Appwrite\Platform\Modules\Databases\Http\Databases\XList as ListDatabases;
use Utopia\Platform\Service;
/**
@ -59,16 +67,29 @@ use Utopia\Platform\Service;
* - Attributes
* - Indexes
*/
class Collections extends Base
class Legacy extends Base
{
protected function register(Service $service): void
{
$this->registerDatabaseActions($service);
$this->registerCollectionActions($service);
$this->registerDocumentActions($service);
$this->registerAttributeActions($service);
$this->registerIndexActions($service);
}
public function registerDatabaseActions(Service $service): void
{
$service->addAction(CreateDatabase::getName(), new CreateDatabase());
$service->addAction(GetDatabase::getName(), new GetDatabase());
$service->addAction(UpdateDatabase::getName(), new UpdateDatabase());
$service->addAction(DeleteDatabase::getName(), new DeleteDatabase());
$service->addAction(ListDatabases::getName(), new ListDatabases());
$service->addAction(ListDatabaseLogs::getName(), new ListDatabaseLogs());
$service->addAction(GetDatabaseUsage::getName(), new GetDatabaseUsage());
$service->addAction(ListDatabaseUsage::getName(), new ListDatabaseUsage());
}
private function registerCollectionActions(Service $service): void
{
$service->addAction(CreateCollection::getName(), new CreateCollection());

View file

@ -66,7 +66,7 @@ use Utopia\Platform\Service;
* - Columns
* - Column-Indexes
*/
class Tables extends Base
class TablesDB extends Base
{
protected function register(Service $service): void
{

View file

@ -0,0 +1,27 @@
<?php
namespace Appwrite\Platform\Modules\Databases\Services\Registry;
use Appwrite\Platform\Modules\Databases\Http\Transactions\Create as CreateTransaction;
use Appwrite\Platform\Modules\Databases\Http\Transactions\Delete as DeleteTransaction;
use Appwrite\Platform\Modules\Databases\Http\Transactions\Get as GetTransaction;
use Appwrite\Platform\Modules\Databases\Http\Transactions\Update as UpdateTransaction;
use Appwrite\Platform\Modules\Databases\Http\Transactions\XList as ListTransactions;
use Appwrite\Platform\Modules\Databases\Http\Transactions\Operations\Create as CreateOperations;
use Utopia\Platform\Service;
/**
* Registers all HTTP actions related to transactions in the module.
*/
class Transactions extends Base
{
public function register(Service $service): void
{
$service->addAction(CreateTransaction::getName(), new CreateTransaction());
$service->addAction(GetTransaction::getName(), new GetTransaction());
$service->addAction(UpdateTransaction::getName(), new UpdateTransaction());
$service->addAction(DeleteTransaction::getName(), new DeleteTransaction());
$service->addAction(ListTransactions::getName(), new ListTransactions());
$service->addAction(CreateOperations::getName(), new CreateOperations());
}
}