mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
renamed vectordb to vectordb
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 => '',
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -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');
|
||||
|
||||
+16
-16
@@ -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
|
||||
];
|
||||
|
||||
+8
-8
@@ -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());
|
||||
|
||||
@@ -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'],
|
||||
],
|
||||
|
||||
@@ -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 => '',
|
||||
};
|
||||
|
||||
|
||||
+18
-18
@@ -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
|
||||
|
||||
@@ -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')
|
||||
];
|
||||
|
||||
@@ -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}";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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';
|
||||
|
||||
@@ -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'] ?? [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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']])
|
||||
]));
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
@@ -32,19 +32,19 @@ class Create extends CollectionAction
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBCollection';
|
||||
return 'createVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDBS_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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;
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Delete as CollectionDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,19 +15,19 @@ class Delete extends CollectionDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBCollection';
|
||||
return 'deleteVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDBS_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Delete as DocumentsDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Delete extends DocumentsDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBDocuments';
|
||||
return 'deleteVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,7 +29,7 @@ class Delete extends DocumentsDelete
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Update as DocumentsUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,7 +18,7 @@ class Update extends DocumentsUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBDocuments';
|
||||
return 'updateVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -30,7 +30,7 @@ class Update extends DocumentsUpdate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Upsert as DocumentsUpsert;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Upsert extends DocumentsUpsert
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'upsertVectorDBDocuments';
|
||||
return 'upsertVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,7 +29,7 @@ class Upsert extends DocumentsUpsert
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Create as DocumentCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -21,7 +21,7 @@ class Create extends DocumentCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBDocument';
|
||||
return 'createVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -38,7 +38,7 @@ class Create extends DocumentCreate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Delete as DocumentDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Delete extends DocumentDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBDocument';
|
||||
return 'deleteVectorsDBDocument';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ class Delete extends DocumentDelete
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Get as DocumentGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Get extends DocumentGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBDocument';
|
||||
return 'getVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,16 +29,16 @@ class Get extends DocumentGet
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Logs;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Logs;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Logs\XList as DocumentLogXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,23 +17,23 @@ class XList extends DocumentLogXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBDocumentLogs';
|
||||
return 'listVectorsDBDocumentLogs';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Update as DocumentUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,7 +18,7 @@ class Update extends DocumentUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBDocument';
|
||||
return 'updateVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -30,7 +30,7 @@ class Update extends DocumentUpdate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Upsert as DocumentUpsert;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -19,7 +19,7 @@ class Upsert extends DocumentUpsert
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'upsertVectorDBDocument';
|
||||
return 'upsertVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -31,7 +31,7 @@ class Upsert extends DocumentUpsert
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\XList as DocumentXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -19,7 +19,7 @@ class XList extends DocumentXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBDocuments';
|
||||
return 'listVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -31,16 +31,16 @@ class XList extends DocumentXList
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Get as CollectionGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,28 +15,28 @@ class Get extends CollectionGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBCollection';
|
||||
return 'getVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDBS_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Create as IndexCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -21,7 +21,7 @@ class Create extends IndexCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBIndex';
|
||||
return 'createVectorsDBIndex';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -33,7 +33,7 @@ class Create extends IndexCreate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Delete as IndexDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Delete extends IndexDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBIndex';
|
||||
return 'deleteVectorsDBIndex';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ class Delete extends IndexDelete
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Get as IndexGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Get extends IndexGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBIndex';
|
||||
return 'getVectorsDBIndex';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -28,16 +28,16 @@ class Get extends IndexGet
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\XList as IndexXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class XList extends IndexXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBIndexes';
|
||||
return 'listVectorsDBIndexes';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,16 +29,16 @@ class XList extends IndexXList
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Logs;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Logs;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Logs\XList as CollectionLogXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,23 +17,23 @@ class XList extends CollectionLogXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBCollectionLogs';
|
||||
return 'listVectorsDBCollectionLogs';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
@@ -24,19 +24,19 @@ class Update extends CollectionAction
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBCollection';
|
||||
return 'updateVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDBS_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Usage;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Usage;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Usage\Get as CollectionUsageGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Get extends CollectionUsageGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBCollectionUsage';
|
||||
return 'getVectorsDBCollectionUsage';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -26,23 +26,23 @@ class Get extends CollectionUsageGet
|
||||
|
||||
protected function getMetric(): string
|
||||
{
|
||||
return METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS_VECTORDB;
|
||||
return METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS_VECTORSDBS;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\XList as CollectionXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,28 +18,28 @@ class XList extends CollectionXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBCollections';
|
||||
return 'listVectorsDBCollections';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION_LIST;
|
||||
return UtopiaResponse::MODEL_VECTORSDBS_COLLECTION_LIST;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Create as DatabaseCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,14 +17,14 @@ class Create extends DatabaseCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBDatabase';
|
||||
return 'createVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Delete as DatabaseDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,14 +15,14 @@ class Delete extends DatabaseDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBDatabase';
|
||||
return 'deleteVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Embeddings\Text;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Embeddings\Text;
|
||||
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action as CreateDocumentAction;
|
||||
@@ -42,23 +42,23 @@ class Create extends CreateDocumentAction
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Get as DatabaseGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,23 +15,23 @@ class Get extends DatabaseGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBDatabase';
|
||||
return 'getVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Logs;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Logs;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Logs\XList as DatabaseLogs;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,24 +18,24 @@ class XList extends DatabaseLogs
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBLogs';
|
||||
return 'listVectorsDBLogs';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Create as TransactionsCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Create extends TransactionsCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBTransaction';
|
||||
return 'createVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class Create extends TransactionsCreate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Delete as TransactionsDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Delete extends TransactionsDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBTransaction';
|
||||
return 'deleteVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class Delete extends TransactionsDelete
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Get as TransactionsGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Get extends TransactionsGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBTransaction';
|
||||
return 'getVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class Get extends TransactionsGet
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Operations;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Operations;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Operations\Create as OperationsCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Create extends OperationsCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBOperations';
|
||||
return 'createVectorsDBOperations';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,16 +29,16 @@ class Create extends OperationsCreate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Update as TransactionsUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Update extends TransactionsUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBTransaction';
|
||||
return 'updateVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -28,16 +28,16 @@ class Update extends TransactionsUpdate
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\XList as TransactionsList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class XList extends TransactionsList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBTransactions';
|
||||
return 'listVectorsDBTransactions';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class XList extends TransactionsList
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Update as DatabaseUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,14 +17,14 @@ class Update extends DatabaseUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBDatabase';
|
||||
return 'updateVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\Get as DatabaseUsageGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,34 +16,34 @@ class Get extends DatabaseUsageGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBUsage';
|
||||
return 'getVectorsDBUsage';
|
||||
}
|
||||
|
||||
public function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORDB;
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORSDBS;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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,
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\XList as DatabaseUsageXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,34 +15,34 @@ class XList extends DatabaseUsageXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBUsage';
|
||||
return 'listVectorsDBUsage';
|
||||
}
|
||||
|
||||
public function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORDBS;
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORSDBSS;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\XList as DatabaseXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,23 +17,23 @@ class XList extends DatabaseXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBDatabases';
|
||||
return 'listVectorsDBDatabases';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->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(
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+35
-35
@@ -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
|
||||
{
|
||||
@@ -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),
|
||||
]),
|
||||
];
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -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':
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
+3
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -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;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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'],
|
||||
|
||||
@@ -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
|
||||
+20
-20
@@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
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\Permissions\DatabasesPermissionsScope;
|
||||
use Tests\E2E\Services\Databases\VectorsDB\Permissions\DatabasesPermissionsScope;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Database\Validator\Authorization;
|
||||
|
||||
class VectorDBPermissionsGuestTest extends Scope
|
||||
class VectorsDBPermissionsGuestTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideClient;
|
||||
@@ -34,7 +34,7 @@ class VectorDBPermissionsGuestTest extends Scope
|
||||
|
||||
public function createCollection(): array
|
||||
{
|
||||
$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']
|
||||
@@ -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'],
|
||||
], [
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
@@ -8,12 +8,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\Permissions\DatabasesPermissionsScope;
|
||||
use Tests\E2E\Services\Databases\VectorsDB\Permissions\DatabasesPermissionsScope;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
|
||||
class VectorDBPermissionsMemberTest extends Scope
|
||||
class VectorsDBPermissionsMemberTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideClient;
|
||||
@@ -59,7 +59,7 @@ class VectorDBPermissionsMemberTest extends Scope
|
||||
{
|
||||
$this->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'],
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
@@ -8,12 +8,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\Permissions\DatabasesPermissionsScope;
|
||||
use Tests\E2E\Services\Databases\VectorsDB\Permissions\DatabasesPermissionsScope;
|
||||
use Utopia\Database\Helpers\ID;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
|
||||
class VectorDBPermissionsTeamTest extends Scope
|
||||
class VectorsDBPermissionsTeamTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideClient;
|
||||
@@ -41,13 +41,13 @@ class VectorDBPermissionsTeamTest extends Scope
|
||||
|
||||
public function createCollections($teams)
|
||||
{
|
||||
$db = $this->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'],
|
||||
+36
-36
@@ -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()));
|
||||
+2
-2
@@ -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;
|
||||
+2
-2
@@ -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;
|
||||
+2
-2
@@ -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;
|
||||
+69
-69
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
use Tests\E2E\Client;
|
||||
@@ -17,7 +17,7 @@ trait DatabasesBase
|
||||
/**
|
||||
* 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']
|
||||
@@ -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']
|
||||
+19
-19
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
use Tests\E2E\Client;
|
||||
@@ -19,7 +19,7 @@ class DatabasesConsoleClientTest extends Scope
|
||||
|
||||
public function testCreateCollection(): array
|
||||
{
|
||||
$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'],
|
||||
], $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()), [
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB;
|
||||
|
||||
use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
@@ -23,7 +23,7 @@ class DatabasesCustomClientTest 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 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']
|
||||
+70
-70
@@ -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']
|
||||
+18
-18
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Permissions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Permissions;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\E2E\Client;
|
||||
@@ -33,7 +33,7 @@ class DatabasesPermissionsGuestTest extends Scope
|
||||
|
||||
public function createCollection(): array
|
||||
{
|
||||
$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']
|
||||
@@ -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'],
|
||||
], [
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Permissions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Permissions;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
@@ -58,7 +58,7 @@ class DatabasesPermissionsMemberTest extends Scope
|
||||
{
|
||||
$this->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'],
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Permissions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Permissions;
|
||||
|
||||
use Tests\E2E\Client;
|
||||
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Permissions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Permissions;
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Depends;
|
||||
@@ -40,13 +40,13 @@ class DatabasesPermissionsTeamTest extends Scope
|
||||
|
||||
public function createCollections($teams)
|
||||
{
|
||||
$db = $this->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'],
|
||||
+36
-36
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Transactions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Transactions;
|
||||
|
||||
use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
@@ -28,7 +28,7 @@ class ACIDTest 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 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()));
|
||||
+154
-154
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Transactions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Transactions;
|
||||
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Transactions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Transactions;
|
||||
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\E2E\Services\Databases\VectorDB\Transactions;
|
||||
namespace Tests\E2E\Services\Databases\VectorsDB\Transactions;
|
||||
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
+19
-19
@@ -12,14 +12,14 @@ use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Database\Query;
|
||||
|
||||
class VectorDBConsoleClientTest extends Scope
|
||||
class VectorsDBConsoleClientTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideConsole;
|
||||
|
||||
public function testCreateCollection(): array
|
||||
{
|
||||
$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'],
|
||||
], $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()), [
|
||||
+14
-14
@@ -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']
|
||||
+71
-71
@@ -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']
|
||||
@@ -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'],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user