diff --git a/.env b/.env index 9f9bf89bff..f0dc7746d4 100644 --- a/.env +++ b/.env @@ -50,9 +50,9 @@ _APP_DB_ROOT_PASS=rootsecretpassword _APP_DB_ADAPTER_DOCUMENTSDB=mongodb _APP_DB_HOST_DOCUMENTSDB=mongodb _APP_DB_PORT_DOCUMENTSDB=27017 -_APP_DB_ADAPTER_VECTORDB=postgresql -_APP_DB_HOST_VECTORDB=postgresql -_APP_DB_PORT_VECTORDB=5432 +_APP_DB_ADAPTER_VECTORSDBS=postgresql +_APP_DB_HOST_VECTORSDBS=postgresql +_APP_DB_PORT_VECTORSDBS=5432 _APP_EMBEDDING_MODELS=embeddinggemma _APP_EMBEDDING_ENDPOINT='http://ollama:11434/api/embed' _APP_STORAGE_DEVICE=Local diff --git a/app/config/collections.php b/app/config/collections.php index b30388997c..3af20ff2ac 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -4,7 +4,7 @@ $common = include __DIR__ . '/collections/common.php'; $projects = include __DIR__ . '/collections/projects.php'; $databases = include __DIR__ . '/collections/databases.php'; -$vectordb = include __DIR__ . '/collections/vectordb.php'; +$vectorsdb = include __DIR__ . '/collections/vectorsdb.php'; $platform = include __DIR__ . '/collections/platform.php'; $logs = include __DIR__ . '/collections/logs.php'; @@ -27,7 +27,7 @@ unset($common['files']); $collections = [ 'buckets' => $buckets, 'databases' => $databases, - 'vectordb' => $vectordb, + 'vectorsdb' => $vectorsdb, 'projects' => array_merge_recursive($projects, $common), 'console' => array_merge_recursive($platform, $common), 'logs' => $logs, diff --git a/app/config/collections/vectordb.php b/app/config/collections/vectorsdb.php similarity index 100% rename from app/config/collections/vectordb.php rename to app/config/collections/vectorsdb.php diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 689ecdc44b..2b0731b9de 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -48,7 +48,7 @@ function getDatabaseTransferResourceServices(string $databaseType) return match($databaseType) { DATABASE_TYPE_LEGACY, DATABASE_TYPE_TABLESDB => Transfer::GROUP_DATABASES_TABLES_DB, - DATABASE_TYPE_VECTORDB => Transfer::GROUP_DATABASES_VECTOR_DB + DATABASE_TYPE_VECTORSDBS => Transfer::GROUP_DATABASES_VECTOR_DB }; } diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 2480de5686..e9409f0591 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -77,13 +77,13 @@ Http::get('/v1/project/usage') METRIC_DATABASES_OPERATIONS_WRITES, METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB, METRIC_FILES_IMAGES_TRANSFORMED, - // VectorDB totals - METRIC_DATABASES_VECTORDB, - METRIC_COLLECTIONS_VECTORDB, - METRIC_DOCUMENTS_VECTORDB, - METRIC_DATABASES_STORAGE_VECTORDB, - METRIC_DATABASES_OPERATIONS_READS_VECTORDB, - METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB, + // VectorsDB totals + METRIC_DATABASES_VECTORSDBS, + METRIC_COLLECTIONS_VECTORSDBS, + METRIC_DOCUMENTS_VECTORSDBS, + METRIC_DATABASES_STORAGE_VECTORSDBS, + METRIC_DATABASES_OPERATIONS_READS_VECTORSDBS, + METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDBS, // Embeddings totals METRIC_EMBEDDINGS_TEXT, METRIC_EMBEDDINGS_TEXT_TOTAL_TOKENS, @@ -105,13 +105,13 @@ Http::get('/v1/project/usage') METRIC_DATABASES_OPERATIONS_WRITES, METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB, METRIC_FILES_IMAGES_TRANSFORMED, - // VectorDB time series - METRIC_DATABASES_VECTORDB, - METRIC_COLLECTIONS_VECTORDB, - METRIC_DOCUMENTS_VECTORDB, - METRIC_DATABASES_STORAGE_VECTORDB, - METRIC_DATABASES_OPERATIONS_READS_VECTORDB, - METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB, + // VectorsDB time series + METRIC_DATABASES_VECTORSDBS, + METRIC_COLLECTIONS_VECTORSDBS, + METRIC_DOCUMENTS_VECTORSDBS, + METRIC_DATABASES_STORAGE_VECTORSDBS, + METRIC_DATABASES_OPERATIONS_READS_VECTORSDBS, + METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDBS, // Embeddings time series METRIC_EMBEDDINGS_TEXT, METRIC_EMBEDDINGS_TEXT_TOTAL_TOKENS, @@ -404,12 +404,12 @@ Http::get('/v1/project/usage') 'databasesWritesTotal' => $total[METRIC_DATABASES_OPERATIONS_WRITES], 'documentsdbDatabasesReadsTotal' => $total[METRIC_DATABASES_OPERATIONS_READS_DOCUMENTSDB], 'documentsdbDatabasesWritesTotal' => $total[METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB], - 'vectordbDatabasesTotal' => $total[METRIC_DATABASES_VECTORDB] ?? 0, - 'vectordbCollectionsTotal' => $total[METRIC_COLLECTIONS_VECTORDB] ?? 0, - 'vectordbDocumentsTotal' => $total[METRIC_DOCUMENTS_VECTORDB] ?? 0, - 'vectordbDatabasesStorageTotal' => $total[METRIC_DATABASES_STORAGE_VECTORDB] ?? 0, - 'vectordbDatabasesReadsTotal' => $total[METRIC_DATABASES_OPERATIONS_READS_VECTORDB] ?? 0, - 'vectordbDatabasesWritesTotal' => $total[METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB] ?? 0, + 'vectorsdbDatabasesTotal' => $total[METRIC_DATABASES_VECTORSDBS] ?? 0, + 'vectorsdbCollectionsTotal' => $total[METRIC_COLLECTIONS_VECTORSDBS] ?? 0, + 'vectorsdbDocumentsTotal' => $total[METRIC_DOCUMENTS_VECTORSDBS] ?? 0, + 'vectorsdbDatabasesStorageTotal' => $total[METRIC_DATABASES_STORAGE_VECTORSDBS] ?? 0, + 'vectorsdbDatabasesReadsTotal' => $total[METRIC_DATABASES_OPERATIONS_READS_VECTORSDBS] ?? 0, + 'vectorsdbDatabasesWritesTotal' => $total[METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDBS] ?? 0, 'executionsBreakdown' => $executionsBreakdown, 'bucketsBreakdown' => $bucketsBreakdown, 'databasesReads' => $usage[METRIC_DATABASES_OPERATIONS_READS], @@ -417,12 +417,12 @@ Http::get('/v1/project/usage') 'documentsdbDatabasesReads' => $usage[METRIC_DATABASES_OPERATIONS_READS_DOCUMENTSDB], 'documentsdbDatabasesWrites' => $usage[METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB], 'documentsdbDatabasesStorage' => $usage[METRIC_DATABASES_STORAGE_DOCUMENTSDB], - 'vectordbDatabases' => $usage[METRIC_DATABASES_VECTORDB] ?? [], - 'vectordbCollections' => $usage[METRIC_COLLECTIONS_VECTORDB] ?? [], - 'vectordbDocuments' => $usage[METRIC_DOCUMENTS_VECTORDB] ?? [], - 'vectordbDatabasesStorage' => $usage[METRIC_DATABASES_STORAGE_VECTORDB] ?? [], - 'vectordbDatabasesReads' => $usage[METRIC_DATABASES_OPERATIONS_READS_VECTORDB] ?? [], - 'vectordbDatabasesWrites' => $usage[METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB] ?? [], + 'vectorsdbDatabases' => $usage[METRIC_DATABASES_VECTORSDBS] ?? [], + 'vectorsdbCollections' => $usage[METRIC_COLLECTIONS_VECTORSDBS] ?? [], + 'vectorsdbDocuments' => $usage[METRIC_DOCUMENTS_VECTORSDBS] ?? [], + 'vectorsdbDatabasesStorage' => $usage[METRIC_DATABASES_STORAGE_VECTORSDBS] ?? [], + 'vectorsdbDatabasesReads' => $usage[METRIC_DATABASES_OPERATIONS_READS_VECTORSDBS] ?? [], + 'vectorsdbDatabasesWrites' => $usage[METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDBS] ?? [], 'databasesStorageBreakdown' => $databasesStorageBreakdown, 'executionsMbSecondsBreakdown' => $executionsMbSecondsBreakdown, 'buildsMbSecondsBreakdown' => $buildsMbSecondsBreakdown, diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 641cf691ee..ca411011bf 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -466,7 +466,7 @@ Http::init() $path = $route->getMatchedPath(); $databaseType = match (true) { str_contains($path, '/documentsdb') => DATABASE_TYPE_DOCUMENTSDB, - str_contains($path, '/vectordb') => DATABASE_TYPE_VECTORDB, + str_contains($path, '/vectorsdb') => DATABASE_TYPE_VECTORSDBS, default => '', }; diff --git a/app/http.php b/app/http.php index 77f9bb2881..10390926d4 100644 --- a/app/http.php +++ b/app/http.php @@ -420,8 +420,8 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $tot $documentsSharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_DOCUMENTSDB_SHARED_TABLES_V1', '')); $documentsSharedTablesV2 = \array_diff($documentsSharedTables, $documentsSharedTablesV1); - $vectorSharedTables = \explode(',', System::getEnv('_APP_DATABASE_VECTORDB_SHARED_TABLES', '')); - $vectorSharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_VECTORDB_SHARED_TABLES_V1', '')); + $vectorSharedTables = \explode(',', System::getEnv('_APP_DATABASE_VECTORSDBS_SHARED_TABLES', '')); + $vectorSharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_VECTORSDBS_SHARED_TABLES_V1', '')); $vectorSharedTablesV2 = \array_diff($vectorSharedTables, $vectorSharedTablesV1); $cache = $app->getResource('cache'); diff --git a/app/init/constants.php b/app/init/constants.php index 9a31dfa4ce..a9febd2c32 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -303,20 +303,20 @@ const METRIC_DATABASE_ID_OPERATIONS_READS_DOCUMENTSDB = 'documentsdb.{databaseIn const METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB = 'documentsdb.databases.operations.writes'; const METRIC_DATABASE_ID_OPERATIONS_WRITES_DOCUMENTSDB = 'documentsdb.{databaseInternalId}.databases.operations.writes'; -// vectordb -const METRIC_DATABASES_VECTORDB = 'vectordb.databases'; -const METRIC_COLLECTIONS_VECTORDB = 'vectordb.collections'; -const METRIC_DATABASES_STORAGE_VECTORDB = 'vectordb.databases.storage'; -const METRIC_DATABASE_ID_COLLECTIONS_VECTORDB = 'vectordb.{databaseInternalId}.collections'; -const METRIC_DATABASE_ID_STORAGE_VECTORDB = 'vectordb.{databaseInternalId}.databases.storage'; -const METRIC_DOCUMENTS_VECTORDB = 'vectordb.documents'; -const METRIC_DATABASE_ID_DOCUMENTS_VECTORDB = 'vectordb.{databaseInternalId}.documents'; -const METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS_VECTORDB = 'vectordb.{databaseInternalId}.{collectionInternalId}.documents'; -const METRIC_DATABASE_ID_COLLECTION_ID_STORAGE_VECTORDB = 'vectordb.{databaseInternalId}.{collectionInternalId}.databases.storage'; -const METRIC_DATABASES_OPERATIONS_READS_VECTORDB = 'vectordb.databases.operations.reads'; -const METRIC_DATABASE_ID_OPERATIONS_READS_VECTORDB = 'vectordb.{databaseInternalId}.databases.operations.reads'; -const METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB = 'vectordb.databases.operations.writes'; -const METRIC_DATABASE_ID_OPERATIONS_WRITES_VECTORDB = 'vectordb.{databaseInternalId}.databases.operations.writes'; +// vectorsdb +const METRIC_DATABASES_VECTORSDBS = 'vectorsdb.databases'; +const METRIC_COLLECTIONS_VECTORSDBS = 'vectorsdb.collections'; +const METRIC_DATABASES_STORAGE_VECTORSDBS = 'vectorsdb.databases.storage'; +const METRIC_DATABASE_ID_COLLECTIONS_VECTORSDBS = 'vectorsdb.{databaseInternalId}.collections'; +const METRIC_DATABASE_ID_STORAGE_VECTORSDBS = 'vectorsdb.{databaseInternalId}.databases.storage'; +const METRIC_DOCUMENTS_VECTORSDBS = 'vectorsdb.documents'; +const METRIC_DATABASE_ID_DOCUMENTS_VECTORSDBS = 'vectorsdb.{databaseInternalId}.documents'; +const METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS_VECTORSDBS = 'vectorsdb.{databaseInternalId}.{collectionInternalId}.documents'; +const METRIC_DATABASE_ID_COLLECTION_ID_STORAGE_VECTORSDBS = 'vectorsdb.{databaseInternalId}.{collectionInternalId}.databases.storage'; +const METRIC_DATABASES_OPERATIONS_READS_VECTORSDBS = 'vectorsdb.databases.operations.reads'; +const METRIC_DATABASE_ID_OPERATIONS_READS_VECTORSDBS = 'vectorsdb.{databaseInternalId}.databases.operations.reads'; +const METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDBS = 'vectorsdb.databases.operations.writes'; +const METRIC_DATABASE_ID_OPERATIONS_WRITES_VECTORSDBS = 'vectorsdb.{databaseInternalId}.databases.operations.writes'; const METRIC_EMBEDDINGS_TEXT = 'embeddings.text'; const METRIC_EMBEDDINGS_MODEL_TEXT = 'embeddings.text.{embeddingModel}'; const METRIC_EMBEDDINGS_TEXT_TOTAL_ERROR = 'embeddings.text.totalErrors'; @@ -439,11 +439,11 @@ const PROJECT_STATUS_ACTIVE = 'active'; const DATABASE_TYPE_LEGACY = 'legacy'; const DATABASE_TYPE_TABLESDB = 'tablesdb'; const DATABASE_TYPE_DOCUMENTSDB = 'documentsdb'; -const DATABASE_TYPE_VECTORDB = 'vectordb'; +const DATABASE_TYPE_VECTORSDBS = 'vectorsdb'; // CSV import/export allowed database types const CSV_ALLOWED_DATABASE_TYPES = [ DATABASE_TYPE_LEGACY, DATABASE_TYPE_TABLESDB, - DATABASE_TYPE_VECTORDB + DATABASE_TYPE_VECTORSDBS ]; diff --git a/app/init/models.php b/app/init/models.php index 3d755ac58a..195a188c96 100644 --- a/app/init/models.php +++ b/app/init/models.php @@ -149,12 +149,12 @@ use Appwrite\Utopia\Response\Model\UsageSites; use Appwrite\Utopia\Response\Model\UsageStorage; use Appwrite\Utopia\Response\Model\UsageTable; use Appwrite\Utopia\Response\Model\UsageUsers; -use Appwrite\Utopia\Response\Model\UsageVectorDB; -use Appwrite\Utopia\Response\Model\UsageVectorDBs; +use Appwrite\Utopia\Response\Model\UsageVectorsDB; +use Appwrite\Utopia\Response\Model\UsageVectorsDBs; use Appwrite\Utopia\Response\Model\User; use Appwrite\Utopia\Response\Model\Variable; use Appwrite\Utopia\Response\Model\VcsContent; -use Appwrite\Utopia\Response\Model\VectorDBCollection; +use Appwrite\Utopia\Response\Model\VectorsDBCollection; use Appwrite\Utopia\Response\Model\Webhook; // General @@ -219,7 +219,7 @@ Response::setModel(new BaseList('Migrations List', Response::MODEL_MIGRATION_LIS Response::setModel(new BaseList('Migrations Firebase Projects List', Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, 'projects', Response::MODEL_MIGRATION_FIREBASE_PROJECT)); Response::setModel(new BaseList('Specifications List', Response::MODEL_SPECIFICATION_LIST, 'specifications', Response::MODEL_SPECIFICATION)); Response::setModel(new BaseList('VCS Content List', Response::MODEL_VCS_CONTENT_LIST, 'contents', Response::MODEL_VCS_CONTENT)); -Response::setModel(new BaseList('VectorDB Collections List', Response::MODEL_VECTORDB_COLLECTION_LIST, 'collections', Response::MODEL_VECTORDB_COLLECTION)); +Response::setModel(new BaseList('VectorsDB Collections List', Response::MODEL_VECTORSDBS_COLLECTION_LIST, 'collections', Response::MODEL_VECTORSDBS_COLLECTION)); Response::setModel(new BaseList('Embedding list', Response::MODEL_EMBEDDING_LIST, 'embeddings', Response::MODEL_EMBEDDING)); // Entities @@ -252,12 +252,12 @@ Response::setModel(new AttributeLongtext()); Response::setModel(new UsageDocumentsDBs()); Response::setModel(new UsageDocumentsDB()); -// VectorDB API Models -Response::setModel(new VectorDBCollection()); +// VectorsDB API Models +Response::setModel(new VectorsDBCollection()); Response::setModel(new AttributeObject()); Response::setModel(new AttributeVector()); -Response::setModel(new UsageVectorDBs()); -Response::setModel(new UsageVectorDB()); +Response::setModel(new UsageVectorsDBs()); +Response::setModel(new UsageVectorsDB()); // Table API Models Response::setModel(new Table()); diff --git a/app/init/registers.php b/app/init/registers.php index 50ae954dd9..64443f590a 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -176,10 +176,10 @@ $register->set('pools', function () { 'pass' => System::getEnv('_APP_DB_PASS', ''), 'path' => System::getEnv('_APP_DB_SCHEMA', ''), ]); - $fallbackForVectorDB = 'db_main=' . AppwriteURL::unparse([ - 'scheme' => System::getEnv('_APP_DB_ADAPTER_VECTORDB', 'postgresql'), - 'host' => System::getEnv('_APP_DB_HOST_VECTORDB', 'postgresql'), - 'port' => System::getEnv('_APP_DB_PORT_VECTORDB', '5432'), + $fallbackForVectorsDB = 'db_main=' . AppwriteURL::unparse([ + 'scheme' => System::getEnv('_APP_DB_ADAPTER_VECTORSDBS', 'postgresql'), + 'host' => System::getEnv('_APP_DB_HOST_VECTORSDBS', 'postgresql'), + 'port' => System::getEnv('_APP_DB_PORT_VECTORSDBS', '5432'), 'user' => System::getEnv('_APP_DB_USER', ''), 'pass' => System::getEnv('_APP_DB_PASS', ''), 'path' => System::getEnv('_APP_DB_SCHEMA', ''), @@ -204,9 +204,9 @@ $register->set('pools', function () { 'multiple' => true, 'schemes' => ['mongodb'], ], - 'vectordb' => [ + 'vectorsdb' => [ 'type' => 'database', - 'dsns' => System::getEnv('_APP_CONNECTIONS_DATABASE_VECTORDB', $fallbackForVectorDB), + 'dsns' => System::getEnv('_APP_CONNECTIONS_DATABASE_VECTORSDBS', $fallbackForVectorsDB), 'multiple' => true, 'schemes' => ['postgresql'], ], diff --git a/app/init/resources.php b/app/init/resources.php index 807f86ced6..7c235246d9 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -681,7 +681,7 @@ Http::setResource('dbForProject', function (Group $pools, Database $dbForPlatfor $path = $request->getURI(); $databaseType = match (true) { str_contains($path, '/documentsdb') => DATABASE_TYPE_DOCUMENTSDB, - str_contains($path, '/vectordb') => DATABASE_TYPE_VECTORDB, + str_contains($path, '/vectorsdb') => DATABASE_TYPE_VECTORSDBS, default => '', }; diff --git a/docker-compose.yml b/docker-compose.yml index bf85a0d0c2..c9e20348c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -153,12 +153,12 @@ services: - _APP_DB_SCHEMA - _APP_DB_USER - _APP_DB_PASS - - _APP_DB_ADAPTER_VECTORDB - - _APP_DB_HOST_VECTORDB - - _APP_DB_PORT_VECTORDB - - _APP_DB_SCHEMA_VECTORDB - - _APP_DB_USER_VECTORDB - - _APP_DB_PASS_VECTORDB + - _APP_DB_ADAPTER_VECTORSDBS + - _APP_DB_HOST_VECTORSDBS + - _APP_DB_PORT_VECTORSDBS + - _APP_DB_SCHEMA_VECTORSDBS + - _APP_DB_USER_VECTORSDBS + - _APP_DB_PASS_VECTORSDBS - _APP_SMTP_HOST - _APP_SMTP_PORT - _APP_SMTP_SECURE @@ -312,12 +312,12 @@ services: - _APP_DB_SCHEMA - _APP_DB_USER - _APP_DB_PASS - - _APP_DB_ADAPTER_VECTORDB - - _APP_DB_HOST_VECTORDB - - _APP_DB_PORT_VECTORDB - - _APP_DB_SCHEMA_VECTORDB - - _APP_DB_USER_VECTORDB - - _APP_DB_PASS_VECTORDB + - _APP_DB_ADAPTER_VECTORSDBS + - _APP_DB_HOST_VECTORSDBS + - _APP_DB_PORT_VECTORSDBS + - _APP_DB_SCHEMA_VECTORSDBS + - _APP_DB_USER_VECTORSDBS + - _APP_DB_PASS_VECTORSDBS - _APP_USAGE_STATS - _APP_LOGGING_CONFIG - _APP_LOGGING_CONFIG_REALTIME @@ -492,12 +492,12 @@ services: - _APP_DB_SCHEMA - _APP_DB_USER - _APP_DB_PASS - - _APP_DB_ADAPTER_VECTORDB - - _APP_DB_HOST_VECTORDB - - _APP_DB_PORT_VECTORDB - - _APP_DB_SCHEMA_VECTORDB - - _APP_DB_USER_VECTORDB - - _APP_DB_PASS_VECTORDB + - _APP_DB_ADAPTER_VECTORSDBS + - _APP_DB_HOST_VECTORSDBS + - _APP_DB_PORT_VECTORSDBS + - _APP_DB_SCHEMA_VECTORSDBS + - _APP_DB_USER_VECTORSDBS + - _APP_DB_PASS_VECTORSDBS - _APP_LOGGING_CONFIG - _APP_WORKERS_NUM - _APP_QUEUE_NAME diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 3d76d58dd2..bf6339f8a0 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -534,7 +534,7 @@ class Event $parsed = self::parseEventPattern($pattern); // to switch the resource types from databases to the required prefix // eg; all databases events get fired with databases. prefix which mainly depicts legacy type - // so a projection from databases to the actual prefix(documentsdb, vectordb,etc) + // so a projection from databases to the actual prefix(documentsdb, vectorsdb,etc) if ((str_contains($pattern, 'databases.') && $database && $database->getAttribute('type') !== 'legacy')) { $parsed = self::getDatabaseTypeEvents($database, $parsed); } @@ -746,8 +746,8 @@ class Event ]; break; case 'documentsdb': - case 'vectordb': - // sending the type itself(eg: documentsdb, vectordb) + case 'vectorsdb': + // sending the type itself(eg: documentsdb, vectorsdb) $eventMap = [ 'databases' => $database->getAttribute('type') ]; diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index 62cd66de6d..7a2b6fe19a 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -493,7 +493,7 @@ class Realtime extends MessagingAdapter case 'databases': case 'tablesdb': case 'documentsdb': - case 'vectordb': + case 'vectorsdb': $resource = $parts[4] ?? ''; if (in_array($resource, ['columns', 'attributes', 'indexes'])) { $channels[] = 'console'; @@ -627,7 +627,7 @@ class Realtime extends MessagingAdapter break; case 'documentsdb': - case 'vectordb': + case 'vectorsdb': $channels[] = 'documents'; $channels[] = "{$basePrefix}.{$databaseId}.collections.{$resourceId}.documents"; $channels[] = "{$basePrefix}.{$databaseId}.collections.{$resourceId}.documents.{$payloadId}"; diff --git a/src/Appwrite/Platform/Modules/Databases/Constants.php b/src/Appwrite/Platform/Modules/Databases/Constants.php index 6ed373ef77..5f76e26d07 100644 --- a/src/Appwrite/Platform/Modules/Databases/Constants.php +++ b/src/Appwrite/Platform/Modules/Databases/Constants.php @@ -25,7 +25,7 @@ const COLLECTIONS = 'collection'; const TABLESDB = 'tablesdb'; const DOCUMENTSDB = 'documentsdb'; -const VECTORDB = 'vectordb'; +const VECTORSDB = 'vectorsdb'; const MIN_VECTOR_DIMENSION = 1; const MAX_VECTOR_DIMENSION = 16000; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php index 3411e06b27..b048d5b384 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Action.php @@ -25,8 +25,8 @@ class Action extends AppwriteAction if (\str_contains($path, '/documentsdb')) { $this->context = DATABASE_TYPE_DOCUMENTSDB; } - if (\str_contains($path, '/vectordb')) { - $this->context = DATABASE_TYPE_VECTORDB; + if (\str_contains($path, '/vectorsdb')) { + $this->context = DATABASE_TYPE_VECTORSDBS; } return parent::setHttpPath($path); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php index 528fd92027..d4d24b697e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Action.php @@ -27,8 +27,8 @@ abstract class Action extends UtopiaAction if (\str_contains($path, '/tablesdb')) { $this->context = TABLES; $this->databaseType = TABLESDB; - } elseif (\str_contains($path, '/vectordb')) { - $this->databaseType = VECTORDB; + } elseif (\str_contains($path, '/vectorsdb')) { + $this->databaseType = VECTORSDB; } return parent::setHttpPath($path); } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php index c09fc7f2e8..4ffddf5258 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php @@ -30,8 +30,8 @@ abstract class Action extends DatabasesAction $this->context = ROWS; } elseif (str_contains($path, '/documentsdb/')) { $this->databaseType = DATABASE_TYPE_DOCUMENTSDB; - } elseif (str_contains($path, '/vectordb/')) { - $this->databaseType = DATABASE_TYPE_VECTORDB; + } elseif (str_contains($path, '/vectorsdb/')) { + $this->databaseType = DATABASE_TYPE_VECTORSDBS; } $contextId = '$' . $this->getCollectionsEventsContext() . 'Id'; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php index aee2177e90..6815522f44 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Create.php @@ -61,13 +61,13 @@ class Create extends Action $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_DOCUMENTSDB_SHARED_TABLES', '')); $sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_DOCUMENTSDB_SHARED_TABLES_V1', '')); break; - case VECTORDB: - $databases = Config::getParam('pools-vectordb', []); - $databaseKeys = System::getEnv('_APP_DATABASE_VECTORDB_KEYS', ''); - $databaseOverride = System::getEnv('_APP_DATABASE_VECTORDB_OVERRIDE'); - $dbScheme = System::getEnv('_APP_DB_HOST_VECTORDB', 'postgresql'); - $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_VECTORDB_SHARED_TABLES', '')); - $sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_VECTORDB_SHARED_TABLES_V1', '')); + case VECTORSDB: + $databases = Config::getParam('pools-vectorsdb', []); + $databaseKeys = System::getEnv('_APP_DATABASE_VECTORSDBS_KEYS', ''); + $databaseOverride = System::getEnv('_APP_DATABASE_VECTORSDBS_OVERRIDE'); + $dbScheme = System::getEnv('_APP_DB_HOST_VECTORSDBS', 'postgresql'); + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_VECTORSDBS_SHARED_TABLES', '')); + $sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_VECTORSDBS_SHARED_TABLES_V1', '')); break; default: // legacy/tablesdb @@ -138,7 +138,7 @@ class Create extends Action protected function getDatabaseCollection() { return match ($this->getDatabaseType()) { - 'vectordb' => (Config::getParam('collections', [])['vectordb'] ?? [])['collections'] ?? [], + 'vectorsdb' => (Config::getParam('collections', [])['vectorsdb'] ?? [])['collections'] ?? [], default => (Config::getParam('collections', [])['databases'] ?? [])['collections'] ?? [], }; } diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Action.php index 033446a00c..06f94822be 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Action.php @@ -46,9 +46,9 @@ abstract class Action extends DatabasesAction $this->context = COLLECTIONS; $this->databaseType = DOCUMENTSDB; break; - case str_contains($path, '/vectordb'): + case str_contains($path, '/vectorsdb'): $this->context = COLLECTIONS; - $this->databaseType = VECTORDB; + $this->databaseType = VECTORSDB; break; } return parent::setHttpPath($path); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php index 72ba56aff8..0d7e89f72f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php @@ -169,7 +169,7 @@ class Update extends Action $databaseDoc = null; switch ($this->getDatabaseType()) { case DATABASE_TYPE_DOCUMENTSDB: - case DATABASE_TYPE_VECTORDB: + case DATABASE_TYPE_VECTORSDBS: $databaseDoc = $authorization->skip(fn () => $dbForProject->findOne('databases', [ Query::equal('$sequence', [$firstOperation['databaseInternalId']]) ])); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php index 16e10f7530..e22bec125f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/Get.php @@ -32,7 +32,7 @@ class Get extends Action { $this->databaseType = match (true) { str_contains($path, '/documentsdb') => DATABASE_TYPE_DOCUMENTSDB, - str_contains($path, '/vectordb') => DATABASE_TYPE_VECTORDB, + str_contains($path, '/vectorsdb') => DATABASE_TYPE_VECTORSDBS, default => DATABASE_TYPE_LEGACY, }; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php index fd4440d7b3..b525e606aa 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Usage/XList.php @@ -30,7 +30,7 @@ class XList extends Action { $this->databaseType = match (true) { str_contains($path, '/documentsdb') => DATABASE_TYPE_DOCUMENTSDB, - str_contains($path, '/vectordb') => DATABASE_TYPE_VECTORDB, + str_contains($path, '/vectorsdb') => DATABASE_TYPE_VECTORSDBS, default => DATABASE_TYPE_LEGACY, }; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php similarity index 96% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php index bde56aa6fb..1b65912366 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb/:databaseId/collections') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections') ->desc('Create collection') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].create') @@ -53,10 +53,10 @@ class Create extends CollectionAction ->label('audits.event', 'collection.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}') ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'collections', name: 'createCollection', - description: '/docs/references/vectordb/create-collection.md', + description: '/docs/references/vectorsdb/create-collection.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( @@ -119,7 +119,7 @@ class Create extends CollectionAction $attributes = []; $indexes = []; - $collections = (Config::getParam('collections', [])['vectordb'] ?? [])['collections'] ?? []; + $collections = (Config::getParam('collections', [])['vectorsdb'] ?? [])['collections'] ?? []; foreach ($collections['defaultAttributes'] as $attribute) { if ($attribute['$id'] === 'embeddings') { $attribute['size'] = $dimension; diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Delete.php similarity index 83% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Delete.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Delete.php index c671bcc27c..61ceadd640 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Delete.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId') ->desc('Delete collection') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') @@ -36,10 +36,10 @@ class Delete extends CollectionDelete ->label('audits.event', 'collection.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'collections', name: 'deleteCollection', - description: '/docs/references/vectordb/delete-collection.md', + description: '/docs/references/vectorsdb/delete-collection.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Delete.php similarity index 89% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Delete.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Delete.php index d63382b40e..c8726711f2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Delete.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents') ->desc('Delete documents') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -40,10 +40,10 @@ class Delete extends DocumentsDelete ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'deleteDocuments', - description: '/docs/references/vectordb/delete-documents.md', + description: '/docs/references/vectorsdb/delete-documents.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Update.php similarity index 89% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Update.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Update.php index 65a692d45d..b469316405 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Update.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents') ->desc('Update documents') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -41,10 +41,10 @@ class Update extends DocumentsUpdate ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'updateDocuments', - description: '/docs/references/vectordb/update-documents.md', + description: '/docs/references/vectorsdb/update-documents.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Upsert.php similarity index 88% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Upsert.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Upsert.php index 7a72b5372f..bb96a9675c 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Bulk/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Bulk/Upsert.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents') ->desc('Upsert documents') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -41,10 +41,10 @@ class Upsert extends DocumentsUpsert ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'upsertDocuments', - description: '/docs/references/vectordb/upsert-documents.md', + description: '/docs/references/vectorsdb/upsert-documents.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Create.php similarity index 92% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Create.php index 42571b9f65..79ae43d087 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents') ->desc('Create document') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -50,11 +50,11 @@ class Create extends DocumentCreate ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'createDocument', desc: 'Create document', - description: '/docs/references/vectordb/create-document.md', + description: '/docs/references/vectorsdb/create-document.md', auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( @@ -72,11 +72,11 @@ class Create extends DocumentCreate ] ), new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'createDocuments', desc: 'Create documents', - description: '/docs/references/vectordb/create-documents.md', + description: '/docs/references/vectorsdb/create-documents.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Delete.php similarity index 89% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Delete.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Delete.php index 0b5d5cac16..d7d7cdee00 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Delete.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId') ->desc('Delete document') ->groups(['api', 'database']) ->label('scope', 'documents.write') @@ -45,10 +45,10 @@ class Delete extends DocumentDelete ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'deleteDocument', - description: '/docs/references/vectordb/delete-document.md', + description: '/docs/references/vectorsdb/delete-document.md', auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Get.php similarity index 88% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Get.php index bfa122c5fd..9a50d9a1b9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId') ->desc('Get document') ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'getDocument', - description: '/docs/references/vectordb/get-document.md', + description: '/docs/references/vectorsdb/get-document.md', auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Logs/XList.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Logs/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Logs/XList.php index 3808b5a575..dea9d30119 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Logs/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId/logs') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId/logs') ->desc('List document logs') ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'logs', name: 'listDocumentLogs', - description: '/docs/references/vectordb/get-document-logs.md', + description: '/docs/references/vectorsdb/get-document-logs.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Update.php similarity index 90% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Update.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Update.php index 51be0ebf1d..c26b2a70b9 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Update.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId') ->desc('Update document') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') @@ -42,10 +42,10 @@ class Update extends DocumentUpdate ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'updateDocument', - description: '/docs/references/vectordb/update-document.md', + description: '/docs/references/vectorsdb/update-document.md', auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Upsert.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Upsert.php similarity index 90% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Upsert.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Upsert.php index 2369761ee2..df4cb0f191 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/Upsert.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/Upsert.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId') ->desc('Upsert a document') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert') @@ -44,10 +44,10 @@ class Upsert extends DocumentUpsert ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'upsertDocument', - description: '/docs/references/vectordb/upsert-document.md', + description: '/docs/references/vectorsdb/upsert-document.md', auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/XList.php similarity index 89% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/XList.php index a58df90068..d4a5d06269 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Documents/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Documents/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents') ->desc('List documents') ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'listDocuments', - description: '/docs/references/vectordb/list-documents.md', + description: '/docs/references/vectorsdb/list-documents.md', auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Get.php similarity index 80% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Get.php index 9f29d6b775..257acedc18 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId') ->desc('Get collection') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'collections', name: 'getCollection', - description: '/docs/references/vectordb/get-collection.md', + description: '/docs/references/vectorsdb/get-collection.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Create.php similarity index 90% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Create.php index ed0b465a71..a535dd5724 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes') ->desc('Create index') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].tables.[tableId].indexes.[indexId].create') @@ -42,10 +42,10 @@ class Create extends IndexCreate ->label('audits.event', 'index.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.tableId}') ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'createIndex', - description: '/docs/references/vectordb/create-index.md', + description: '/docs/references/vectorsdb/create-index.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Delete.php similarity index 88% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Delete.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Delete.php index 2145410810..5c7fc47ee0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Delete.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes/:key') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes/:key') ->desc('Delete index') ->groups(['api', 'database']) ->label('scope', 'collections.write') @@ -41,10 +41,10 @@ class Delete extends IndexDelete ->label('audits.event', 'index.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'deleteIndex', // getName needs to be different from parent action to avoid conflict in path name - description: '/docs/references/vectordb/delete-index.md', + description: '/docs/references/vectorsdb/delete-index.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Get.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Get.php index 1959b23dfe..4cf646acba 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes/:key') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes/:key') ->desc('Get index') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'getIndex', // getName needs to be different from parent action to avoid conflict in path name - description: '/docs/references/vectordb/get-index.md', + description: '/docs/references/vectorsdb/get-index.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/XList.php similarity index 88% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/XList.php index cf2565e217..acc46fb570 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Indexes/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes') ->desc('List indexes') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'listIndexes', // getName needs to be different from parent action to avoid conflict in path name - description: '/docs/references/vectordb/list-indexes.md', + description: '/docs/references/vectorsdb/list-indexes.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Logs/XList.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Logs/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Logs/XList.php index 483f26cad0..cd0e45eb47 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Logs/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/logs') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/logs') ->desc('List collection logs') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'listCollectionLogs', - description: '/docs/references/vectordb/get-collection-logs.md', + description: '/docs/references/vectorsdb/get-collection-logs.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Update.php similarity index 92% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Update.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Update.php index a3b59cd3a9..05ad9535a5 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Update.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId') ->desc('Update collection') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') @@ -45,15 +45,15 @@ class Update extends CollectionAction ->label('audits.event', 'collection.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'collections', name: 'updateCollection', - description: '/docs/references/vectordb/update-collection.md', + description: '/docs/references/vectorsdb/update-collection.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( code: SwooleResponse::STATUS_CODE_OK, - model: UtopiaResponse::MODEL_VECTORDB_COLLECTION, + model: UtopiaResponse::MODEL_VECTORSDBS_COLLECTION, ) ], contentType: ContentType::JSON diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Usage/Get.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Usage/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Usage/Get.php index 1b6cb27db4..951280aac1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Usage/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/usage') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/usage') ->desc('Get collection usage stats') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: null, name: 'getCollectionUsage', - description: '/docs/references/vectordb/get-collection-usage.md', + description: '/docs/references/vectorsdb/get-collection-usage.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/XList.php similarity index 86% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/XList.php index e6c3ecf92b..93a20452bd 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/collections') + ->setHttpPath('/v1/vectorsdb/:databaseId/collections') ->desc('List collections') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'collections', name: 'listCollections', - description: '/docs/references/vectordb/list-collections.md', + description: '/docs/references/vectorsdb/list-collections.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Create.php similarity index 88% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Create.php index 3776cf5222..cc2914fc10 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb') + ->setHttpPath('/v1/vectorsdb') ->desc('Create database') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].create') @@ -33,10 +33,10 @@ class Create extends DatabaseCreate ->label('audits.event', 'database.create') ->label('audits.resource', 'database/{response.$id}') ->label('sdk', new Method( - namespace: 'vectorDB', - group: 'vectordb', + namespace: 'vectorsDB', + group: 'vectorsdb', name: 'create', - description: '/docs/references/vectordb/create.md', + description: '/docs/references/vectorsdb/create.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Delete.php similarity index 84% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Delete.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Delete.php index 768e1d78f2..2109e2bd68 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Delete.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/vectordb/:databaseId') + ->setHttpPath('/v1/vectorsdb/:databaseId') ->desc('Delete database') ->groups(['api', 'database', 'schema']) ->label('scope', 'databases.write') @@ -31,10 +31,10 @@ class Delete extends DatabaseDelete ->label('audits.event', 'database.delete') ->label('audits.resource', 'database/{request.databaseId}') ->label('sdk', new Method( - namespace: 'vectorDB', - group: 'vectordb', + namespace: 'vectorsDB', + group: 'vectorsdb', name: 'delete', - description: '/docs/references/vectordb/delete.md', + description: '/docs/references/vectorsdb/delete.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Embeddings/Text/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Embeddings/Text/Create.php similarity index 95% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Embeddings/Text/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Embeddings/Text/Create.php index e3a5e1aa32..cd60ddf2cb 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Embeddings/Text/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Embeddings/Text/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb/embeddings/text') + ->setHttpPath('/v1/vectorsdb/embeddings/text') ->desc('Create Text Embeddings') ->groups(['api', 'database']) ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_EMBEDDINGS_TEXT) ->label('audits.event', 'embedding.create') - ->label('audits.resource', 'vectordb/embeddings/text') + ->label('audits.resource', 'vectorsdb/embeddings/text') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: $this->getSdkGroup(), name: 'createTextEmbeddings', desc: 'Create Text Embedding', - description: '/docs/references/vectordb/create-document.md', + description: '/docs/references/vectorsdb/create-document.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Get.php similarity index 81% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Get.php index 8530d89844..a79632b105 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId') + ->setHttpPath('/v1/vectorsdb/:databaseId') ->desc('Get database') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', - group: 'vectordb', + namespace: 'vectorsDB', + group: 'vectorsdb', name: 'get', - description: '/docs/references/vectordb/get.md', + description: '/docs/references/vectorsdb/get.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Logs/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Logs/XList.php similarity index 87% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Logs/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Logs/XList.php index 3961c5dfbe..d8c1df5f04 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Logs/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/logs') + ->setHttpPath('/v1/vectorsdb/:databaseId/logs') ->desc('List database logs') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'logs', name: 'listDatabaseLogs', - description: '/docs/references/vectordb/get-logs.md', + description: '/docs/references/vectorsdb/get-logs.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Create.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Create.php index b47dfe4f58..cb67d3f7f1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb/transactions') + ->setHttpPath('/v1/vectorsdb/transactions') ->desc('Create transaction') ->groups(['api', 'database', 'transactions']) ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'transactions', name: 'createTransaction', - description: '/docs/references/vectordb/create-transaction.md', + description: '/docs/references/vectorsdb/create-transaction.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Delete.php similarity index 84% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Delete.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Delete.php index d99b827f2b..0ac2caecba 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Delete.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/vectordb/transactions/:transactionId') + ->setHttpPath('/v1/vectorsdb/transactions/:transactionId') ->desc('Delete transaction') ->groups(['api', 'database', 'transactions']) ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'transactions', name: 'deleteTransaction', - description: '/docs/references/vectordb/delete-transaction.md', + description: '/docs/references/vectorsdb/delete-transaction.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Get.php similarity index 83% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Get.php index 5c755577d8..fa4cc86cdd 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/transactions/:transactionId') + ->setHttpPath('/v1/vectorsdb/transactions/:transactionId') ->desc('Get transaction') ->groups(['api', 'database', 'transactions']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'transactions', name: 'getTransaction', - description: '/docs/references/vectordb/get-transaction.md', + description: '/docs/references/vectorsdb/get-transaction.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Operations/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Operations/Create.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Operations/Create.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Operations/Create.php index 12ee7d5695..830c0c3fe1 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Operations/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Operations/Create.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/vectordb/transactions/:transactionId/operations') + ->setHttpPath('/v1/vectorsdb/transactions/:transactionId/operations') ->desc('Create operations') ->groups(['api', 'database', 'transactions']) ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'transactions', name: 'createOperations', - description: '/docs/references/vectordb/create-operations.md', + description: '/docs/references/vectorsdb/create-operations.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Update.php similarity index 87% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Update.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Update.php index 09429325ee..babfe11a3a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/Update.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH) - ->setHttpPath('/v1/vectordb/transactions/:transactionId') + ->setHttpPath('/v1/vectorsdb/transactions/:transactionId') ->desc('Update transaction') ->groups(['api', 'database', 'transactions']) ->label('scope', 'documents.write') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'transactions', name: 'updateTransaction', - description: '/docs/references/vectordb/update-transaction.md', + description: '/docs/references/vectorsdb/update-transaction.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/XList.php similarity index 85% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/XList.php index 72f7158707..fb95667ffb 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Transactions/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/transactions') + ->setHttpPath('/v1/vectorsdb/transactions') ->desc('List transactions') ->groups(['api', 'database', 'transactions']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: 'transactions', name: 'listTransactions', - description: '/docs/references/vectordb/list-transactions.md', + description: '/docs/references/vectorsdb/list-transactions.md', auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Update.php similarity index 86% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Update.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Update.php index b60de00349..0b10d6d98b 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Update.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_PUT) - ->setHttpPath('/v1/vectordb/:databaseId') + ->setHttpPath('/v1/vectorsdb/:databaseId') ->desc('Update database') ->groups(['api', 'database', 'schema']) ->label('scope', 'databases.write') @@ -33,10 +33,10 @@ class Update extends DatabaseUpdate ->label('audits.event', 'database.update') ->label('audits.resource', 'database/{response.$id}') ->label('sdk', new Method( - namespace: 'vectorDB', - group: 'vectordb', + namespace: 'vectorsDB', + group: 'vectorsdb', name: 'update', - description: '/docs/references/vectordb/update.md', + description: '/docs/references/vectorsdb/update.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Usage/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Usage/Get.php similarity index 80% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Usage/Get.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Usage/Get.php index 7ff4ec4933..ac9e85c530 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Usage/Get.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/:databaseId/usage') - ->desc('Get VectorDB usage stats') + ->setHttpPath('/v1/vectorsdb/:databaseId/usage') + ->desc('Get VectorsDB usage stats') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: null, name: 'getUsage', - description: '/docs/references/vectordb/get-database-usage.md', + description: '/docs/references/vectorsdb/get-database-usage.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( code: SwooleResponse::STATUS_CODE_OK, - model: UtopiaResponse::MODEL_USAGE_VECTORDB, + model: UtopiaResponse::MODEL_USAGE_VECTORSDBS, ) ], contentType: ContentType::JSON, diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Usage/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Usage/XList.php similarity index 79% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Usage/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Usage/XList.php index 97fbb00bd6..4a81053078 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Usage/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb/usage') - ->desc('Get VectorDB usage stats') + ->setHttpPath('/v1/vectorsdb/usage') + ->desc('Get VectorsDB usage stats') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', [ new Method( - namespace: 'vectorDB', + namespace: 'vectorsDB', group: null, name: 'listUsage', - description: '/docs/references/vectordb/list-usage.md', + description: '/docs/references/vectorsdb/list-usage.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( code: SwooleResponse::STATUS_CODE_OK, - model: UtopiaResponse::MODEL_USAGE_VECTORDBS, + model: UtopiaResponse::MODEL_USAGE_VECTORSDBSS, ) ], contentType: ContentType::JSON diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/XList.php similarity index 87% rename from src/Appwrite/Platform/Modules/Databases/Http/VectorDB/XList.php rename to src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/XList.php index 90b0e170de..e18a89c6a4 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/XList.php @@ -1,6 +1,6 @@ setHttpMethod(self::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/vectordb') + ->setHttpPath('/v1/vectorsdb') ->desc('List databases') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('sdk', new Method( - namespace: 'vectorDB', - group: 'vectordb', + namespace: 'vectorsDB', + group: 'vectorsdb', name: 'list', - description: '/docs/references/vectordb/list.md', + description: '/docs/references/vectorsdb/list.md', auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Http.php b/src/Appwrite/Platform/Modules/Databases/Services/Http.php index 682472128e..5146382b56 100644 --- a/src/Appwrite/Platform/Modules/Databases/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Databases/Services/Http.php @@ -6,7 +6,7 @@ use Appwrite\Platform\Modules\Databases\Http\Init\Timeout; use Appwrite\Platform\Modules\Databases\Services\Registry\DocumentsDB as DocumentsDBRegistry; use Appwrite\Platform\Modules\Databases\Services\Registry\Legacy as LegacyRegistry; use Appwrite\Platform\Modules\Databases\Services\Registry\TablesDB as TablesDBDBRegistry; -use Appwrite\Platform\Modules\Databases\Services\Registry\VectorDB as VectorDBRegistry; +use Appwrite\Platform\Modules\Databases\Services\Registry\VectorsDB as VectorsDBRegistry; use Utopia\Platform\Service; class Http extends Service @@ -21,7 +21,7 @@ class Http extends Service LegacyRegistry::class, TablesDBDBRegistry::class, DocumentsDBRegistry::class, - VectorDBRegistry::class + VectorsDBRegistry::class ] as $registrar) { new $registrar($this); } diff --git a/src/Appwrite/Platform/Modules/Databases/Services/Registry/VectorDB.php b/src/Appwrite/Platform/Modules/Databases/Services/Registry/VectorsDB.php similarity index 53% rename from src/Appwrite/Platform/Modules/Databases/Services/Registry/VectorDB.php rename to src/Appwrite/Platform/Modules/Databases/Services/Registry/VectorsDB.php index f6fa731558..9496b1781a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Services/Registry/VectorDB.php +++ b/src/Appwrite/Platform/Modules/Databases/Services/Registry/VectorsDB.php @@ -2,43 +2,43 @@ namespace Appwrite\Platform\Modules\Databases\Services\Registry; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Create as CreateCollection; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Delete as DeleteCollection; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk\Delete as DeleteDocuments; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk\Update as UpdateDocuments; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk\Upsert as UpsertDocuments; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Create as CreateDocument; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Delete as DeleteDocument; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Get as GetDocument; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Update as UpdateDocument; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Upsert as UpsertDocument; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\XList as ListDocuments; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Get as GetCollection; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\Create as CreateIndex; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\Delete as DeleteIndex; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\Get as GetIndex; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\XList as ListIndexes; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Logs\XList as ListCollectionLogs; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Update as UpdateCollection; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Usage\Get as GetCollectionUsage; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\XList as ListCollections; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Create as CreateVectorDatabase; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Delete as DeleteVectorDatabase; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Embeddings\Text\Create as CreateTextEmbeddings; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Get as GetVectorDatabase; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Create as CreateTransaction; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Delete as DeleteTransaction; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Get as GetTransaction; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Operations\Create as CreateOperations; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Update as UpdateTransaction; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\XList as ListTransactions; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Update as UpdateVectorDatabase; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage\Get as GetVectorDatabaseUsage; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage\XList as ListVectorDatabaseUsage; -use Appwrite\Platform\Modules\Databases\Http\VectorDB\XList as ListVectorDatabases; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Create as CreateCollection; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Delete as DeleteCollection; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk\Delete as DeleteDocuments; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk\Update as UpdateDocuments; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk\Upsert as UpsertDocuments; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Create as CreateDocument; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Delete as DeleteDocument; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Get as GetDocument; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Update as UpdateDocument; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Upsert as UpsertDocument; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\XList as ListDocuments; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Get as GetCollection; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\Create as CreateIndex; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\Delete as DeleteIndex; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\Get as GetIndex; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\XList as ListIndexes; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Logs\XList as ListCollectionLogs; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Update as UpdateCollection; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Usage\Get as GetCollectionUsage; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\XList as ListCollections; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Create as CreateVectorDatabase; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Delete as DeleteVectorDatabase; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Embeddings\Text\Create as CreateTextEmbeddings; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Get as GetVectorDatabase; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Create as CreateTransaction; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Delete as DeleteTransaction; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Get as GetTransaction; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Operations\Create as CreateOperations; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Update as UpdateTransaction; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\XList as ListTransactions; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Update as UpdateVectorDatabase; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage\Get as GetVectorDatabaseUsage; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage\XList as ListVectorDatabaseUsage; +use Appwrite\Platform\Modules\Databases\Http\VectorsDB\XList as ListVectorDatabases; use Utopia\Platform\Service; -class VectorDB extends Base +class VectorsDB extends Base { protected function register(Service $service): void { diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index 45f50eea07..69f641beee 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -565,7 +565,7 @@ class Deletes extends Action 'database' => $document->getAttribute('database') ]), ...$dbForProject->find('databases', [ - Query::equal('type', [DATABASE_TYPE_DOCUMENTSDB, DATABASE_TYPE_VECTORDB]), + Query::equal('type', [DATABASE_TYPE_DOCUMENTSDB, DATABASE_TYPE_VECTORSDBS]), Query::limit(5000), ]), ]; diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 5bd029b0f3..81a0c9ce22 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -323,8 +323,8 @@ class Migrations extends Action METRIC_DATABASES_OPERATIONS_WRITES, METRIC_DATABASES_OPERATIONS_READS_DOCUMENTSDB, METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB, - METRIC_DATABASES_OPERATIONS_READS_VECTORDB, - METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB, + METRIC_DATABASES_OPERATIONS_READS_VECTORSDBS, + METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDBS, METRIC_NETWORK_REQUESTS, METRIC_NETWORK_INBOUND, METRIC_NETWORK_OUTBOUND, diff --git a/src/Appwrite/Platform/Workers/StatsResources.php b/src/Appwrite/Platform/Workers/StatsResources.php index 8213032a5f..fa0cbf27bd 100644 --- a/src/Appwrite/Platform/Workers/StatsResources.php +++ b/src/Appwrite/Platform/Workers/StatsResources.php @@ -112,7 +112,7 @@ class StatsResources extends Action $databases = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_LEGACY, DATABASE_TYPE_TABLESDB])]); $documentsdb = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_DOCUMENTSDB])]); - $vectordb = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_VECTORDB])]); + $vectorsdb = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_VECTORSDBS])]); $buckets = $dbForProject->count('buckets'); $users = $dbForProject->count('users'); @@ -148,7 +148,7 @@ class StatsResources extends Action $metrics = [ METRIC_DATABASES => $databases, METRIC_DATABASES_DOCUMENTSDB => $documentsdb, - METRIC_DATABASES_VECTORDB => $vectordb, + METRIC_DATABASES_VECTORSDBS => $vectorsdb, METRIC_BUCKETS => $buckets, METRIC_USERS => $users, METRIC_FUNCTIONS => $functions, @@ -256,7 +256,7 @@ class StatsResources extends Action $totalDocumentsDocumentsdb = 0; $totalDatabaseStorageDocumentsdb = 0; - // vectordb + // vectorsdb $totalCollectionsVectordb = 0; $totalDocumentsVectordb = 0; $totalDatabaseStorageVectordb = 0; @@ -282,7 +282,7 @@ class StatsResources extends Action $totalDocumentsDocumentsdb += $documents; $totalCollectionsDocumentsdb += $collections; break; - case DATABASE_TYPE_VECTORDB: + case DATABASE_TYPE_VECTORSDBS: $totalDatabaseStorageVectordb += $storage; $totalDocumentsVectordb += $documents; $totalCollectionsVectordb += $collections; @@ -302,9 +302,9 @@ class StatsResources extends Action $this->createStatsDocuments($region, METRIC_DOCUMENTS_DOCUMENTSDB, $totalDocumentsDocumentsdb); $this->createStatsDocuments($region, METRIC_DATABASES_STORAGE_DOCUMENTSDB, $totalDatabaseStorageDocumentsdb); - $this->createStatsDocuments($region, METRIC_COLLECTIONS_VECTORDB, $totalCollectionsVectordb); - $this->createStatsDocuments($region, METRIC_DOCUMENTS_VECTORDB, $totalDocumentsVectordb); - $this->createStatsDocuments($region, METRIC_DATABASES_STORAGE_VECTORDB, $totalDatabaseStorageVectordb); + $this->createStatsDocuments($region, METRIC_COLLECTIONS_VECTORSDBS, $totalCollectionsVectordb); + $this->createStatsDocuments($region, METRIC_DOCUMENTS_VECTORSDBS, $totalDocumentsVectordb); + $this->createStatsDocuments($region, METRIC_DATABASES_STORAGE_VECTORSDBS, $totalDatabaseStorageVectordb); } protected function countForCollections(Database $dbForProject, Database $dbForDatabases, Document $database, string $region): array { diff --git a/src/Appwrite/Platform/Workers/StatsUsage.php b/src/Appwrite/Platform/Workers/StatsUsage.php index 682ba1d006..987c6abd6e 100644 --- a/src/Appwrite/Platform/Workers/StatsUsage.php +++ b/src/Appwrite/Platform/Workers/StatsUsage.php @@ -48,7 +48,7 @@ class StatsUsage extends Action protected array $skipBaseMetrics = [ METRIC_DATABASES => true, METRIC_DATABASES_DOCUMENTSDB => true, - METRIC_DATABASES_VECTORDB => true, + METRIC_DATABASES_VECTORSDBS => true, METRIC_BUCKETS => true, METRIC_USERS => true, METRIC_FUNCTIONS => true, @@ -70,11 +70,11 @@ class StatsUsage extends Action METRIC_DOCUMENTS => true, METRIC_COLLECTIONS_DOCUMENTSDB => true, METRIC_DOCUMENTS_DOCUMENTSDB => true, - METRIC_COLLECTIONS_VECTORDB => true, - METRIC_DOCUMENTS_VECTORDB => true, + METRIC_COLLECTIONS_VECTORSDBS => true, + METRIC_DOCUMENTS_VECTORSDBS => true, METRIC_DATABASES_STORAGE => true, METRIC_DATABASES_STORAGE_DOCUMENTSDB => true, - METRIC_DATABASES_STORAGE_VECTORDB => true, + METRIC_DATABASES_STORAGE_VECTORSDBS => true, ]; /** diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index d10e9446d1..542a39c789 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -367,7 +367,7 @@ abstract class Format } } break; - case 'vectorDB': + case 'vectorsDB': switch ($method) { case 'getUsage': case 'listUsage': @@ -380,7 +380,7 @@ abstract class Format case 'createIndex': switch ($param) { case 'type': - return 'VectorDBIndexType'; + return 'VectorsDBIndexType'; case 'orders': return 'OrderBy'; } @@ -669,7 +669,7 @@ abstract class Format break; case 'databases': case 'documentsDB': - case 'vectorDB': + case 'vectorsDB': switch ($method) { case 'getUsage': case 'listUsage': diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index dee33b27c5..cd434ce438 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -34,8 +34,8 @@ class Response extends SwooleResponse public const MODEL_USAGE_DATABASE = 'usageDatabase'; public const MODEL_USAGE_DOCUMENTSDBS = 'usageDocumentsDBs'; public const MODEL_USAGE_DOCUMENTSDB = 'usageDocumentsDB'; - public const MODEL_USAGE_VECTORDBS = 'usageVectorDBs'; - public const MODEL_USAGE_VECTORDB = 'usageVectorDB'; + public const MODEL_USAGE_VECTORSDBSS = 'usageVectorsDBs'; + public const MODEL_USAGE_VECTORSDBS = 'usageVectorsDB'; public const MODEL_USAGE_TABLE = 'usageTable'; public const MODEL_USAGE_COLLECTION = 'usageCollection'; public const MODEL_USAGE_USERS = 'usageUsers'; @@ -52,8 +52,8 @@ class Response extends SwooleResponse public const MODEL_DATABASE_LIST = 'databaseList'; public const MODEL_COLLECTION = 'collection'; public const MODEL_COLLECTION_LIST = 'collectionList'; - public const MODEL_VECTORDB_COLLECTION = 'vectordbCollection'; - public const MODEL_VECTORDB_COLLECTION_LIST = 'vectordbCollectionList'; + public const MODEL_VECTORSDBS_COLLECTION = 'vectorsdbCollection'; + public const MODEL_VECTORSDBS_COLLECTION_LIST = 'vectorsdbCollectionList'; public const MODEL_EMBEDDING = 'embedding'; public const MODEL_EMBEDDING_LIST = 'embeddingList'; public const MODEL_TABLE = 'table'; diff --git a/src/Appwrite/Utopia/Response/Model/UsageProject.php b/src/Appwrite/Utopia/Response/Model/UsageProject.php index 66628a7b13..e00c4bc1dc 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageProject.php +++ b/src/Appwrite/Utopia/Response/Model/UsageProject.php @@ -267,81 +267,81 @@ class UsageProject extends Model 'default' => 0, 'example' => 0, ]) - // VectorDB aggregates - ->addRule('vectordbDatabasesTotal', [ + // VectorsDB aggregates + ->addRule('vectorsdbDatabasesTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated number of VectorDB databases.', + 'description' => 'Total aggregated number of VectorsDB databases.', 'default' => 0, 'example' => 0, ]) - ->addRule('vectordbCollectionsTotal', [ + ->addRule('vectorsdbCollectionsTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated number of VectorDB collections.', + 'description' => 'Total aggregated number of VectorsDB collections.', 'default' => 0, 'example' => 0, ]) - ->addRule('vectordbDocumentsTotal', [ + ->addRule('vectorsdbDocumentsTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated number of VectorDB documents.', + 'description' => 'Total aggregated number of VectorsDB documents.', 'default' => 0, 'example' => 0, ]) - ->addRule('vectordbDatabasesStorageTotal', [ + ->addRule('vectorsdbDatabasesStorageTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated VectorDB storage (bytes).', + 'description' => 'Total aggregated VectorsDB storage (bytes).', 'default' => 0, 'example' => 0, ]) - ->addRule('vectordbDatabasesReadsTotal', [ + ->addRule('vectorsdbDatabasesReadsTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated number of VectorDB reads.', + 'description' => 'Total aggregated number of VectorsDB reads.', 'default' => 0, 'example' => 0, ]) - ->addRule('vectordbDatabasesWritesTotal', [ + ->addRule('vectorsdbDatabasesWritesTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated number of VectorDB writes.', + 'description' => 'Total aggregated number of VectorsDB writes.', 'default' => 0, 'example' => 0, ]) - ->addRule('vectordbDatabases', [ + ->addRule('vectorsdbDatabases', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated VectorDB databases per period.', + 'description' => 'Aggregated VectorsDB databases per period.', 'default' => [], 'example' => [], 'array' => true ]) - ->addRule('vectordbCollections', [ + ->addRule('vectorsdbCollections', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated VectorDB collections per period.', + 'description' => 'Aggregated VectorsDB collections per period.', 'default' => [], 'example' => [], 'array' => true ]) - ->addRule('vectordbDocuments', [ + ->addRule('vectorsdbDocuments', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated VectorDB documents per period.', + 'description' => 'Aggregated VectorsDB documents per period.', 'default' => [], 'example' => [], 'array' => true ]) - ->addRule('vectordbDatabasesStorage', [ + ->addRule('vectorsdbDatabasesStorage', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated VectorDB storage per period.', + 'description' => 'Aggregated VectorsDB storage per period.', 'default' => [], 'example' => [], 'array' => true ]) - ->addRule('vectordbDatabasesReads', [ + ->addRule('vectorsdbDatabasesReads', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated VectorDB reads per period.', + 'description' => 'Aggregated VectorsDB reads per period.', 'default' => [], 'example' => [], 'array' => true ]) - ->addRule('vectordbDatabasesWrites', [ + ->addRule('vectorsdbDatabasesWrites', [ 'type' => Response::MODEL_METRIC, - 'description' => 'Aggregated VectorDB writes per period.', + 'description' => 'Aggregated VectorsDB writes per period.', 'default' => [], 'example' => [], 'array' => true diff --git a/src/Appwrite/Utopia/Response/Model/UsageVectorDB.php b/src/Appwrite/Utopia/Response/Model/UsageVectorsDB.php similarity index 96% rename from src/Appwrite/Utopia/Response/Model/UsageVectorDB.php rename to src/Appwrite/Utopia/Response/Model/UsageVectorsDB.php index a90f593c7e..d1cb5b047c 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageVectorDB.php +++ b/src/Appwrite/Utopia/Response/Model/UsageVectorsDB.php @@ -5,7 +5,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; -class UsageVectorDB extends Model +class UsageVectorsDB extends Model { public function __construct() { @@ -86,11 +86,11 @@ class UsageVectorDB extends Model public function getName(): string { - return 'UsageVectorDB'; + return 'UsageVectorsDB'; } public function getType(): string { - return Response::MODEL_USAGE_VECTORDB; + return Response::MODEL_USAGE_VECTORSDBS; } } diff --git a/src/Appwrite/Utopia/Response/Model/UsageVectorDBs.php b/src/Appwrite/Utopia/Response/Model/UsageVectorsDBs.php similarity index 96% rename from src/Appwrite/Utopia/Response/Model/UsageVectorDBs.php rename to src/Appwrite/Utopia/Response/Model/UsageVectorsDBs.php index da63120c5c..b6e926993c 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageVectorDBs.php +++ b/src/Appwrite/Utopia/Response/Model/UsageVectorsDBs.php @@ -5,7 +5,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; -class UsageVectorDBs extends Model +class UsageVectorsDBs extends Model { public function __construct() { @@ -18,7 +18,7 @@ class UsageVectorDBs extends Model ]) ->addRule('databasesTotal', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Total aggregated number of VectorDB databases.', + 'description' => 'Total aggregated number of VectorsDB databases.', 'default' => 0, 'example' => 0, ]) @@ -99,11 +99,11 @@ class UsageVectorDBs extends Model public function getName(): string { - return 'UsageVectorDBs'; + return 'UsageVectorsDBs'; } public function getType(): string { - return Response::MODEL_USAGE_VECTORDBS; + return Response::MODEL_USAGE_VECTORSDBSS; } } diff --git a/src/Appwrite/Utopia/Response/Model/VectorDBCollection.php b/src/Appwrite/Utopia/Response/Model/VectorsDBCollection.php similarity index 86% rename from src/Appwrite/Utopia/Response/Model/VectorDBCollection.php rename to src/Appwrite/Utopia/Response/Model/VectorsDBCollection.php index ccf609132d..002cf2aff9 100644 --- a/src/Appwrite/Utopia/Response/Model/VectorDBCollection.php +++ b/src/Appwrite/Utopia/Response/Model/VectorsDBCollection.php @@ -4,7 +4,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; -class VectorDBCollection extends Collection +class VectorsDBCollection extends Collection { public function __construct() { @@ -31,11 +31,11 @@ class VectorDBCollection extends Collection public function getName(): string { - return 'VectorDB Collection'; + return 'VectorsDB Collection'; } public function getType(): string { - return Response::MODEL_VECTORDB_COLLECTION; + return Response::MODEL_VECTORSDBS_COLLECTION; } } diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 35afe23320..e5e40e67f2 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -1150,7 +1150,7 @@ class UsageTest extends Scope } #[Depends('testDocumentsDBStats')] - public function testPrepareVectorDBStats(array $data): array + public function testPrepareVectorsDBStats(array $data): array { $documentsTotal = 0; $collectionsTotal = 0; @@ -1159,11 +1159,11 @@ class UsageTest extends Scope $requestsTotal = $data['requestsTotal']; for ($i = 0; $i < self::CREATE; $i++) { - $name = uniqid() . ' vectordb'; + $name = uniqid() . ' vectorsdb'; $response = $this->client->call( Client::METHOD_POST, - '/vectordb', + '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] @@ -1185,7 +1185,7 @@ class UsageTest extends Scope if ($i < (self::CREATE / 2)) { $response = $this->client->call( Client::METHOD_DELETE, - '/vectordb/' . $vectordbId, + '/vectorsdb/' . $vectordbId, array_merge([ 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), @@ -1203,7 +1203,7 @@ class UsageTest extends Scope $response = $this->client->call( Client::METHOD_POST, - '/vectordb/' . $vectordbId . '/collections', + '/vectorsdb/' . $vectordbId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] @@ -1233,7 +1233,7 @@ class UsageTest extends Scope if ($i < (self::CREATE / 2)) { $response = $this->client->call( Client::METHOD_DELETE, - '/vectordb/' . $vectordbId . '/collections/' . $collectionId, + '/vectorsdb/' . $vectordbId . '/collections/' . $collectionId, array_merge([ 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), @@ -1249,7 +1249,7 @@ class UsageTest extends Scope for ($i = 0; $i < self::CREATE; $i++) { $response = $this->client->call( Client::METHOD_POST, - '/vectordb/' . $vectordbId . '/collections/' . $collectionId . '/documents', + '/vectorsdb/' . $vectordbId . '/collections/' . $collectionId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] @@ -1276,7 +1276,7 @@ class UsageTest extends Scope if ($i < (self::CREATE / 2)) { $response = $this->client->call( Client::METHOD_DELETE, - '/vectordb/' . $vectordbId . '/collections/' . $collectionId . '/documents/' . $documentId, + '/vectorsdb/' . $vectordbId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), @@ -1300,9 +1300,9 @@ class UsageTest extends Scope ]); } - #[Depends('testPrepareVectorDBStats')] + #[Depends('testPrepareVectorsDBStats')] #[Retry(count: 1)] - public function testVectorDBStats(array $data): array + public function testVectorsDBStats(array $data): array { $vectordbId = $data['vectordbId']; $collectionId = $data['vectordbCollectionId']; @@ -1329,7 +1329,7 @@ class UsageTest extends Scope $this->assertCount(1, $response['body']['network']); $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); $this->validateDates($response['body']['requests']); - // vectordbTotal should reflect only VectorDB instances, not relational databases. + // vectordbTotal should reflect only VectorsDB instances, not relational databases. $this->assertEquals($vectordbTotal, $response['body']['vectordbDatabasesTotal']); $this->assertEquals($documentsTotal, $response['body']['vectordbDocumentsTotal']); }); @@ -1346,7 +1346,7 @@ class UsageTest extends Scope $this->assertEventually(function () use ($vectordbId, $collectionsTotal, $documentsTotal) { $response = $this->client->call( Client::METHOD_GET, - '/vectordb/' . $vectordbId . '/usage?range=30d', + '/vectorsdb/' . $vectordbId . '/usage?range=30d', $this->getConsoleHeaders() ); @@ -1360,7 +1360,7 @@ class UsageTest extends Scope $this->assertEventually(function () use ($vectordbId, $collectionId, $documentsTotal) { $response = $this->client->call( Client::METHOD_GET, - '/vectordb/' . $vectordbId . '/collections/' . $collectionId . '/usage?range=30d', + '/vectorsdb/' . $vectordbId . '/collections/' . $collectionId . '/usage?range=30d', $this->getConsoleHeaders() ); @@ -1371,7 +1371,7 @@ class UsageTest extends Scope return $data; } - #[Depends('testVectorDBStats')] + #[Depends('testVectorsDBStats')] public function testPrepareFunctionsStats(array $data): array { $executionTime = 0; @@ -1857,7 +1857,7 @@ class UsageTest extends Scope for ($i = 0; $i < 3; $i++) { $response = $this->client->call( Client::METHOD_POST, - '/vectordb/embeddings/text', + '/vectorsdb/embeddings/text', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Scopes/ApiVectorDB.php b/tests/e2e/Scopes/ApiVectorsDB.php similarity index 91% rename from tests/e2e/Scopes/ApiVectorDB.php rename to tests/e2e/Scopes/ApiVectorsDB.php index e9e9ac6205..09494d3c10 100644 --- a/tests/e2e/Scopes/ApiVectorDB.php +++ b/tests/e2e/Scopes/ApiVectorsDB.php @@ -3,19 +3,19 @@ namespace Tests\E2E\Scopes; /** - * API configuration trait for VectorDB database API. - * Uses: /vectordb, collections, documents, indexes + * API configuration trait for VectorsDB database API. + * Uses: /vectorsdb, collections, documents, indexes */ -trait ApiVectorDB +trait ApiVectorsDB { protected function getApiBasePath(): string { - return '/vectordb'; + return '/vectorsdb'; } protected function getDatabaseType(): string { - return 'vectordb'; + return 'vectorsdb'; } protected function getContainerResource(): string diff --git a/tests/e2e/Services/Databases/Permissions/VectorDBPermissionsGuestTest.php b/tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsGuestTest.php similarity index 85% rename from tests/e2e/Services/Databases/Permissions/VectorDBPermissionsGuestTest.php rename to tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsGuestTest.php index 8ceac1c55d..52ddcc8586 100644 --- a/tests/e2e/Services/Databases/Permissions/VectorDBPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsGuestTest.php @@ -1,19 +1,19 @@ client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -46,7 +46,7 @@ class VectorDBPermissionsGuestTest extends Scope $this->assertEquals('VectorGuestDB', $database['body']['name']); $databaseId = $database['body']['$id']; - $publicMovies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $publicMovies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -57,7 +57,7 @@ class VectorDBPermissionsGuestTest extends Scope Permission::delete(Role::any()), ], ]); - $privateMovies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $privateMovies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -95,7 +95,7 @@ class VectorDBPermissionsGuestTest extends Scope $privateCollectionId = $data['privateCollectionId']; $databaseId = $data['databaseId']; - $publicResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', $this->getServerHeader(), [ + $publicResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [1.0, 0.0, 0.0], @@ -103,7 +103,7 @@ class VectorDBPermissionsGuestTest extends Scope ], 'permissions' => $permissions, ]); - $privateResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ + $privateResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 1.0, 0.0], @@ -118,11 +118,11 @@ class VectorDBPermissionsGuestTest extends Scope $roles = $this->getAuthorization()->getRoles(); $this->getAuthorization()->cleanRoles(); - $publicDocuments = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ + $publicDocuments = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); - $privateDocuments = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ + $privateDocuments = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -152,7 +152,7 @@ class VectorDBPermissionsGuestTest extends Scope $roles = $this->getAuthorization()->getRoles(); $this->getAuthorization()->cleanRoles(); - $publicResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ + $publicResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -166,7 +166,7 @@ class VectorDBPermissionsGuestTest extends Scope $publicDocumentId = $publicResponse['body']['$id']; $this->assertEquals(201, $publicResponse['headers']['status-code']); - $privateResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ + $privateResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -180,7 +180,7 @@ class VectorDBPermissionsGuestTest extends Scope $this->assertEquals(401, $privateResponse['headers']['status-code']); // Create a document in private collection with API key so we can test that update and delete are also not allowed - $privateResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ + $privateResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 0.0, 1.0], @@ -191,7 +191,7 @@ class VectorDBPermissionsGuestTest extends Scope $this->assertEquals(201, $privateResponse['headers']['status-code']); $privateDocumentId = $privateResponse['body']['$id']; - $publicDocument = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ + $publicDocument = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -204,7 +204,7 @@ class VectorDBPermissionsGuestTest extends Scope $this->assertEquals(200, $publicDocument['headers']['status-code']); $this->assertEquals('Thor: Ragnarok', $publicDocument['body']['metadata']['title']); - $privateDocument = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ + $privateDocument = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -216,14 +216,14 @@ class VectorDBPermissionsGuestTest extends Scope $this->assertEquals(401, $privateDocument['headers']['status-code']); - $publicDocument = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ + $publicDocument = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); $this->assertEquals(204, $publicDocument['headers']['status-code']); - $privateDocument = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ + $privateDocument = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -237,7 +237,7 @@ class VectorDBPermissionsGuestTest extends Scope public function testWriteDocumentWithPermissions() { - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -249,7 +249,7 @@ class VectorDBPermissionsGuestTest extends Scope $this->assertEquals('VectorGuestPermsWrite', $database['body']['name']); $databaseId = $database['body']['$id']; - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -261,7 +261,7 @@ class VectorDBPermissionsGuestTest extends Scope $moviesId = $movies['body']['$id']; - $document = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $moviesId . '/documents', [ + $document = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $moviesId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ diff --git a/tests/e2e/Services/Databases/Permissions/VectorDBPermissionsMemberTest.php b/tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsMemberTest.php similarity index 87% rename from tests/e2e/Services/Databases/Permissions/VectorDBPermissionsMemberTest.php rename to tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsMemberTest.php index 9b8ac234b2..3043a42dd5 100644 --- a/tests/e2e/Services/Databases/Permissions/VectorDBPermissionsMemberTest.php +++ b/tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsMemberTest.php @@ -1,6 +1,6 @@ createUsers(); - $db = $this->client->call(Client::METHOD_POST, '/vectordb', $this->getServerHeader(), [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', $this->getServerHeader(), [ 'databaseId' => ID::unique(), 'name' => 'Test Database', ]); @@ -67,7 +67,7 @@ class VectorDBPermissionsMemberTest extends Scope $databaseId = $db['body']['$id']; - $public = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $public = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -82,7 +82,7 @@ class VectorDBPermissionsMemberTest extends Scope $this->assertEquals(201, $public['headers']['status-code']); $this->collections = ['public' => $public['body']['$id']]; - $private = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $private = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Private Movies', 'dimension' => 3, @@ -97,7 +97,7 @@ class VectorDBPermissionsMemberTest extends Scope $this->assertEquals(201, $private['headers']['status-code']); $this->collections['private'] = $private['body']['$id']; - $doconly = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $doconly = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Document Only Movies', 'dimension' => 3, @@ -125,7 +125,7 @@ class VectorDBPermissionsMemberTest extends Scope $collections = $data['collections']; $databaseId = $data['databaseId']; - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [1.0, 0.0, 0.0], @@ -135,7 +135,7 @@ class VectorDBPermissionsMemberTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 1.0, 0.0], @@ -145,7 +145,7 @@ class VectorDBPermissionsMemberTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 0.0, 1.0], @@ -158,7 +158,7 @@ class VectorDBPermissionsMemberTest extends Scope /** * Check "any" permission collection */ - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -171,7 +171,7 @@ class VectorDBPermissionsMemberTest extends Scope /** * Check "users" permission collection */ - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -184,7 +184,7 @@ class VectorDBPermissionsMemberTest extends Scope /** * Check "user:user1" document only permission collection */ - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Services/Databases/Permissions/VectorDBPermissionsTeamTest.php b/tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsTeamTest.php similarity index 88% rename from tests/e2e/Services/Databases/Permissions/VectorDBPermissionsTeamTest.php rename to tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsTeamTest.php index 409d0d2a76..11709ed729 100644 --- a/tests/e2e/Services/Databases/Permissions/VectorDBPermissionsTeamTest.php +++ b/tests/e2e/Services/Databases/Permissions/VectorsDBPermissionsTeamTest.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', $this->getServerHeader(), [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', $this->getServerHeader(), [ 'databaseId' => $this->databaseId, 'name' => 'Test Database', ]); $this->assertEquals(201, $db['headers']['status-code']); - $collection1 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ + $collection1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::custom('collection1'), 'name' => 'Collection 1', 'dimension' => 3, @@ -61,7 +61,7 @@ class VectorDBPermissionsTeamTest extends Scope $this->collections['collection1'] = $collection1['body']['$id']; - $collection2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ + $collection2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::custom('collection2'), 'name' => 'Collection 2', 'dimension' => 3, @@ -131,7 +131,7 @@ class VectorDBPermissionsTeamTest extends Scope $this->createCollections($this->teams); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections/' . $this->collections['collection1'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections/' . $this->collections['collection1'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [1.0, 0.0, 0.0], @@ -140,7 +140,7 @@ class VectorDBPermissionsTeamTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections/' . $this->collections['collection2'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections/' . $this->collections['collection2'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 1.0, 0.0], @@ -159,7 +159,7 @@ class VectorDBPermissionsTeamTest extends Scope #[DataProvider('readDocumentsProvider')] public function testReadDocuments($user, $collection, $success, $users) { - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -177,7 +177,7 @@ class VectorDBPermissionsTeamTest extends Scope #[DataProvider('writeDocumentsProvider')] public function testWriteDocuments($user, $collection, $success, $users) { - $documents = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ + $documents = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Services/Databases/Transactions/VectorDBACIDTest.php b/tests/e2e/Services/Databases/Transactions/VectorsDBACIDTest.php similarity index 89% rename from tests/e2e/Services/Databases/Transactions/VectorDBACIDTest.php rename to tests/e2e/Services/Databases/Transactions/VectorsDBACIDTest.php index 2af598d0ce..914c8d0c5b 100644 --- a/tests/e2e/Services/Databases/Transactions/VectorDBACIDTest.php +++ b/tests/e2e/Services/Databases/Transactions/VectorsDBACIDTest.php @@ -10,7 +10,7 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; -class VectorDBACIDTest extends Scope +class VectorsDBACIDTest extends Scope { use ProjectCustom; use SideClient; @@ -28,7 +28,7 @@ class VectorDBACIDTest extends Scope public function testAtomicity(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -41,7 +41,7 @@ class VectorDBACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection for the test - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -61,7 +61,7 @@ class VectorDBACIDTest extends Scope // Create a document outside the transaction $existingDocumentId = 'existing_doc'; - $doc1 = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc1 = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -75,7 +75,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals(201, $doc1['headers']['status-code']); // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -86,7 +86,7 @@ class VectorDBACIDTest extends Scope $transactionId = $transaction['body']['$id']; // Add operations - second create reuses an existing documentId and should cause the commit to fail - $response = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -114,7 +114,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals(200, $response['headers']['status-code'], 'Adding documents via normal route should succeed. Response: ' . json_encode($response['body'])); // Attempt to commit - should fail due to duplicate document ID - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -125,7 +125,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals(409, $response['headers']['status-code']); // Verify NO new documents were created (atomicity) - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -140,7 +140,7 @@ class VectorDBACIDTest extends Scope public function testConsistency(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -153,7 +153,7 @@ class VectorDBACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -172,7 +172,7 @@ class VectorDBACIDTest extends Scope $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -181,7 +181,7 @@ class VectorDBACIDTest extends Scope $transactionId = $transaction['body']['$id']; // Stage operations with valid and invalid data (embedding length mismatch) - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -223,7 +223,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); // Attempt to commit - should fail due to invalid embeddings - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -234,7 +234,7 @@ class VectorDBACIDTest extends Scope $this->assertContains($response['headers']['status-code'], [400, 409, 500], 'Transaction commit should fail due to validation. Response: ' . json_encode($response['body'])); // Verify no documents were created - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -248,7 +248,7 @@ class VectorDBACIDTest extends Scope public function testIsolation(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -261,7 +261,7 @@ class VectorDBACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -280,7 +280,7 @@ class VectorDBACIDTest extends Scope $collectionId = $collection['body']['$id']; // Create initial document with status metadata - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -294,7 +294,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals(201, $doc['headers']['status-code']); // Create first transaction - $transaction1 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -305,7 +305,7 @@ class VectorDBACIDTest extends Scope $transactionId1 = $transaction1['body']['$id']; // Transaction 1: update status to approved - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId1}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId1}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -324,7 +324,7 @@ class VectorDBACIDTest extends Scope ]); // Commit first transaction - $response1 = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId1}", array_merge([ + $response1 = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId1}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -334,14 +334,14 @@ class VectorDBACIDTest extends Scope $this->assertEquals(200, $response1['headers']['status-code']); // Document should reflect the first transaction's update - $document = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ + $document = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals('approved', $document['body']['metadata']['status']); // Create second transaction after first commit - $transaction2 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -352,7 +352,7 @@ class VectorDBACIDTest extends Scope $transactionId2 = $transaction2['body']['$id']; // Transaction 2: update status to declined - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId2}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId2}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -371,7 +371,7 @@ class VectorDBACIDTest extends Scope ]); // Commit second transaction and ensure isolation guarantees - $response2 = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId2}", array_merge([ + $response2 = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId2}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -382,7 +382,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals(200, $response2['headers']['status-code']); // Final document should reflect the second transaction's update - $document = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ + $document = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -396,7 +396,7 @@ class VectorDBACIDTest extends Scope public function testDurability(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -409,7 +409,7 @@ class VectorDBACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -430,7 +430,7 @@ class VectorDBACIDTest extends Scope $collectionId = $collection['body']['$id']; // Create transaction with multiple operations - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -441,7 +441,7 @@ class VectorDBACIDTest extends Scope $transactionId = $transaction['body']['$id']; // Create two documents via normal route inside transaction - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -462,7 +462,7 @@ class VectorDBACIDTest extends Scope ]); // Update first document inside the same transaction - $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -474,7 +474,7 @@ class VectorDBACIDTest extends Scope ]); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -486,14 +486,14 @@ class VectorDBACIDTest extends Scope $this->assertEquals('committed', $response['body']['status']); // Verify documents exist and have correct data - $document1 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $document1 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals(200, $document1['headers']['status-code']); $this->assertEquals('Updated important data 1', $document1['body']['metadata']['data']); - $document2 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_2", array_merge([ + $document2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_2", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -501,7 +501,7 @@ class VectorDBACIDTest extends Scope $this->assertEquals('Important data 2', $document2['body']['metadata']['data']); // Further update outside transaction to ensure persistence - $update = $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $update = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -512,14 +512,14 @@ class VectorDBACIDTest extends Scope $this->assertEquals(200, $update['headers']['status-code']); // Verify the update persisted - $document1 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $document1 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals('Modified outside transaction', $document1['body']['metadata']['data']); // List all documents to verify total count - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); diff --git a/tests/e2e/Services/Databases/Transactions/VectorDBTransactionsConsoleClientTest.php b/tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsConsoleClientTest.php similarity index 63% rename from tests/e2e/Services/Databases/Transactions/VectorDBTransactionsConsoleClientTest.php rename to tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsConsoleClientTest.php index 7cb28b2f74..f6f217ab69 100644 --- a/tests/e2e/Services/Databases/Transactions/VectorDBTransactionsConsoleClientTest.php +++ b/tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsConsoleClientTest.php @@ -5,9 +5,9 @@ namespace Tests\E2E\Services\Databases\Transactions; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideConsole; -use Tests\E2E\Services\Databases\VectorDB\Transactions\TransactionsBase; +use Tests\E2E\Services\Databases\VectorsDB\Transactions\TransactionsBase; -class VectorDBTransactionsConsoleClientTest extends Scope +class VectorsDBTransactionsConsoleClientTest extends Scope { use TransactionsBase; use ProjectCustom; diff --git a/tests/e2e/Services/Databases/Transactions/VectorDBTransactionsCustomClientTest.php b/tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsCustomClientTest.php similarity index 63% rename from tests/e2e/Services/Databases/Transactions/VectorDBTransactionsCustomClientTest.php rename to tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsCustomClientTest.php index 238cf9aea0..6dcfdf9f3e 100644 --- a/tests/e2e/Services/Databases/Transactions/VectorDBTransactionsCustomClientTest.php +++ b/tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsCustomClientTest.php @@ -5,9 +5,9 @@ namespace Tests\E2E\Services\Databases\Transactions; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Tests\E2E\Services\Databases\VectorDB\Transactions\TransactionsBase; +use Tests\E2E\Services\Databases\VectorsDB\Transactions\TransactionsBase; -class VectorDBTransactionsCustomClientTest extends Scope +class VectorsDBTransactionsCustomClientTest extends Scope { use TransactionsBase; use ProjectCustom; diff --git a/tests/e2e/Services/Databases/Transactions/VectorDBTransactionsCustomServerTest.php b/tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsCustomServerTest.php similarity index 63% rename from tests/e2e/Services/Databases/Transactions/VectorDBTransactionsCustomServerTest.php rename to tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsCustomServerTest.php index 5cc23ef3d5..44f1ba36e1 100644 --- a/tests/e2e/Services/Databases/Transactions/VectorDBTransactionsCustomServerTest.php +++ b/tests/e2e/Services/Databases/Transactions/VectorsDBTransactionsCustomServerTest.php @@ -5,9 +5,9 @@ namespace Tests\E2E\Services\Databases\Transactions; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Tests\E2E\Services\Databases\VectorDB\Transactions\TransactionsBase; +use Tests\E2E\Services\Databases\VectorsDB\Transactions\TransactionsBase; -class VectorDBTransactionsCustomServerTest extends Scope +class VectorsDBTransactionsCustomServerTest extends Scope { use TransactionsBase; use ProjectCustom; diff --git a/tests/e2e/Services/Databases/VectorDB/DatabasesBase.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php similarity index 90% rename from tests/e2e/Services/Databases/VectorDB/DatabasesBase.php rename to tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php index 2276fc32bb..1bdc77085b 100644 --- a/tests/e2e/Services/Databases/VectorDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -29,7 +29,7 @@ trait DatabasesBase $this->assertNotEmpty($database['body']['$id']); $this->assertEquals(201, $database['headers']['status-code']); $this->assertEquals('Test Database', $database['body']['name']); - $this->assertEquals('vectordb', $database['body']['type']); + $this->assertEquals('vectorsdb', $database['body']['type']); return ['databaseId' => $database['body']['$id']]; } @@ -44,7 +44,7 @@ trait DatabasesBase $vector = array_fill(0, 1536, 0.1); $vector[0] = 1.0; - $res = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -74,7 +74,7 @@ trait DatabasesBase // Edge: invalid dimensions (vector too short) → expect 4xx $badVec = [1.0, 0.0]; - $bad = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $bad = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -90,7 +90,7 @@ trait DatabasesBase // Edge: invalid type values (strings) → expect 4xx $strVec = ['1.0', '0.0', '0.0']; - $bad2 = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $bad2 = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -105,7 +105,7 @@ trait DatabasesBase $this->assertLessThan(500, $bad2['headers']['status-code']); // Create another valid doc to verify list totals later - $res2 = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res2 = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -137,7 +137,7 @@ trait DatabasesBase $collectionId = $data['collectionId']; $documentId = $data['documentId']; - $res = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $res = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -147,7 +147,7 @@ trait DatabasesBase $this->assertEquals($documentId, $res['body']['$id']); // Edge: missing document should return 404 - $missing = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ + $missing = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -163,7 +163,7 @@ trait DatabasesBase $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; - $list = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $list = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -176,7 +176,7 @@ trait DatabasesBase $this->assertGreaterThanOrEqual(1, $list['body']['total']); // Pagination: limit 1, then offset 1 - $page1 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $page1 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -189,7 +189,7 @@ trait DatabasesBase $this->assertEquals(200, $page1['headers']['status-code']); $this->assertEquals(1, \count($page1['body']['documents'] ?? [])); - $page2 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $page2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -216,7 +216,7 @@ trait DatabasesBase $vector = array_fill(0, 1536, 0.0); // $vector[1] = 1.0; - $upd = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $upd = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -230,7 +230,7 @@ trait DatabasesBase $this->assertEquals(200, $upd['headers']['status-code']); // Verify update took effect - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -254,7 +254,7 @@ trait DatabasesBase $vector = array_fill(0, 1536, 0.0); $vector[2] = 1.0; - $upd = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $upd = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -270,7 +270,7 @@ trait DatabasesBase // Re-update to check idempotence and metadata replacement $vector2 = array_fill(0, 1536, 0.0); $vector2[3] = 1.0; - $upd2 = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $upd2 = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -283,7 +283,7 @@ trait DatabasesBase $this->assertEquals(200, $upd2['headers']['status-code']); // Verify updatedAt changed again - $get2 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $get2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -302,7 +302,7 @@ trait DatabasesBase // Create two more documents with distinct embeddings $mk = function (array $vec, string $name) use ($databaseId, $collectionId) { - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -325,7 +325,7 @@ trait DatabasesBase $mk($vB, 'B'); // Dot product - $dot = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $dot = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -339,7 +339,7 @@ trait DatabasesBase $this->assertGreaterThanOrEqual(1, $dot['body']['total']); // Cosine - $cos = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $cos = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -353,7 +353,7 @@ trait DatabasesBase $this->assertGreaterThanOrEqual(1, $cos['body']['total']); // Euclidean - $eu = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $eu = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -367,7 +367,7 @@ trait DatabasesBase $this->assertGreaterThanOrEqual(1, $eu['body']['total']); // Combined vector + metadata filters - $combo = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $combo = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -382,7 +382,7 @@ trait DatabasesBase $this->assertGreaterThanOrEqual(1, $combo['body']['total']); // Ordering with $id ascending combined with vector - $ordered = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $ordered = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -405,7 +405,7 @@ trait DatabasesBase $collectionId = $data['collectionId']; $documentId = $data['documentId']; - $del = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $del = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -413,7 +413,7 @@ trait DatabasesBase $this->assertEquals(204, $del['headers']['status-code']); // GET after delete should be 404 - $getMissing = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $getMissing = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -421,7 +421,7 @@ trait DatabasesBase $this->assertEquals(404, $getMissing['headers']['status-code']); // List should still work and reflect at least one less document compared to earlier pages (best-effort) - $list = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $list = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -441,7 +441,7 @@ trait DatabasesBase $docId = ID::unique(); $vector = array_fill(0, 1536, 0.0); $vector[0] = 1.0; - $create = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $create = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -457,14 +457,14 @@ trait DatabasesBase ]); $this->assertEquals(201, $create['headers']['status-code']); - $guest = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$docId}", [ + $guest = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$docId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ]); $this->assertEquals(404, $guest['headers']['status-code']); // GET with key should succeed regardless of document user-level permission - $withKey = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$docId}", [ + $withKey = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$docId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -479,7 +479,7 @@ trait DatabasesBase /** * Test for SUCCESS */ - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -496,7 +496,7 @@ trait DatabasesBase $this->assertEquals(201, $movies['headers']['status-code']); $this->assertEquals($movies['body']['name'], 'Movies'); - $actors = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $actors = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -522,19 +522,19 @@ trait DatabasesBase public function testCreateDatabaseSample(): array { - $database = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'databaseId' => ID::unique(), - 'name' => 'Sample VectorDB' + 'name' => 'Sample VectorsDB' ]); $this->assertNotEmpty($database['body']['$id']); $this->assertEquals(201, $database['headers']['status-code']); - $this->assertEquals('Sample VectorDB', $database['body']['name']); - $this->assertEquals('vectordb', $database['body']['type']); + $this->assertEquals('Sample VectorsDB', $database['body']['name']); + $this->assertEquals('vectorsdb', $database['body']['type']); return ['databaseId' => $database['body']['$id']]; } @@ -544,7 +544,7 @@ trait DatabasesBase { $databaseId = $data['databaseId']; - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -578,7 +578,7 @@ trait DatabasesBase * Helper to create a database */ $createDatabase = function (string $name) use ($projectId, $apiKey) { - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, 'x-appwrite-key' => $apiKey @@ -588,7 +588,7 @@ trait DatabasesBase ]); $this->assertEquals(201, $db['headers']['status-code']); - $this->assertEquals('vectordb', $db['body']['type']); + $this->assertEquals('vectorsdb', $db['body']['type']); $this->assertEquals($name, $db['body']['name']); $this->assertNotEmpty($db['body']['$id']); @@ -599,7 +599,7 @@ trait DatabasesBase * Helper to create a collection */ $createCollection = function (string $databaseId, string $name, int $dimensions = 1536) use ($projectId, $apiKey, $userId) { - $res = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $res = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, 'x-appwrite-key' => $apiKey @@ -665,7 +665,7 @@ trait DatabasesBase public function testInvalidCollectionDimensions(): void { // dimensions = 0 -> expect 4xx - $bad0 = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $bad0 = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -675,7 +675,7 @@ trait DatabasesBase ]); $this->assertEquals(201, $bad0['headers']['status-code']); $dbId = $bad0['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $dbId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $dbId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -690,7 +690,7 @@ trait DatabasesBase $this->assertLessThan(500, $col['headers']['status-code']); // dimensions too large -> expect 4xx - $col2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $dbId . '/collections', [ + $col2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $dbId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -707,7 +707,7 @@ trait DatabasesBase public function testSingleDimensionVectorCollection(): void { - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -718,7 +718,7 @@ trait DatabasesBase $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -734,7 +734,7 @@ trait DatabasesBase // Create two docs with 1D embeddings $id1 = ID::unique(); - $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id1}", [ + $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id1}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -742,7 +742,7 @@ trait DatabasesBase 'data' => ['embeddings' => [1.0]] ]); $id2 = ID::unique(); - $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id2}", [ + $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id2}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -751,7 +751,7 @@ trait DatabasesBase ]); // Query with vectorCosine - $res = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -764,7 +764,7 @@ trait DatabasesBase public function testVectorInvalidValues(): void { - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -775,7 +775,7 @@ trait DatabasesBase $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -807,7 +807,7 @@ trait DatabasesBase ]; foreach ($badPayloads as $payload) { - $resp = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ + $resp = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -821,7 +821,7 @@ trait DatabasesBase public function testVectorAllZerosAndQuery(): void { - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -832,7 +832,7 @@ trait DatabasesBase $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -846,19 +846,19 @@ trait DatabasesBase $this->assertEquals(201, $col['headers']['status-code']); $collectionId = $col['body']['$id']; - $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ + $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'data' => ['embeddings' => [0.0, 0.0, 0.0]] ]); - $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ + $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/" . ID::unique(), [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'data' => ['embeddings' => [1.0, 0.0, 0.0]] ]); - $results = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $results = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -870,14 +870,14 @@ trait DatabasesBase public function testVectorMultipleQueriesRejection(): void { // Create a simple DB and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'databaseId' => ID::unique(), 'name' => 'MultiQueryDB' ]); $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -886,7 +886,7 @@ trait DatabasesBase $collectionId = $col['body']['$id']; // Two vector queries simultaneously should fail - $fail = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $fail = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -902,14 +902,14 @@ trait DatabasesBase public function testVectorQueryOnNonVectorAttribute(): void { - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'databaseId' => ID::unique(), 'name' => 'NonVec' ]); $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -918,7 +918,7 @@ trait DatabasesBase $collectionId = $col['body']['$id']; // Query on non-vector attribute 'metadata' should fail - $fail = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $fail = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -929,14 +929,14 @@ trait DatabasesBase public function testVectorEmptyQueryCollection(): void { - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'databaseId' => ID::unique(), 'name' => 'EmptyQ' ]); $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -944,7 +944,7 @@ trait DatabasesBase $this->assertEquals(201, $col['headers']['status-code']); $collectionId = $col['body']['$id']; - $res = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -960,7 +960,7 @@ trait DatabasesBase $collectionId = $data['moviesId']; // HNSW Euclidean - $idxEuclidean = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $idxEuclidean = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -972,7 +972,7 @@ trait DatabasesBase $this->assertEquals(202, $idxEuclidean['headers']['status-code']); // HNSW Dot (Inner Product) - $idxDot = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $idxDot = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -984,7 +984,7 @@ trait DatabasesBase $this->assertEquals(202, $idxDot['headers']['status-code']); // HNSW Cosine - $idxCosine = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $idxCosine = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1008,7 +1008,7 @@ trait DatabasesBase $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; - $list = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $list = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1034,7 +1034,7 @@ trait DatabasesBase ]; foreach ($keysToTypes as $key => $type) { - $res = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/{$key}", [ + $res = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/{$key}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/Databases/VectorDB/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php similarity index 89% rename from tests/e2e/Services/Databases/VectorDB/DatabasesConsoleClientTest.php rename to tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php index c585a7930b..abe4d4968b 100644 --- a/tests/e2e/Services/Databases/VectorDB/DatabasesConsoleClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -35,7 +35,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test for SUCCESS */ - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -57,7 +57,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test when database is disabled but can still create collections */ - $database = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, array_merge([ + $database = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -67,7 +67,7 @@ class DatabasesConsoleClientTest extends Scope $this->assertFalse($database['body']['enabled']); - $tvShows = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $tvShows = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -86,7 +86,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test when collection is disabled but can still modify collections */ - $database = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $movies['body']['$id'], array_merge([ + $database = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $movies['body']['$id'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -108,7 +108,7 @@ class DatabasesConsoleClientTest extends Scope */ $databaseId = $data['databaseId']; - $collections = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collections = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders())); @@ -126,7 +126,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test when database and collection are disabled but can still call get collection */ - $collection = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ + $collection = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -146,7 +146,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test When database and collection are disabled but can still call update collection */ - $collection = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ + $collection = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -169,7 +169,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test when database and collection are disabled but can still call delete collection */ - $response = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $tvShowsId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $tvShowsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -186,7 +186,7 @@ class DatabasesConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -199,7 +199,7 @@ class DatabasesConsoleClientTest extends Scope * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -224,7 +224,7 @@ class DatabasesConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -233,7 +233,7 @@ class DatabasesConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/randomCollectionId/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/randomCollectionId/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -245,7 +245,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -265,7 +265,7 @@ class DatabasesConsoleClientTest extends Scope /** * Test for SUCCESS */ - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -274,7 +274,7 @@ class DatabasesConsoleClientTest extends Scope $this->assertIsArray($logs['body']['logs']); $this->assertIsNumeric($logs['body']['total']); - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -286,7 +286,7 @@ class DatabasesConsoleClientTest extends Scope $this->assertLessThanOrEqual(1, count($logs['body']['logs'])); $this->assertIsNumeric($logs['body']['total']); - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -297,7 +297,7 @@ class DatabasesConsoleClientTest extends Scope $this->assertIsArray($logs['body']['logs']); $this->assertIsNumeric($logs['body']['total']); - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ diff --git a/tests/e2e/Services/Databases/VectorDB/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php similarity index 89% rename from tests/e2e/Services/Databases/VectorDB/DatabasesCustomClientTest.php rename to tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php index cc99806848..b27cb420b4 100644 --- a/tests/e2e/Services/Databases/VectorDB/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -35,7 +35,7 @@ class DatabasesCustomClientTest extends Scope $databaseId = $database['body']['$id']; // Collection aliases write to create, update, delete - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -55,10 +55,10 @@ class DatabasesCustomClientTest extends Scope $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); - // VectorDB uses fixed schema (embeddings, metadata). No attribute creation needed. + // VectorsDB uses fixed schema (embeddings, metadata). No attribute creation needed. // Document aliases write to update, delete - $document1 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ + $document1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -81,7 +81,7 @@ class DatabasesCustomClientTest extends Scope */ // Document does not allow create permission - $document2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ + $document2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -109,7 +109,7 @@ class DatabasesCustomClientTest extends Scope $userId = $response['body']['$id']; - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -122,7 +122,7 @@ class DatabasesCustomClientTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -136,7 +136,7 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); // Creating document by server, give read permission to our user + some other user - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/permissionCheck/documents', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/permissionCheck/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -158,7 +158,7 @@ class DatabasesCustomClientTest extends Scope // Update document // This is the point of this test. We should be allowed to do this action, and it should not fail on permission check - $response = $this->client->call(Client::METHOD_PATCH, '/vectordb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/vectorsdb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -171,7 +171,7 @@ class DatabasesCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); // Get name of the document, should be the new one - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -180,7 +180,7 @@ class DatabasesCustomClientTest extends Scope // Cleanup to prevent collision with other tests // Delete collection - $response = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/permissionCheck', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/permissionCheck', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -193,7 +193,7 @@ class DatabasesCustomClientTest extends Scope sleep(2); // Make sure collection has been deleted - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/permissionCheck', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/permissionCheck', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/Databases/VectorDB/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php similarity index 90% rename from tests/e2e/Services/Databases/VectorDB/DatabasesCustomServerTest.php rename to tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php index 45e641419f..9564b76079 100644 --- a/tests/e2e/Services/Databases/VectorDB/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Tests\E2E\Services\Databases\VectorDB; +namespace Tests\E2E\Services\Databases\VectorsDB; use PHPUnit\Framework\Attributes\Depends; use Tests\E2E\Client; @@ -22,7 +22,7 @@ class DatabasesCustomServerTest extends Scope public function testListDatabases(): array { - $db1 = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db1 = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -32,14 +32,14 @@ class DatabasesCustomServerTest extends Scope ]); $this->assertEquals(201, $db1['headers']['status-code']); $this->assertEquals('Test 1', $db1['body']['name']); - $this->assertEquals('vectordb', $db1['body']['type']); + $this->assertEquals('vectorsdb', $db1['body']['type']); // Validate database response model fields on create $this->assertArrayHasKey('$id', $db1['body']); $this->assertArrayHasKey('$createdAt', $db1['body']); $this->assertArrayHasKey('$updatedAt', $db1['body']); $this->assertArrayHasKey('enabled', $db1['body']); - $db2 = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db2 = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -49,9 +49,9 @@ class DatabasesCustomServerTest extends Scope ]); $this->assertEquals(201, $db2['headers']['status-code']); $this->assertEquals('Test 2', $db2['body']['name']); - $this->assertEquals('vectordb', $db2['body']['type']); + $this->assertEquals('vectorsdb', $db2['body']['type']); - $list = $this->client->call(Client::METHOD_GET, '/vectordb', [ + $list = $this->client->call(Client::METHOD_GET, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -71,7 +71,7 @@ class DatabasesCustomServerTest extends Scope public function testGetDatabase(array $data): array { $databaseId = $data['databaseId']; - $res = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId, [ + $res = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -79,7 +79,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(200, $res['headers']['status-code']); $this->assertEquals($databaseId, $res['body']['$id']); $this->assertEquals('Test 1', $res['body']['name']); - $this->assertEquals('vectordb', $res['body']['type']); + $this->assertEquals('vectorsdb', $res['body']['type']); return ['databaseId' => $databaseId]; } @@ -87,7 +87,7 @@ class DatabasesCustomServerTest extends Scope public function testUpdateDatabase(array $data): array { $databaseId = $data['databaseId']; - $res = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $res = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -96,7 +96,7 @@ class DatabasesCustomServerTest extends Scope ]); $this->assertEquals(200, $res['headers']['status-code']); $this->assertEquals('Test 1 Updated', $res['body']['name']); - $this->assertEquals('vectordb', $res['body']['type']); + $this->assertEquals('vectorsdb', $res['body']['type']); return ['databaseId' => $databaseId]; } @@ -104,7 +104,7 @@ class DatabasesCustomServerTest extends Scope public function testDeleteDatabase(array $data): void { $databaseId = $data['databaseId']; - $del = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $del = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -112,7 +112,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(204, $del['headers']['status-code']); $this->assertEquals("", $del['body']); - $get = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId, [ + $get = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -123,7 +123,7 @@ class DatabasesCustomServerTest extends Scope public function testCollectionsCRUD(): array { // Create database for collections tests - $database = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -135,7 +135,7 @@ class DatabasesCustomServerTest extends Scope $databaseId = $database['body']['$id']; // Create two collections - $col1 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -160,7 +160,7 @@ class DatabasesCustomServerTest extends Scope $this->assertArrayHasKey('documentSecurity', $col1['body']); $this->assertArrayHasKey('dimension', $col1['body']); - $col2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -182,7 +182,7 @@ class DatabasesCustomServerTest extends Scope $this->assertArrayHasKey('$updatedAt', $col2['body']); // List collections - $list = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections', [ + $list = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -196,7 +196,7 @@ class DatabasesCustomServerTest extends Scope $this->assertArrayHasKey('dimension', $list['body']['collections'][0]); // Get collection - $get = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ + $get = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -207,7 +207,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(3, $get['body']['dimension']); // Update collection (name only) - $upd = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ + $upd = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -219,7 +219,7 @@ class DatabasesCustomServerTest extends Scope $this->assertArrayHasKey('$updatedAt', $upd['body']); // Delete collection - $del = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $col2['body']['$id'], [ + $del = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $col2['body']['$id'], [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -240,7 +240,7 @@ class DatabasesCustomServerTest extends Scope $collectionId = $data['collectionId']; // Update collection name and dimensions - $upd = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $upd = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -253,7 +253,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(4, $upd['body']['dimension']); // Read back to confirm - $get = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $get = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -272,7 +272,7 @@ class DatabasesCustomServerTest extends Scope $collectionId = $data['collectionId']; // Disable collection - $disable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $disable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -284,7 +284,7 @@ class DatabasesCustomServerTest extends Scope $this->assertFalse($disable['body']['enabled']); // Re-enable collection - $enable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $enable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -301,7 +301,7 @@ class DatabasesCustomServerTest extends Scope public function testUpdateDatabaseNameAndEnabled(): void { // Create isolated database for this test to avoid ordering conflicts - $create = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $create = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -313,7 +313,7 @@ class DatabasesCustomServerTest extends Scope $databaseId = $create['body']['$id']; // Update name - $rename = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $rename = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -324,7 +324,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals('Test DB Renamed', $rename['body']['name']); // Toggle enabled off then on - $disable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $disable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -335,7 +335,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(200, $disable['headers']['status-code']); $this->assertFalse($disable['body']['enabled']); - $enable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $enable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -347,7 +347,7 @@ class DatabasesCustomServerTest extends Scope $this->assertTrue($enable['body']['enabled']); // Cleanup - $del = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $del = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -362,7 +362,7 @@ class DatabasesCustomServerTest extends Scope $collectionId = $data['collectionId']; // Create a new index variant - $create = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $create = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -374,7 +374,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(202, $create['headers']['status-code']); // Ensure it exists - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -383,7 +383,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals('embedding_euclidean_v2', $get['body']['key']); // Delete it - $del = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ + $del = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -398,7 +398,7 @@ class DatabasesCustomServerTest extends Scope $collectionId = $data['collectionId']; // Create indexes - $eu = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $eu = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -409,7 +409,7 @@ class DatabasesCustomServerTest extends Scope ]); $this->assertEquals(202, $eu['headers']['status-code']); - $dot = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $dot = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -420,7 +420,7 @@ class DatabasesCustomServerTest extends Scope ]); $this->assertEquals(202, $dot['headers']['status-code']); - $cos = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $cos = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -432,7 +432,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(202, $cos['headers']['status-code']); // List indexes - $list = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $list = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -445,7 +445,7 @@ class DatabasesCustomServerTest extends Scope $this->assertContains('embedding_cosine', $keys); // Get index by key - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -455,7 +455,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(Database::INDEX_HNSW_EUCLIDEAN, $get['body']['type']); // Delete index - $del = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ + $del = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -463,7 +463,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(204, $del['headers']['status-code']); sleep(4); // Ensure it's gone - $getMissing = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ + $getMissing = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -474,7 +474,7 @@ class DatabasesCustomServerTest extends Scope public function testBulkCreate(): array { // Setup: create isolated database and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -485,7 +485,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -512,7 +512,7 @@ class DatabasesCustomServerTest extends Scope ], ]; - $res = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -532,7 +532,7 @@ class DatabasesCustomServerTest extends Scope // Fetch and validate persisted data via GET foreach ($ids as $i => $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -550,7 +550,7 @@ class DatabasesCustomServerTest extends Scope public function testCreateTextEmbeddingsSuccessAndErrors(): void { // Setup new database and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -561,7 +561,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -577,7 +577,7 @@ class DatabasesCustomServerTest extends Scope // Success: two embeddings $this->assertEventually(function () { - $ok = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $ok = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -603,7 +603,7 @@ class DatabasesCustomServerTest extends Scope }, 3000, 100); // Error: missing texts payload - $missingTexts = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $missingTexts = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -611,7 +611,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $missingTexts['headers']['status-code']); // Error: invalid texts item type (must be strings) - $invalidItem = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $invalidItem = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -625,7 +625,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(400, $invalidItem['headers']['status-code']); // Error: unknown embedding model - $unknownModel = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $unknownModel = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -639,7 +639,7 @@ class DatabasesCustomServerTest extends Scope public function testBulkUpsert(): void { // Setup fresh db/collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -647,7 +647,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -674,7 +674,7 @@ class DatabasesCustomServerTest extends Scope ], ]; - $res = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -691,7 +691,7 @@ class DatabasesCustomServerTest extends Scope // Fetch and validate updated content $ids = array_map(fn ($d) => $d['$id'], $res['body']['documents']); foreach ($ids as $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -705,7 +705,7 @@ class DatabasesCustomServerTest extends Scope [ 'embeddings' => [0.6, 0.4, 0.0], 'metadata' => ['updatedAgain' => true] ], [ 'embeddings' => [0.3, 0.7, 0.0], 'metadata' => ['updatedAgain' => true] ], ]; - $res2 = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res2 = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -719,7 +719,7 @@ class DatabasesCustomServerTest extends Scope // Fetch again and assert second update persisted $ids2 = array_map(fn ($d) => $d['$id'], $res2['body']['documents']); foreach ($ids2 as $id) { - $get2 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -732,7 +732,7 @@ class DatabasesCustomServerTest extends Scope public function testBulkUpdate(): void { // Setup: create db/collection and two docs - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -740,7 +740,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -754,7 +754,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $col['headers']['status-code']); $collectionId = $col['body']['$id']; - $seed = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $seed = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -767,7 +767,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(200, $seed['headers']['status-code']); $ids = array_map(fn ($d) => $d['$id'], $seed['body']['documents']); - $res = $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -787,7 +787,7 @@ class DatabasesCustomServerTest extends Scope // Fetch by IDs and assert update persisted foreach ($ids as $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -800,7 +800,7 @@ class DatabasesCustomServerTest extends Scope public function testBulkDelete(): void { // Setup: create db/collection and two docs - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -808,7 +808,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -822,7 +822,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $col['headers']['status-code']); $collectionId = $col['body']['$id']; - $seed = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $seed = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -835,7 +835,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(200, $seed['headers']['status-code']); $ids = array_map(fn ($d) => $d['$id'], $seed['body']['documents']); - $res = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -850,7 +850,7 @@ class DatabasesCustomServerTest extends Scope // Ensure they are deleted foreach ($ids as $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -862,7 +862,7 @@ class DatabasesCustomServerTest extends Scope public function testCustomTimestamps(): void { // Setup: create database and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -873,7 +873,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -894,7 +894,7 @@ class DatabasesCustomServerTest extends Scope $vector[0] = 1.0; $documentId = ID::unique(); - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -917,7 +917,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals($customUpdatedAt, $doc['body']['$updatedAt'], 'UpdatedAt should match custom timestamp'); // Fetch document and verify timestamps persist - $fetched = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $fetched = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -932,7 +932,7 @@ class DatabasesCustomServerTest extends Scope $vector2 = array_fill(0, 1536, 0.0); $vector2[1] = 1.0; - $updated = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $updated = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -950,7 +950,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals($newCustomUpdatedAt, $updated['body']['$updatedAt'], 'UpdatedAt should be updated to new custom timestamp'); // Final verification - $final = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $final = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php similarity index 86% rename from tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsGuestTest.php rename to tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php index 4759413e77..9335b7f55b 100644 --- a/tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -45,7 +45,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals('VectorGuestDB', $database['body']['name']); $databaseId = $database['body']['$id']; - $publicMovies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $publicMovies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -56,7 +56,7 @@ class DatabasesPermissionsGuestTest extends Scope Permission::delete(Role::any()), ], ]); - $privateMovies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $privateMovies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -94,7 +94,7 @@ class DatabasesPermissionsGuestTest extends Scope $privateCollectionId = $data['privateCollectionId']; $databaseId = $data['databaseId']; - $publicResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', $this->getServerHeader(), [ + $publicResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [1.0, 0.0, 0.0], @@ -102,7 +102,7 @@ class DatabasesPermissionsGuestTest extends Scope ], 'permissions' => $permissions, ]); - $privateResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ + $privateResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 1.0, 0.0], @@ -117,11 +117,11 @@ class DatabasesPermissionsGuestTest extends Scope $roles = $this->getAuthorization()->getRoles(); $this->getAuthorization()->cleanRoles(); - $publicDocuments = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ + $publicDocuments = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); - $privateDocuments = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ + $privateDocuments = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -151,7 +151,7 @@ class DatabasesPermissionsGuestTest extends Scope $roles = $this->getAuthorization()->getRoles(); $this->getAuthorization()->cleanRoles(); - $publicResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ + $publicResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -165,7 +165,7 @@ class DatabasesPermissionsGuestTest extends Scope $publicDocumentId = $publicResponse['body']['$id']; $this->assertEquals(201, $publicResponse['headers']['status-code']); - $privateResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ + $privateResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -179,7 +179,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(401, $privateResponse['headers']['status-code']); // Create a document in private collection with API key so we can test that update and delete are also not allowed - $privateResponse = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ + $privateResponse = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 0.0, 1.0], @@ -190,7 +190,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(201, $privateResponse['headers']['status-code']); $privateDocumentId = $privateResponse['body']['$id']; - $publicDocument = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ + $publicDocument = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -203,7 +203,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(200, $publicDocument['headers']['status-code']); $this->assertEquals('Thor: Ragnarok', $publicDocument['body']['metadata']['title']); - $privateDocument = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ + $privateDocument = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ @@ -215,14 +215,14 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals(401, $privateDocument['headers']['status-code']); - $publicDocument = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ + $publicDocument = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $publicCollectionId . '/documents/' . $publicDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); $this->assertEquals(204, $publicDocument['headers']['status-code']); - $privateDocument = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ + $privateDocument = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $privateCollectionId . '/documents/' . $privateDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -236,7 +236,7 @@ class DatabasesPermissionsGuestTest extends Scope public function testWriteDocumentWithPermissions() { - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -248,7 +248,7 @@ class DatabasesPermissionsGuestTest extends Scope $this->assertEquals('VectorGuestPermsWrite', $database['body']['name']); $databaseId = $database['body']['$id']; - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -260,7 +260,7 @@ class DatabasesPermissionsGuestTest extends Scope $moviesId = $movies['body']['$id']; - $document = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $moviesId . '/documents', [ + $document = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $moviesId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [ diff --git a/tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsMemberTest.php b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php similarity index 88% rename from tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsMemberTest.php rename to tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php index 723eeb29f5..cbc2add857 100644 --- a/tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsMemberTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php @@ -1,6 +1,6 @@ createUsers(); - $db = $this->client->call(Client::METHOD_POST, '/vectordb', $this->getServerHeader(), [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', $this->getServerHeader(), [ 'databaseId' => ID::unique(), 'name' => 'Test Database', ]); @@ -66,7 +66,7 @@ class DatabasesPermissionsMemberTest extends Scope $databaseId = $db['body']['$id']; - $public = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $public = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Movies', 'dimension' => 3, @@ -81,7 +81,7 @@ class DatabasesPermissionsMemberTest extends Scope $this->assertEquals(201, $public['headers']['status-code']); $this->collections = ['public' => $public['body']['$id']]; - $private = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $private = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Private Movies', 'dimension' => 3, @@ -96,7 +96,7 @@ class DatabasesPermissionsMemberTest extends Scope $this->assertEquals(201, $private['headers']['status-code']); $this->collections['private'] = $private['body']['$id']; - $doconly = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', $this->getServerHeader(), [ + $doconly = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::unique(), 'name' => 'Document Only Movies', 'dimension' => 3, @@ -124,7 +124,7 @@ class DatabasesPermissionsMemberTest extends Scope $collections = $data['collections']; $databaseId = $data['databaseId']; - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [1.0, 0.0, 0.0], @@ -134,7 +134,7 @@ class DatabasesPermissionsMemberTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 1.0, 0.0], @@ -144,7 +144,7 @@ class DatabasesPermissionsMemberTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 0.0, 1.0], @@ -157,7 +157,7 @@ class DatabasesPermissionsMemberTest extends Scope /** * Check "any" permission collection */ - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collections['public'] . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -170,7 +170,7 @@ class DatabasesPermissionsMemberTest extends Scope /** * Check "users" permission collection */ - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collections['private'] . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -183,7 +183,7 @@ class DatabasesPermissionsMemberTest extends Scope /** * Check "user:user1" document only permission collection */ - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collections['doconly'] . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsScope.php b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsScope.php similarity index 97% rename from tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsScope.php rename to tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsScope.php index 7d1bfb41d6..be1800b654 100644 --- a/tests/e2e/Services/Databases/VectorDB/Permissions/DatabasesPermissionsScope.php +++ b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsScope.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', $this->getServerHeader(), [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', $this->getServerHeader(), [ 'databaseId' => $this->databaseId, 'name' => 'Test Database', ]); $this->assertEquals(201, $db['headers']['status-code']); - $collection1 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ + $collection1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::custom('collection1'), 'name' => 'Collection 1', 'dimension' => 3, @@ -60,7 +60,7 @@ class DatabasesPermissionsTeamTest extends Scope $this->collections['collection1'] = $collection1['body']['$id']; - $collection2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ + $collection2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections', $this->getServerHeader(), [ 'collectionId' => ID::custom('collection2'), 'name' => 'Collection 2', 'dimension' => 3, @@ -130,7 +130,7 @@ class DatabasesPermissionsTeamTest extends Scope $this->createCollections($this->teams); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections/' . $this->collections['collection1'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections/' . $this->collections['collection1'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [1.0, 0.0, 0.0], @@ -139,7 +139,7 @@ class DatabasesPermissionsTeamTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections/' . $this->collections['collection2'] . '/documents', $this->getServerHeader(), [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections/' . $this->collections['collection2'] . '/documents', $this->getServerHeader(), [ 'documentId' => ID::unique(), 'data' => [ 'embeddings' => [0.0, 1.0, 0.0], @@ -158,7 +158,7 @@ class DatabasesPermissionsTeamTest extends Scope #[DataProvider('readDocumentsProvider')] public function testReadDocuments($user, $collection, $success, $users) { - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -176,7 +176,7 @@ class DatabasesPermissionsTeamTest extends Scope #[DataProvider('writeDocumentsProvider')] public function testWriteDocuments($user, $collection, $success, $users) { - $documents = $this->client->call(Client::METHOD_POST, '/vectordb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ + $documents = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $this->databaseId . '/collections/' . $collection . '/documents', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Services/Databases/VectorDB/Transactions/ACIDTest.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php similarity index 89% rename from tests/e2e/Services/Databases/VectorDB/Transactions/ACIDTest.php rename to tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php index 6e0e2dbd28..aa8d87eb8e 100644 --- a/tests/e2e/Services/Databases/VectorDB/Transactions/ACIDTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -41,7 +41,7 @@ class ACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection for the test - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -61,7 +61,7 @@ class ACIDTest extends Scope // Create a document outside the transaction $existingDocumentId = 'existing_doc'; - $doc1 = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc1 = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -75,7 +75,7 @@ class ACIDTest extends Scope $this->assertEquals(201, $doc1['headers']['status-code']); // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -86,7 +86,7 @@ class ACIDTest extends Scope $transactionId = $transaction['body']['$id']; // Add operations - second create reuses an existing documentId and should cause the commit to fail - $response = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -114,7 +114,7 @@ class ACIDTest extends Scope $this->assertEquals(200, $response['headers']['status-code'], 'Adding documents via normal route should succeed. Response: ' . json_encode($response['body'])); // Attempt to commit - should fail due to duplicate document ID - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -125,7 +125,7 @@ class ACIDTest extends Scope $this->assertEquals(409, $response['headers']['status-code']); // Verify NO new documents were created (atomicity) - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -140,7 +140,7 @@ class ACIDTest extends Scope public function testConsistency(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -153,7 +153,7 @@ class ACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -172,7 +172,7 @@ class ACIDTest extends Scope $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -181,7 +181,7 @@ class ACIDTest extends Scope $transactionId = $transaction['body']['$id']; // Stage operations with valid and invalid data (embedding length mismatch) - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -223,7 +223,7 @@ class ACIDTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); // Attempt to commit - should fail due to invalid embeddings - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -234,7 +234,7 @@ class ACIDTest extends Scope $this->assertContains($response['headers']['status-code'], [400, 409, 500], 'Transaction commit should fail due to validation. Response: ' . json_encode($response['body'])); // Verify no documents were created - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -248,7 +248,7 @@ class ACIDTest extends Scope public function testIsolation(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -261,7 +261,7 @@ class ACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -280,7 +280,7 @@ class ACIDTest extends Scope $collectionId = $collection['body']['$id']; // Create initial document with status metadata - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -294,7 +294,7 @@ class ACIDTest extends Scope $this->assertEquals(201, $doc['headers']['status-code']); // Create first transaction - $transaction1 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -305,7 +305,7 @@ class ACIDTest extends Scope $transactionId1 = $transaction1['body']['$id']; // Transaction 1: update status to approved - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId1}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId1}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -324,7 +324,7 @@ class ACIDTest extends Scope ]); // Commit first transaction - $response1 = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId1}", array_merge([ + $response1 = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId1}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -334,14 +334,14 @@ class ACIDTest extends Scope $this->assertEquals(200, $response1['headers']['status-code']); // Document should reflect the first transaction's update - $document = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ + $document = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals('approved', $document['body']['metadata']['status']); // Create second transaction after first commit - $transaction2 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -352,7 +352,7 @@ class ACIDTest extends Scope $transactionId2 = $transaction2['body']['$id']; // Transaction 2: update status to declined - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId2}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId2}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -371,7 +371,7 @@ class ACIDTest extends Scope ]); // Commit second transaction and ensure isolation guarantees - $response2 = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId2}", array_merge([ + $response2 = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId2}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -382,7 +382,7 @@ class ACIDTest extends Scope $this->assertEquals(200, $response2['headers']['status-code']); // Final document should reflect the second transaction's update - $document = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ + $document = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -396,7 +396,7 @@ class ACIDTest extends Scope public function testDurability(): void { // Create database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -409,7 +409,7 @@ class ACIDTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -430,7 +430,7 @@ class ACIDTest extends Scope $collectionId = $collection['body']['$id']; // Create transaction with multiple operations - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -441,7 +441,7 @@ class ACIDTest extends Scope $transactionId = $transaction['body']['$id']; // Create two documents via normal route inside transaction - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -462,7 +462,7 @@ class ACIDTest extends Scope ]); // Update first document inside the same transaction - $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -474,7 +474,7 @@ class ACIDTest extends Scope ]); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -486,14 +486,14 @@ class ACIDTest extends Scope $this->assertEquals('committed', $response['body']['status']); // Verify documents exist and have correct data - $document1 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $document1 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals(200, $document1['headers']['status-code']); $this->assertEquals('Updated important data 1', $document1['body']['metadata']['data']); - $document2 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_2", array_merge([ + $document2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_2", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -501,7 +501,7 @@ class ACIDTest extends Scope $this->assertEquals('Important data 2', $document2['body']['metadata']['data']); // Further update outside transaction to ensure persistence - $update = $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $update = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -512,14 +512,14 @@ class ACIDTest extends Scope $this->assertEquals(200, $update['headers']['status-code']); // Verify the update persisted - $document1 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ + $document1 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/durable_doc_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $this->assertEquals('Modified outside transaction', $document1['body']['metadata']['data']); // List all documents to verify total count - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); diff --git a/tests/e2e/Services/Databases/VectorDB/Transactions/TransactionsBase.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php similarity index 90% rename from tests/e2e/Services/Databases/VectorDB/Transactions/TransactionsBase.php rename to tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php index 6fe6c9e3f7..70150a3bc8 100644 --- a/tests/e2e/Services/Databases/VectorDB/Transactions/TransactionsBase.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsBase.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -39,7 +39,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; // Test creating a transaction with default TTL - $response = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -55,7 +55,7 @@ trait TransactionsBase $transactionId1 = $response['body']['$id']; // Test creating a transaction with custom TTL - $response = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -74,7 +74,7 @@ trait TransactionsBase $transactionId2 = $response['body']['$id']; // Test invalid TTL values - $response = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -83,7 +83,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -99,7 +99,7 @@ trait TransactionsBase public function testCreateOperations(): void { // Create database first - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -112,7 +112,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -121,7 +121,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Create a collection for testing - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -142,7 +142,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Add valid operations - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -175,7 +175,7 @@ trait TransactionsBase $this->assertEquals(2, $response['body']['operations']); // Test adding more operations - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -197,7 +197,7 @@ trait TransactionsBase $this->assertEquals(3, $response['body']['operations']); // Test invalid database ID - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -219,7 +219,7 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code'], 'Invalid database should return 404. Got: ' . json_encode($response['body'])); // Test invalid collection ID - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -247,7 +247,7 @@ trait TransactionsBase public function testCommit(): void { // Create database first - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -260,7 +260,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; // Create collection - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -281,7 +281,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -290,7 +290,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Add operations - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -332,7 +332,7 @@ trait TransactionsBase $this->assertEquals(3, $response['body']['operations']); // Commit the transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -344,7 +344,7 @@ trait TransactionsBase $this->assertEquals('committed', $response['body']['status']); // Verify documents were created - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -363,7 +363,7 @@ trait TransactionsBase $this->assertTrue($doc1Found, 'Document doc1 should exist with updated name'); // Test committing already committed transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -380,7 +380,7 @@ trait TransactionsBase public function testRollback(): void { // Create database first - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -393,7 +393,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -402,7 +402,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Create a collection for rollback test - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -422,7 +422,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Add operations - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -444,7 +444,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Rollback the transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -456,7 +456,7 @@ trait TransactionsBase $this->assertEquals('failed', $response['body']['status']); // Verify no documents were created - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -471,7 +471,7 @@ trait TransactionsBase public function testTransactionExpiration(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -482,7 +482,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -501,7 +501,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction with minimum TTL (60 seconds) - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -512,7 +512,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Add operation - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -534,7 +534,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Verify transaction was created with correct expiration - $txnDetails = $this->client->call(Client::METHOD_GET, "/vectordb/transactions/{$transactionId}", array_merge([ + $txnDetails = $this->client->call(Client::METHOD_GET, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -557,7 +557,7 @@ trait TransactionsBase public function testTransactionSizeLimit(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -568,7 +568,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -582,7 +582,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -606,7 +606,7 @@ trait TransactionsBase } // First batch should succeed - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -632,7 +632,7 @@ trait TransactionsBase ]; } - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -644,7 +644,7 @@ trait TransactionsBase $this->assertEquals(100, $response['body']['operations']); // Try to add one more operation - should fail - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -672,7 +672,7 @@ trait TransactionsBase public function testConcurrentTransactionConflicts(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -683,7 +683,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -701,7 +701,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create initial document - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -716,12 +716,12 @@ trait TransactionsBase $this->assertEquals(201, $doc['headers']['status-code']); // Create two transactions - $txn1 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $txn1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); - $txn2 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $txn2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -730,7 +730,7 @@ trait TransactionsBase $transactionId2 = $txn2['body']['$id']; // Both transactions try to update the same document - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId1}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId1}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -748,7 +748,7 @@ trait TransactionsBase ] ]); - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId2}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId2}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -767,7 +767,7 @@ trait TransactionsBase ]); // Commit first transaction - $response1 = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId1}", array_merge([ + $response1 = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId1}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -778,7 +778,7 @@ trait TransactionsBase $this->assertEquals(200, $response1['headers']['status-code']); // Commit second transaction - should fail with conflict - $response2 = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId2}", array_merge([ + $response2 = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId2}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -789,7 +789,7 @@ trait TransactionsBase $this->assertEquals(409, $response2['headers']['status-code']); // Conflict // Verify the document has the value from first transaction - $doc = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ + $doc = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/shared_doc", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -803,7 +803,7 @@ trait TransactionsBase public function testDeleteDocumentDuringTransaction(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -814,7 +814,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -833,7 +833,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create document - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -848,7 +848,7 @@ trait TransactionsBase $this->assertEquals(201, $doc['headers']['status-code']); // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -856,7 +856,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Add update operation to transaction - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -875,7 +875,7 @@ trait TransactionsBase ]); // Delete the document outside of transaction - $response = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/target_doc", array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/target_doc", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -884,7 +884,7 @@ trait TransactionsBase $this->assertEquals(204, $response['headers']['status-code']); // Try to commit transaction - should fail because document no longer exists - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -901,7 +901,7 @@ trait TransactionsBase public function testBulkOperations(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -912,7 +912,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -932,7 +932,7 @@ trait TransactionsBase // Create some initial documents for ($i = 1; $i <= 5; $i++) { - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -949,7 +949,7 @@ trait TransactionsBase } // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -957,7 +957,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Add bulk operations - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1011,7 +1011,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1022,7 +1022,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Verify results - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1061,7 +1061,7 @@ trait TransactionsBase public function testPartialFailureRollback(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1072,7 +1072,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1089,7 +1089,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create HNSW index on embeddings - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1103,7 +1103,7 @@ trait TransactionsBase // Create an existing document $duplicateId = ID::unique(); - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1116,7 +1116,7 @@ trait TransactionsBase ]); // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1124,7 +1124,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Add operations - mix of valid and invalid (duplicate id) - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1176,7 +1176,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Try to commit - should fail and rollback all operations - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1187,7 +1187,7 @@ trait TransactionsBase $this->assertEquals(409, $response['headers']['status-code']); // Conflict due to duplicate // Verify NO new documents were created (atomicity) - $documents = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $documents = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1202,7 +1202,7 @@ trait TransactionsBase public function testDoubleCommitRollback(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1213,7 +1213,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1227,7 +1227,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Test double commit - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1235,7 +1235,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Add operation - $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1255,7 +1255,7 @@ trait TransactionsBase ]); // First commit - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1266,7 +1266,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Second commit attempt - should fail - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1277,7 +1277,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Bad request - already committed // Test double rollback - $transaction2 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1285,7 +1285,7 @@ trait TransactionsBase $transactionId2 = $transaction2['body']['$id']; // First rollback - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId2}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId2}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1296,7 +1296,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Second rollback attempt - should fail - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId2}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId2}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1313,7 +1313,7 @@ trait TransactionsBase public function testOperationsOnNonExistentDocuments(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1324,7 +1324,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1342,7 +1342,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1350,7 +1350,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Try to update non-existent document - should fail at staging time with early validation - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1371,14 +1371,14 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code']); // Document not found at staging time // Test delete non-existent document - should also fail at staging time with early validation - $transaction2 = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); $transactionId2 = $transaction2['body']['$id']; - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId2}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId2}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1403,7 +1403,7 @@ trait TransactionsBase public function testCreateDocument(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1414,7 +1414,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1434,7 +1434,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1443,7 +1443,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Create document via normal route with transactionId - $response = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1463,7 +1463,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Document should not exist outside transaction yet - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_from_route", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_from_route", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1471,7 +1471,7 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code']); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1482,7 +1482,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Document should now exist - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_from_route", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_from_route", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1497,7 +1497,7 @@ trait TransactionsBase public function testUpdateDocument(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1508,7 +1508,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1526,7 +1526,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create document outside transaction - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1545,7 +1545,7 @@ trait TransactionsBase $this->assertEquals(201, $doc['headers']['status-code']); // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1553,7 +1553,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Update document via normal route with transactionId - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_to_update", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_to_update", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1571,7 +1571,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Document should still have original values outside transaction - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_to_update", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_to_update", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1580,7 +1580,7 @@ trait TransactionsBase $this->assertEquals(50, $response['body']['metadata']['counter']); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1591,7 +1591,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Document should now have updated values - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_to_update", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_to_update", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1606,7 +1606,7 @@ trait TransactionsBase public function testUpsertDocument(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1617,7 +1617,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1635,7 +1635,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1643,7 +1643,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Upsert document (create) via normal route with transactionId - $response = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ + $response = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1662,7 +1662,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Document should not exist outside transaction yet - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1670,7 +1670,7 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code']); // Upsert same document (update) in same transaction - $response = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ + $response = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1688,7 +1688,7 @@ trait TransactionsBase $this->assertEquals(201, $response['headers']['status-code']); // Upsert in transaction returns 201 // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1699,7 +1699,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Document should now exist with updated values - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_upsert", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1715,7 +1715,7 @@ trait TransactionsBase public function testDeleteDocument(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1726,7 +1726,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1744,7 +1744,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create document outside transaction - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1759,7 +1759,7 @@ trait TransactionsBase $this->assertEquals(201, $doc['headers']['status-code']); // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1767,7 +1767,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Delete document via normal route with transactionId - $response = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_to_delete", array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_to_delete", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1778,7 +1778,7 @@ trait TransactionsBase $this->assertEquals(204, $response['headers']['status-code']); // Document should still exist outside transaction - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_to_delete", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_to_delete", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1786,7 +1786,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1797,7 +1797,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Document should no longer exist - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/doc_to_delete", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/doc_to_delete", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1811,7 +1811,7 @@ trait TransactionsBase public function testBulkCreate(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1822,7 +1822,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1839,7 +1839,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1847,7 +1847,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Bulk create via normal route with transactionId - $response = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1884,7 +1884,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Bulk operations return 200 // Documents should not exist outside transaction yet - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1894,7 +1894,7 @@ trait TransactionsBase $this->assertEquals(0, $response['body']['total']); // Individual document check - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/bulk_create_1", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/bulk_create_1", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1902,7 +1902,7 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code']); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1913,7 +1913,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Documents should now exist - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -1924,7 +1924,7 @@ trait TransactionsBase // Verify individual documents for ($i = 1; $i <= 3; $i++) { - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/bulk_create_{$i}", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/bulk_create_{$i}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1941,7 +1941,7 @@ trait TransactionsBase public function testBulkUpdate(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1952,7 +1952,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1971,7 +1971,7 @@ trait TransactionsBase // Create documents for bulk testing for ($i = 1; $i <= 3; $i++) { - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1988,7 +1988,7 @@ trait TransactionsBase } // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -1996,7 +1996,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Bulk update via normal route with transactionId - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2009,7 +2009,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Documents should still have original category outside transaction - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2019,7 +2019,7 @@ trait TransactionsBase $this->assertEquals(3, $response['body']['total']); // Commit transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2030,7 +2030,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Documents should now have updated category - $response = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ + $response = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -2046,7 +2046,7 @@ trait TransactionsBase public function testBulkUpsert(): void { // Create database and collection - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2057,7 +2057,7 @@ trait TransactionsBase $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", array_merge([ + $collection = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2075,7 +2075,7 @@ trait TransactionsBase $collectionId = $collection['body']['$id']; // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -2084,7 +2084,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Test 1: Invalid action type - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2103,7 +2103,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 2: Missing required action field - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2121,7 +2121,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 3: Missing required databaseId field - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2139,7 +2139,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 4: Missing documentId for create operation - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2157,7 +2157,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 5: Missing data for create operation - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2175,7 +2175,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 6: BulkCreate with non-array data - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2193,7 +2193,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 7: BulkUpdate with missing queries - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2213,7 +2213,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 8: Empty operations array - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2224,7 +2224,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 9: Operations not an array - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2241,7 +2241,7 @@ trait TransactionsBase public function testCommitRollbackValidation(): void { // Create transaction - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -2250,7 +2250,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Test 1: Missing both commit and rollback - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2259,7 +2259,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 2: Both commit and rollback set to true - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2271,7 +2271,7 @@ trait TransactionsBase $this->assertEquals(400, $response['headers']['status-code']); // Test 3: Invalid transaction ID - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/invalid_id", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/invalid_id", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2282,7 +2282,7 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code']); // Commit the transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2293,7 +2293,7 @@ trait TransactionsBase $this->assertEquals(200, $response['headers']['status-code']); // Test 4: Attempt to commit already committed transaction - $response = $this->client->call(Client::METHOD_PATCH, "/vectordb/transactions/{$transactionId}", array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/transactions/{$transactionId}", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2310,7 +2310,7 @@ trait TransactionsBase public function testNonExistentResources(): void { // Create database and transaction - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2322,7 +2322,7 @@ trait TransactionsBase $this->assertEquals(201, $database['headers']['status-code']); $databaseId = $database['body']['$id']; - $transaction = $this->client->call(Client::METHOD_POST, '/vectordb/transactions', array_merge([ + $transaction = $this->client->call(Client::METHOD_POST, '/vectorsdb/transactions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -2331,7 +2331,7 @@ trait TransactionsBase $transactionId = $transaction['body']['$id']; // Test 1: Non-existent database - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -2350,7 +2350,7 @@ trait TransactionsBase $this->assertEquals(404, $response['headers']['status-code']); // Test 2: Non-existent collection - $response = $this->client->call(Client::METHOD_POST, "/vectordb/transactions/{$transactionId}/operations", array_merge([ + $response = $this->client->call(Client::METHOD_POST, "/vectorsdb/transactions/{$transactionId}/operations", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/Databases/VectorDB/Transactions/TransactionsConsoleClientTest.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php similarity index 78% rename from tests/e2e/Services/Databases/VectorDB/Transactions/TransactionsConsoleClientTest.php rename to tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php index 02f7c57da8..40ff27c572 100644 --- a/tests/e2e/Services/Databases/VectorDB/Transactions/TransactionsConsoleClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php @@ -1,6 +1,6 @@ client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -35,7 +35,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test for SUCCESS */ - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -57,7 +57,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test when database is disabled but can still create collections */ - $database = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, array_merge([ + $database = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -67,7 +67,7 @@ class VectorDBConsoleClientTest extends Scope $this->assertFalse($database['body']['enabled']); - $tvShows = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $tvShows = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -86,7 +86,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test when collection is disabled but can still modify collections */ - $database = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $movies['body']['$id'], array_merge([ + $database = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $movies['body']['$id'], array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -108,7 +108,7 @@ class VectorDBConsoleClientTest extends Scope */ $databaseId = $data['databaseId']; - $collections = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections', array_merge([ + $collections = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders())); @@ -126,7 +126,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test when database and collection are disabled but can still call get collection */ - $collection = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ + $collection = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -146,7 +146,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test When database and collection are disabled but can still call update collection */ - $collection = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ + $collection = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $moviesCollectionId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -169,7 +169,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test when database and collection are disabled but can still call delete collection */ - $response = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $tvShowsId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $tvShowsId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -186,7 +186,7 @@ class VectorDBConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -199,7 +199,7 @@ class VectorDBConsoleClientTest extends Scope * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -224,7 +224,7 @@ class VectorDBConsoleClientTest extends Scope * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -233,7 +233,7 @@ class VectorDBConsoleClientTest extends Scope $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/randomCollectionId/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/randomCollectionId/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -245,7 +245,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/usage', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -265,7 +265,7 @@ class VectorDBConsoleClientTest extends Scope /** * Test for SUCCESS */ - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -274,7 +274,7 @@ class VectorDBConsoleClientTest extends Scope $this->assertIsArray($logs['body']['logs']); $this->assertIsNumeric($logs['body']['total']); - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -286,7 +286,7 @@ class VectorDBConsoleClientTest extends Scope $this->assertLessThanOrEqual(1, count($logs['body']['logs'])); $this->assertIsNumeric($logs['body']['total']); - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -297,7 +297,7 @@ class VectorDBConsoleClientTest extends Scope $this->assertIsArray($logs['body']['logs']); $this->assertIsNumeric($logs['body']['total']); - $logs = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ + $logs = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $data['moviesId'] . '/logs', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ diff --git a/tests/e2e/Services/Databases/VectorDBCustomClientTest.php b/tests/e2e/Services/Databases/VectorsDBCustomClientTest.php similarity index 89% rename from tests/e2e/Services/Databases/VectorDBCustomClientTest.php rename to tests/e2e/Services/Databases/VectorsDBCustomClientTest.php index 83ef3ba5ca..7add5c7f71 100644 --- a/tests/e2e/Services/Databases/VectorDBCustomClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDBCustomClientTest.php @@ -6,12 +6,12 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; -use Tests\E2E\Services\Databases\VectorDB\DatabasesBase; +use Tests\E2E\Services\Databases\VectorsDB\DatabasesBase; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; -class VectorDBCustomClientTest extends Scope +class VectorsDBCustomClientTest extends Scope { use DatabasesBase; use ProjectCustom; @@ -23,7 +23,7 @@ class VectorDBCustomClientTest extends Scope * Test for SUCCESS */ - $database = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -35,7 +35,7 @@ class VectorDBCustomClientTest extends Scope $databaseId = $database['body']['$id']; // Collection aliases write to create, update, delete - $movies = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $movies = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -55,10 +55,10 @@ class VectorDBCustomClientTest extends Scope $this->assertContains(Permission::update(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); $this->assertContains(Permission::delete(Role::user($this->getUser()['$id'])), $movies['body']['$permissions']); - // VectorDB uses fixed schema (embeddings, metadata). No attribute creation needed. + // VectorsDB uses fixed schema (embeddings, metadata). No attribute creation needed. // Document aliases write to update, delete - $document1 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ + $document1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -81,7 +81,7 @@ class VectorDBCustomClientTest extends Scope */ // Document does not allow create permission - $document2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ + $document2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $moviesId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -109,7 +109,7 @@ class VectorDBCustomClientTest extends Scope $userId = $response['body']['$id']; - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -122,7 +122,7 @@ class VectorDBCustomClientTest extends Scope $databaseId = $database['body']['$id']; // Create collection - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -136,7 +136,7 @@ class VectorDBCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); // Creating document by server, give read permission to our user + some other user - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/permissionCheck/documents', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/permissionCheck/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -158,7 +158,7 @@ class VectorDBCustomClientTest extends Scope // Update document // This is the point of this test. We should be allowed to do this action, and it should not fail on permission check - $response = $this->client->call(Client::METHOD_PATCH, '/vectordb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ + $response = $this->client->call(Client::METHOD_PATCH, '/vectorsdb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'] ], $this->getHeaders()), [ @@ -171,7 +171,7 @@ class VectorDBCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); // Get name of the document, should be the new one - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/permissionCheck/documents/permissionCheckDocument', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -180,7 +180,7 @@ class VectorDBCustomClientTest extends Scope // Cleanup to prevent collision with other tests // Delete collection - $response = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/permissionCheck', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/permissionCheck', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -193,7 +193,7 @@ class VectorDBCustomClientTest extends Scope sleep(2); // Make sure collection has been deleted - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/permissionCheck', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/permissionCheck', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/Databases/VectorDBCustomServerTest.php b/tests/e2e/Services/Databases/VectorsDBCustomServerTest.php similarity index 90% rename from tests/e2e/Services/Databases/VectorDBCustomServerTest.php rename to tests/e2e/Services/Databases/VectorsDBCustomServerTest.php index f7aeb8725c..ceb672443e 100644 --- a/tests/e2e/Services/Databases/VectorDBCustomServerTest.php +++ b/tests/e2e/Services/Databases/VectorsDBCustomServerTest.php @@ -7,13 +7,13 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Tests\E2E\Services\Databases\VectorDB\DatabasesBase; +use Tests\E2E\Services\Databases\VectorsDB\DatabasesBase; use Utopia\Database\Database; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; -class VectorDBCustomServerTest extends Scope +class VectorsDBCustomServerTest extends Scope { use DatabasesBase; use ProjectCustom; @@ -21,7 +21,7 @@ class VectorDBCustomServerTest extends Scope public function testListDatabases(): array { - $db1 = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db1 = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -31,14 +31,14 @@ class VectorDBCustomServerTest extends Scope ]); $this->assertEquals(201, $db1['headers']['status-code']); $this->assertEquals('Test 1', $db1['body']['name']); - $this->assertEquals('vectordb', $db1['body']['type']); + $this->assertEquals('vectorsdb', $db1['body']['type']); // Validate database response model fields on create $this->assertArrayHasKey('$id', $db1['body']); $this->assertArrayHasKey('$createdAt', $db1['body']); $this->assertArrayHasKey('$updatedAt', $db1['body']); $this->assertArrayHasKey('enabled', $db1['body']); - $db2 = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db2 = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -48,9 +48,9 @@ class VectorDBCustomServerTest extends Scope ]); $this->assertEquals(201, $db2['headers']['status-code']); $this->assertEquals('Test 2', $db2['body']['name']); - $this->assertEquals('vectordb', $db2['body']['type']); + $this->assertEquals('vectorsdb', $db2['body']['type']); - $list = $this->client->call(Client::METHOD_GET, '/vectordb', [ + $list = $this->client->call(Client::METHOD_GET, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -70,7 +70,7 @@ class VectorDBCustomServerTest extends Scope public function testGetDatabase(array $data): array { $databaseId = $data['databaseId']; - $res = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId, [ + $res = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -78,7 +78,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(200, $res['headers']['status-code']); $this->assertEquals($databaseId, $res['body']['$id']); $this->assertEquals('Test 1', $res['body']['name']); - $this->assertEquals('vectordb', $res['body']['type']); + $this->assertEquals('vectorsdb', $res['body']['type']); return ['databaseId' => $databaseId]; } @@ -86,7 +86,7 @@ class VectorDBCustomServerTest extends Scope public function testUpdateDatabase(array $data): array { $databaseId = $data['databaseId']; - $res = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $res = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -95,7 +95,7 @@ class VectorDBCustomServerTest extends Scope ]); $this->assertEquals(200, $res['headers']['status-code']); $this->assertEquals('Test 1 Updated', $res['body']['name']); - $this->assertEquals('vectordb', $res['body']['type']); + $this->assertEquals('vectorsdb', $res['body']['type']); return ['databaseId' => $databaseId]; } @@ -103,7 +103,7 @@ class VectorDBCustomServerTest extends Scope public function testDeleteDatabase(array $data): void { $databaseId = $data['databaseId']; - $del = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $del = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -111,7 +111,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(204, $del['headers']['status-code']); $this->assertEquals("", $del['body']); - $get = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId, [ + $get = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -122,7 +122,7 @@ class VectorDBCustomServerTest extends Scope public function testCollectionsCRUD(): array { // Create database for collections tests - $database = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -134,7 +134,7 @@ class VectorDBCustomServerTest extends Scope $databaseId = $database['body']['$id']; // Create two collections - $col1 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col1 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -159,7 +159,7 @@ class VectorDBCustomServerTest extends Scope $this->assertArrayHasKey('documentSecurity', $col1['body']); $this->assertArrayHasKey('dimension', $col1['body']); - $col2 = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $col2 = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -181,7 +181,7 @@ class VectorDBCustomServerTest extends Scope $this->assertArrayHasKey('$updatedAt', $col2['body']); // List collections - $list = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections', [ + $list = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -195,7 +195,7 @@ class VectorDBCustomServerTest extends Scope $this->assertArrayHasKey('dimension', $list['body']['collections'][0]); // Get collection - $get = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ + $get = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -206,7 +206,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(3, $get['body']['dimension']); // Update collection (name only) - $upd = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ + $upd = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $col1['body']['$id'], [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -218,7 +218,7 @@ class VectorDBCustomServerTest extends Scope $this->assertArrayHasKey('$updatedAt', $upd['body']); // Delete collection - $del = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $col2['body']['$id'], [ + $del = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $col2['body']['$id'], [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -239,7 +239,7 @@ class VectorDBCustomServerTest extends Scope $collectionId = $data['collectionId']; // Update collection name and dimensions - $upd = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $upd = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -252,7 +252,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(4, $upd['body']['dimension']); // Read back to confirm - $get = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $get = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -271,7 +271,7 @@ class VectorDBCustomServerTest extends Scope $collectionId = $data['collectionId']; // Disable collection - $disable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $disable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -283,7 +283,7 @@ class VectorDBCustomServerTest extends Scope $this->assertFalse($disable['body']['enabled']); // Re-enable collection - $enable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $enable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -300,7 +300,7 @@ class VectorDBCustomServerTest extends Scope public function testUpdateDatabaseNameAndEnabled(): void { // Create isolated database for this test to avoid ordering conflicts - $create = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $create = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -312,7 +312,7 @@ class VectorDBCustomServerTest extends Scope $databaseId = $create['body']['$id']; // Update name - $rename = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $rename = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -323,7 +323,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals('Test DB Renamed', $rename['body']['name']); // Toggle enabled off then on - $disable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $disable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -334,7 +334,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(200, $disable['headers']['status-code']); $this->assertFalse($disable['body']['enabled']); - $enable = $this->client->call(Client::METHOD_PUT, '/vectordb/' . $databaseId, [ + $enable = $this->client->call(Client::METHOD_PUT, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -346,7 +346,7 @@ class VectorDBCustomServerTest extends Scope $this->assertTrue($enable['body']['enabled']); // Cleanup - $del = $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $del = $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -361,7 +361,7 @@ class VectorDBCustomServerTest extends Scope $collectionId = $data['collectionId']; // Create a new index variant - $create = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $create = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -373,7 +373,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(202, $create['headers']['status-code']); // Ensure it exists - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -382,7 +382,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals('embedding_euclidean_v2', $get['body']['key']); // Delete it - $del = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ + $del = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean_v2", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -397,7 +397,7 @@ class VectorDBCustomServerTest extends Scope $collectionId = $data['collectionId']; // Create indexes - $eu = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $eu = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -408,7 +408,7 @@ class VectorDBCustomServerTest extends Scope ]); $this->assertEquals(202, $eu['headers']['status-code']); - $dot = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $dot = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -419,7 +419,7 @@ class VectorDBCustomServerTest extends Scope ]); $this->assertEquals(202, $dot['headers']['status-code']); - $cos = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $cos = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -431,7 +431,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(202, $cos['headers']['status-code']); // List indexes - $list = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes", [ + $list = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -444,7 +444,7 @@ class VectorDBCustomServerTest extends Scope $this->assertContains('embedding_cosine', $keys); // Get index by key - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_euclidean", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -454,7 +454,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(Database::INDEX_HNSW_EUCLIDEAN, $get['body']['type']); // Delete index - $del = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ + $del = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -462,7 +462,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(204, $del['headers']['status-code']); sleep(4); // Ensure it's gone - $getMissing = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ + $getMissing = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/indexes/embedding_dot", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -473,7 +473,7 @@ class VectorDBCustomServerTest extends Scope public function testBulkCreate(): array { // Setup: create isolated database and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -484,7 +484,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -511,7 +511,7 @@ class VectorDBCustomServerTest extends Scope ], ]; - $res = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -531,7 +531,7 @@ class VectorDBCustomServerTest extends Scope // Fetch and validate persisted data via GET foreach ($ids as $i => $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -549,7 +549,7 @@ class VectorDBCustomServerTest extends Scope public function testCreateTextEmbeddingsSuccessAndErrors(): void { // Setup new database and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -560,7 +560,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -576,7 +576,7 @@ class VectorDBCustomServerTest extends Scope // Success: two embeddings $this->assertEventually(function () { - $ok = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $ok = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -602,7 +602,7 @@ class VectorDBCustomServerTest extends Scope }, 3000, 100); // Error: missing texts payload - $missingTexts = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $missingTexts = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -610,7 +610,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(400, $missingTexts['headers']['status-code']); // Error: invalid texts item type (must be strings) - $invalidItem = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $invalidItem = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -624,7 +624,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(400, $invalidItem['headers']['status-code']); // Error: unknown embedding model - $unknownModel = $this->client->call(Client::METHOD_POST, "/vectordb/embeddings/text", [ + $unknownModel = $this->client->call(Client::METHOD_POST, "/vectorsdb/embeddings/text", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -638,7 +638,7 @@ class VectorDBCustomServerTest extends Scope public function testBulkUpsert(): void { // Setup fresh db/collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -646,7 +646,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -673,7 +673,7 @@ class VectorDBCustomServerTest extends Scope ], ]; - $res = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -690,7 +690,7 @@ class VectorDBCustomServerTest extends Scope // Fetch and validate updated content $ids = array_map(fn ($d) => $d['$id'], $res['body']['documents']); foreach ($ids as $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -704,7 +704,7 @@ class VectorDBCustomServerTest extends Scope [ 'embeddings' => [0.6, 0.4, 0.0], 'metadata' => ['updatedAgain' => true] ], [ 'embeddings' => [0.3, 0.7, 0.0], 'metadata' => ['updatedAgain' => true] ], ]; - $res2 = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res2 = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -718,7 +718,7 @@ class VectorDBCustomServerTest extends Scope // Fetch again and assert second update persisted $ids2 = array_map(fn ($d) => $d['$id'], $res2['body']['documents']); foreach ($ids2 as $id) { - $get2 = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get2 = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -731,7 +731,7 @@ class VectorDBCustomServerTest extends Scope public function testBulkUpdate(): void { // Setup: create db/collection and two docs - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -739,7 +739,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -753,7 +753,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $col['headers']['status-code']); $collectionId = $col['body']['$id']; - $seed = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $seed = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -766,7 +766,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(200, $seed['headers']['status-code']); $ids = array_map(fn ($d) => $d['$id'], $seed['body']['documents']); - $res = $this->client->call(Client::METHOD_PATCH, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_PATCH, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -786,7 +786,7 @@ class VectorDBCustomServerTest extends Scope // Fetch by IDs and assert update persisted foreach ($ids as $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -799,7 +799,7 @@ class VectorDBCustomServerTest extends Scope public function testBulkDelete(): void { // Setup: create db/collection and two docs - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -807,7 +807,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -821,7 +821,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $col['headers']['status-code']); $collectionId = $col['body']['$id']; - $seed = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $seed = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -834,7 +834,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(200, $seed['headers']['status-code']); $ids = array_map(fn ($d) => $d['$id'], $seed['body']['documents']); - $res = $this->client->call(Client::METHOD_DELETE, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $res = $this->client->call(Client::METHOD_DELETE, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -849,7 +849,7 @@ class VectorDBCustomServerTest extends Scope // Ensure they are deleted foreach ($ids as $id) { - $get = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ + $get = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$id}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -861,7 +861,7 @@ class VectorDBCustomServerTest extends Scope public function testCustomTimestamps(): void { // Setup: create database and collection - $db = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $db = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -872,7 +872,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals(201, $db['headers']['status-code']); $databaseId = $db['body']['$id']; - $col = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections", [ + $col = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -893,7 +893,7 @@ class VectorDBCustomServerTest extends Scope $vector[0] = 1.0; $documentId = ID::unique(); - $doc = $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$collectionId}/documents", [ + $doc = $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -916,7 +916,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals($customUpdatedAt, $doc['body']['$updatedAt'], 'UpdatedAt should match custom timestamp'); // Fetch document and verify timestamps persist - $fetched = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $fetched = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -931,7 +931,7 @@ class VectorDBCustomServerTest extends Scope $vector2 = array_fill(0, 1536, 0.0); $vector2[1] = 1.0; - $updated = $this->client->call(Client::METHOD_PUT, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $updated = $this->client->call(Client::METHOD_PUT, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -949,7 +949,7 @@ class VectorDBCustomServerTest extends Scope $this->assertEquals($newCustomUpdatedAt, $updated['body']['$updatedAt'], 'UpdatedAt should be updated to new custom timestamp'); // Final verification - $final = $this->client->call(Client::METHOD_GET, "/vectordb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ + $final = $this->client->call(Client::METHOD_GET, "/vectorsdb/{$databaseId}/collections/{$collectionId}/documents/{$documentId}", [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index c63c75d705..d6acd333f0 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -1718,7 +1718,7 @@ trait MigrationsBase } /** - * Import VectorDB documents from CSV + * Import VectorsDB documents from CSV */ public function testImportVectordbCSV(): void { @@ -1727,7 +1727,7 @@ trait MigrationsBase $bucketId = null; try { - $database = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1739,7 +1739,7 @@ trait MigrationsBase $this->assertEquals(201, $database['headers']['status-code']); $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -1773,7 +1773,7 @@ trait MigrationsBase 'x-appwrite-key' => $this->getProject()['apiKey'], ], [ 'fileId' => ID::unique(), - 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/csv/vectordb-documents.csv'), 'text/csv', 'vectordb-documents.csv'), + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/csv/vectorsdb-documents.csv'), 'text/csv', 'vectorsdb-documents.csv'), ]); $this->assertEquals(201, $file['headers']['status-code']); @@ -1805,7 +1805,7 @@ trait MigrationsBase return true; }, 60_000, 500); - $documents = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + $documents = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -1831,7 +1831,7 @@ trait MigrationsBase } if ($databaseId) { - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -1841,14 +1841,14 @@ trait MigrationsBase } /** - * Export VectorDB documents to CSV + * Export VectorsDB documents to CSV */ public function testExportVectordbCSV(): void { $databaseId = null; try { - $database = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -1860,7 +1860,7 @@ trait MigrationsBase $this->assertEquals(201, $database['headers']['status-code']); $databaseId = $database['body']['$id']; - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -1892,7 +1892,7 @@ trait MigrationsBase ]; foreach ($documentsPayload as $payload) { - $response = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -1901,7 +1901,7 @@ trait MigrationsBase $this->assertEquals(201, $response['headers']['status-code']); } - $filename = 'vectordb-export-' . ID::unique(); + $filename = 'vectorsdb-export-' . ID::unique(); $migration = $this->client->call(Client::METHOD_POST, '/migrations/csv/exports', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -1958,7 +1958,7 @@ trait MigrationsBase $this->assertStringContainsString('[0.11,0.22,0.33]', $csvData); } finally { if ($databaseId) { - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -2030,11 +2030,11 @@ trait MigrationsBase } /** - * VectorDB (embeddings collections) + * VectorsDB (embeddings collections) */ - public function testAppwriteMigrationVectorDBDatabase(): array + public function testAppwriteMigrationVectorsDBDatabase(): array { - $response = $this->client->call(Client::METHOD_POST, '/vectordb', [ + $response = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -2051,7 +2051,7 @@ trait MigrationsBase $result = $this->performMigrationSync([ 'resources' => [ - Resource::TYPE_DATABASE_VECTORDB, + Resource::TYPE_DATABASE_VECTORSDBS, ], 'endpoint' => $this->endpoint, 'projectId' => $this->getProject()['$id'], @@ -2059,11 +2059,11 @@ trait MigrationsBase ]); $this->assertEquals('completed', $result['status']); - $this->assertEquals([Resource::TYPE_DATABASE_VECTORDB], $result['resources']); - $this->assertArrayHasKey(Resource::TYPE_DATABASE_VECTORDB, $result['statusCounters']); - $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORDB]['error'] ?? 0); + $this->assertEquals([Resource::TYPE_DATABASE_VECTORSDBS], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_DATABASE_VECTORSDBS, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORSDBS]['error'] ?? 0); - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId, [ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2076,7 +2076,7 @@ trait MigrationsBase $this->assertEquals('VDB - Migration DB', $response['body']['name']); // Cleanup on destination - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2087,12 +2087,12 @@ trait MigrationsBase ]; } - #[Depends('testAppwriteMigrationVectorDBDatabase')] - public function testAppwriteMigrationVectorDBCollection(array $data): array + #[Depends('testAppwriteMigrationVectorsDBDatabase')] + public function testAppwriteMigrationVectorsDBCollection(array $data): array { $databaseId = $data['databaseId']; - $collection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', [ + $collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -2108,7 +2108,7 @@ trait MigrationsBase $result = $this->performMigrationSync([ 'resources' => [ - Resource::TYPE_DATABASE_VECTORDB, + Resource::TYPE_DATABASE_VECTORSDBS, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE, ], @@ -2118,7 +2118,7 @@ trait MigrationsBase ]); $this->assertEquals('completed', $result['status']); - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2133,7 +2133,7 @@ trait MigrationsBase $this->assertIsArray($response['body']['attributes']); // Cleanup - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2145,13 +2145,13 @@ trait MigrationsBase ]; } - #[Depends('testAppwriteMigrationVectorDBCollection')] - public function testAppwriteMigrationVectorDBDocument(array $data): void + #[Depends('testAppwriteMigrationVectorsDBCollection')] + public function testAppwriteMigrationVectorsDBDocument(array $data): void { $databaseId = $data['databaseId']; $collectionId = $data['collectionId']; - $document = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + $document = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -2169,7 +2169,7 @@ trait MigrationsBase // Ensure attributes are exported before documents $result = $this->performMigrationSync([ 'resources' => [ - Resource::TYPE_DATABASE_VECTORDB, + Resource::TYPE_DATABASE_VECTORSDBS, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE, Resource::TYPE_DOCUMENT, @@ -2180,11 +2180,11 @@ trait MigrationsBase ]); $this->assertEquals('completed', $result['status']); - // Verify that TYPE_ATTRIBUTE appears in the resources array for VectorDB - $this->assertContains(Resource::TYPE_ATTRIBUTE, $result['resources'], 'TYPE_ATTRIBUTE should be in resources array for VectorDB'); + // Verify that TYPE_ATTRIBUTE appears in the resources array for VectorsDB + $this->assertContains(Resource::TYPE_ATTRIBUTE, $result['resources'], 'TYPE_ATTRIBUTE should be in resources array for VectorsDB'); // Verify attributes exist on destination before checking document - $collectionResponse = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collectionId, [ + $collectionResponse = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2194,7 +2194,7 @@ trait MigrationsBase $this->assertArrayHasKey('attributes', $collectionResponse['body']); $this->assertIsArray($collectionResponse['body']['attributes']); - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, [ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2206,13 +2206,13 @@ trait MigrationsBase $this->assertEquals('Migration Test Movie', $response['body']['metadata']['title']); // Cleanup - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], ]); - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -2517,22 +2517,22 @@ trait MigrationsBase $this->assertEquals(201, $document['headers']['status-code']); $documentId = $document['body']['$id']; - // ====== Create VectorDB (/vectordb) with collection and document ====== - $vector = $this->client->call(Client::METHOD_POST, '/vectordb', [ + // ====== Create VectorsDB (/vectorsdb) with collection and document ====== + $vector = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], ], [ 'databaseId' => ID::unique(), - 'name' => 'Mixed VectorDB', + 'name' => 'Mixed VectorsDB', ]); $this->assertEquals(201, $vector['headers']['status-code']); $this->assertNotEmpty($vector['body']['$id']); $vectorDatabaseId = $vector['body']['$id']; - // Create Collection in VectorDB - $vectorCollection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $vectorDatabaseId . '/collections', [ + // Create Collection in VectorsDB + $vectorCollection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $vectorDatabaseId . '/collections', [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], @@ -2545,9 +2545,9 @@ trait MigrationsBase $this->assertEquals(201, $vectorCollection['headers']['status-code']); $vectorCollectionId = $vectorCollection['body']['$id']; - // Wait for VectorDB collection attributes to be ready + // Wait for VectorsDB collection attributes to be ready $this->assertEventually(function () use ($vectorDatabaseId, $vectorCollectionId, $sourceProject) { - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId, [ + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], @@ -2570,7 +2570,7 @@ trait MigrationsBase }, 10000, 500); $metadataIndexKey = '_key_metadata'; - $vectorIndexes = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes', [ + $vectorIndexes = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes', [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], @@ -2587,7 +2587,7 @@ trait MigrationsBase $this->assertEquals(Database::INDEX_OBJECT, $metadataIndex['type']); $vectorEmbeddingIndexKey = 'embedding_euclidean'; - $vectorEmbeddingIndex = $this->client->call(Client::METHOD_POST, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes', [ + $vectorEmbeddingIndex = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes', [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], @@ -2599,7 +2599,7 @@ trait MigrationsBase $this->assertEquals(202, $vectorEmbeddingIndex['headers']['status-code']); $this->assertEventually(function () use ($vectorDatabaseId, $vectorCollectionId, $vectorEmbeddingIndexKey, $sourceProject) { - $index = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes/' . $vectorEmbeddingIndexKey, [ + $index = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes/' . $vectorEmbeddingIndexKey, [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], @@ -2612,8 +2612,8 @@ trait MigrationsBase } }, 30000, 500); - // Create Document in VectorDB Collection - $vectorDocument = $this->client->call(Client::METHOD_POST, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/documents', [ + // Create Document in VectorsDB Collection + $vectorDocument = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/documents', [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], @@ -2638,7 +2638,7 @@ trait MigrationsBase Resource::TYPE_DATABASE_DOCUMENTSDB, Resource::TYPE_COLLECTION, Resource::TYPE_DOCUMENT, - Resource::TYPE_DATABASE_VECTORDB, + Resource::TYPE_DATABASE_VECTORSDBS, Resource::TYPE_ATTRIBUTE, Resource::TYPE_INDEX, ], @@ -2661,7 +2661,7 @@ trait MigrationsBase Resource::TYPE_DATABASE_DOCUMENTSDB, Resource::TYPE_COLLECTION, Resource::TYPE_DOCUMENT, - Resource::TYPE_DATABASE_VECTORDB, + Resource::TYPE_DATABASE_VECTORSDBS, Resource::TYPE_ATTRIBUTE, Resource::TYPE_INDEX, ], $result['resources']); @@ -2734,7 +2734,7 @@ trait MigrationsBase return $pendingCount === 0; }, 30000, 1000); // 30 second timeout, check every 1 second - // Assert Collection counters (covers both DocumentsDB and VectorDB collections) + // Assert Collection counters (covers both DocumentsDB and VectorsDB collections) $this->assertArrayHasKey(Resource::TYPE_COLLECTION, $result['statusCounters']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_COLLECTION]['error']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_COLLECTION]['pending']); @@ -2744,7 +2744,7 @@ trait MigrationsBase // Get migration status before asserting Document counters $result = $this->getMigrationStatus($migrationId); - // Assert Document counters (covers both DocumentsDB and VectorDB documents) + // Assert Document counters (covers both DocumentsDB and VectorsDB documents) $this->assertArrayHasKey(Resource::TYPE_DOCUMENT, $result['statusCounters']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DOCUMENT]['error']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DOCUMENT]['pending']); @@ -2752,19 +2752,19 @@ trait MigrationsBase $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DOCUMENT]['processing']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DOCUMENT]['warning']); - // Get migration status before asserting VectorDB counters + // Get migration status before asserting VectorsDB counters $result = $this->getMigrationStatus($migrationId); - // Assert VectorDB counters - $this->assertArrayHasKey(Resource::TYPE_DATABASE_VECTORDB, $result['statusCounters']); - $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORDB]['error']); - $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORDB]['pending']); - $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORDB]['success']); - $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORDB]['processing']); - $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORDB]['warning']); + // Assert VectorsDB counters + $this->assertArrayHasKey(Resource::TYPE_DATABASE_VECTORSDBS, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORSDBS]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORSDBS]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORSDBS]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORSDBS]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE_VECTORSDBS]['warning']); // Get migration status before asserting Attribute counters $result = $this->getMigrationStatus($migrationId); - // Assert Attribute counters (for VectorDB) + // Assert Attribute counters (for VectorsDB) $this->assertArrayHasKey(Resource::TYPE_ATTRIBUTE, $result['statusCounters']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_ATTRIBUTE]['error']); $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_ATTRIBUTE]['pending']); @@ -2889,8 +2889,8 @@ trait MigrationsBase $this->assertEquals(['email'], $documentsIndexDestination['body']['attributes']); } - // ====== Validate on destination: VectorDB resources ====== - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId, [ + // ====== Validate on destination: VectorsDB resources ====== + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2898,10 +2898,10 @@ trait MigrationsBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals($vectorDatabaseId, $response['body']['$id']); - $this->assertEquals('Mixed VectorDB', $response['body']['name']); + $this->assertEquals('Mixed VectorsDB', $response['body']['name']); - // Validate VectorDB Collection - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId, [ + // Validate VectorsDB Collection + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2914,7 +2914,7 @@ trait MigrationsBase $this->assertArrayHasKey('attributes', $response['body']); $this->assertIsArray($response['body']['attributes']); - $vectorIndexesDestination = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes', [ + $vectorIndexesDestination = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/indexes', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2931,8 +2931,8 @@ trait MigrationsBase $this->assertArrayHasKey($vectorEmbeddingIndexKey, $indexByKey, 'Embeddings HNSW index should exist on destination'); $this->assertEquals(Database::INDEX_HNSW_EUCLIDEAN, $indexByKey[$vectorEmbeddingIndexKey]['type']); - // Validate VectorDB Document - $response = $this->client->call(Client::METHOD_GET, '/vectordb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/documents/' . $vectorDocumentId, [ + // Validate VectorsDB Document + $response = $this->client->call(Client::METHOD_GET, '/vectorsdb/' . $vectorDatabaseId . '/collections/' . $vectorCollectionId . '/documents/' . $vectorDocumentId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2955,7 +2955,7 @@ trait MigrationsBase 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], ]); - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $vectorDatabaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $vectorDatabaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'], @@ -2974,7 +2974,7 @@ trait MigrationsBase 'x-appwrite-key' => $sourceProject['apiKey'], ]); - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $vectorDatabaseId, [ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $vectorDatabaseId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $sourceProject['$id'], 'x-appwrite-key' => $sourceProject['apiKey'], diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index cbb84e2775..9debb1f937 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -177,15 +177,15 @@ class ProjectsConsoleClientTest extends Scope ]); $this->assertEquals(201, $documentsCollection['headers']['status-code']); - // Create vectordb database and collection - $vectorDb = $this->client->call(Client::METHOD_POST, '/vectordb', $projectAdminHeaders, [ + // Create vectorsdb database and collection + $vectorDb = $this->client->call(Client::METHOD_POST, '/vectorsdb', $projectAdminHeaders, [ 'databaseId' => ID::unique(), 'name' => 'Vector DB', ]); $this->assertEquals(201, $vectorDb['headers']['status-code']); $vectorDbId = $vectorDb['body']['$id']; - $vectorCollection = $this->client->call(Client::METHOD_POST, '/vectordb/' . $vectorDbId . '/collections', $projectAdminHeaders, [ + $vectorCollection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $vectorDbId . '/collections', $projectAdminHeaders, [ 'collectionId' => ID::unique(), 'name' => 'Vector Collection', 'dimension' => 3, diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 2c949ca07e..774d0016f9 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -5061,7 +5061,7 @@ class RealtimeCustomClientTest extends Scope $client->close(); } - public function testChannelVectorDB() + public function testChannelVectorsDB() { $user = $this->getUser(); $session = $user['session'] ?? ''; @@ -5084,8 +5084,8 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']['user']); $this->assertEquals($user['$id'], $response['data']['user']['$id']); - // Create VectorDB database - $database = $this->client->call(Client::METHOD_POST, '/vectordb', array_merge([ + // Create VectorsDB database + $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -5096,8 +5096,8 @@ class RealtimeCustomClientTest extends Scope $databaseId = $database['body']['$id']; - // Create collection in VectorDB - $actors = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections', array_merge([ + // Create collection in VectorsDB + $actors = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -5113,8 +5113,8 @@ class RealtimeCustomClientTest extends Scope $actorsId = $actors['body']['$id']; - // Create document in VectorDB - $document = $this->client->call(Client::METHOD_POST, '/vectordb/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ + // Create document in VectorsDB + $document = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections/' . $actorsId . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -5138,18 +5138,18 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('event', $response['type']); $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); - // vectordb channels should include 3 items like documentsdb + // vectorsdb channels should include 3 items like documentsdb $this->assertCount(3, $response['data']['channels']); $this->assertContains('documents', $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); $this->assertNotEmpty($response['data']['payload']); $this->assertIsArray($response['data']['payload']['embeddings']); $this->assertCount(3, $response['data']['payload']['embeddings']); $this->assertEquals('Chris Evans', $response['data']['payload']['metadata']['name']); // Update document - $this->client->call(Client::METHOD_PATCH, '/vectordb/' . $databaseId . '/collections/' . $actorsId . '/documents/' . $documentId, array_merge([ + $this->client->call(Client::METHOD_PATCH, '/vectorsdb/' . $databaseId . '/collections/' . $actorsId . '/documents/' . $documentId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -5171,14 +5171,14 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); $this->assertCount(3, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); $this->assertNotEmpty($response['data']['payload']); $this->assertIsArray($response['data']['payload']['embeddings']); $this->assertEquals('Chris Evans 2', $response['data']['payload']['metadata']['name']); // Delete document - $this->client->call(Client::METHOD_DELETE, '/vectordb/' . $databaseId . '/collections/' . $actorsId . '/documents/' . $documentId, array_merge([ + $this->client->call(Client::METHOD_DELETE, '/vectorsdb/' . $databaseId . '/collections/' . $actorsId . '/documents/' . $documentId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); @@ -5190,11 +5190,11 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); $this->assertCount(3, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $documentId, $response['data']['channels']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents', $response['data']['channels']); // Bulk create two documents - $this->client->call(Client::METHOD_POST, "/vectordb/{$databaseId}/collections/{$actorsId}/documents", array_merge([ + $this->client->call(Client::METHOD_POST, "/vectorsdb/{$databaseId}/collections/{$actorsId}/documents", array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] @@ -5229,10 +5229,10 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); $this->assertCount(3, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $response['data']['payload']['$id'] . '.create', $response['data']['events']); - $this->assertContains('vectordb.*.collections.*.documents.*.create', $response['data']['events']); - $this->assertContains('vectordb.' . $databaseId . '.collections.*.documents.*.create', $response['data']['events']); - $this->assertContains('vectordb.*.collections.' . $actorsId . '.documents.*.create', $response['data']['events']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $response['data']['payload']['$id'] . '.create', $response['data']['events']); + $this->assertContains('vectorsdb.*.collections.*.documents.*.create', $response['data']['events']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.*.documents.*.create', $response['data']['events']); + $this->assertContains('vectorsdb.*.collections.' . $actorsId . '.documents.*.create', $response['data']['events']); $this->assertNotEmpty($response['data']['payload']); $this->assertIsArray($response['data']['payload']); @@ -5244,7 +5244,7 @@ class RealtimeCustomClientTest extends Scope $this->assertNotEmpty($response['data']); $this->assertArrayHasKey('timestamp', $response['data']); $this->assertCount(3, $response['data']['channels']); - $this->assertContains('vectordb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $response['data']['payload']['$id'] . '.create', $response['data']['events']); + $this->assertContains('vectorsdb.' . $databaseId . '.collections.' . $actorsId . '.documents.' . $response['data']['payload']['$id'] . '.create', $response['data']['events']); $client->close(); } diff --git a/tests/resources/csv/vectordb-documents.csv b/tests/resources/csv/vectorsdb-documents.csv similarity index 100% rename from tests/resources/csv/vectordb-documents.csv rename to tests/resources/csv/vectorsdb-documents.csv